Documentation ¶
Index ¶
- func CheckAuth(verify mjwt.Verifier, aud string) func(cb AuthCallback) httprouter.Handle
- func MessageSender(send Smtp) func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, ...)
- func SetupApiServer(listen string, auth func(callback AuthCallback) httprouter.Handle, send Smtp, ...) *http.Server
- type AuthCallback
- type AuthClaims
- type IcCallback
- type Imap
- type Smtp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAuth ¶
func CheckAuth(verify mjwt.Verifier, aud string) func(cb AuthCallback) httprouter.Handle
CheckAuth validates the bearer token against a mjwt.Verifier and returns an error message or continues to the next handler
func MessageSender ¶
func MessageSender(send Smtp) func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims)
MessageSender is the internal handler for `POST /message` requests the access token is already validated at this point
func SetupApiServer ¶
func SetupApiServer(listen string, auth func(callback AuthCallback) httprouter.Handle, send Smtp, recv Imap) *http.Server
Types ¶
type AuthCallback ¶
type AuthCallback func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims)
type AuthClaims ¶
type AuthClaims mjwt.BaseTypeClaims[auth.AccessTokenClaims]
type IcCallback ¶
type IcCallback[T any] func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, cli *imap.Client, t T)
Click to show internal directories.
Click to hide internal directories.