Documentation ¶
Index ¶
- Variables
- type MiddlewareHook
- type MiddlewareHookFunc
- type MiddlewareOptions
- type MiddlewareToggle
- type Server
- func (s *Server) HandleJWTCreate(ctx context.Context, req model.ValidJWTCreateRequest) (model.JWTCreateResponse, error)
- func (s *Server) HandleJWTValidate(ctx context.Context, req model.ValidJWTValidateRequest) (model.JWTValidateResponse, error)
- func (s *Server) HandleMagicLinkCreate(ctx context.Context, req model.ValidMagicLinkCreateRequest) (response model.MagicLinkCreateResponse, err error)
- func (s *Server) HandleMagicLinkEmailCreate(ctx context.Context, req model.ValidMagicLinkEmailCreateRequest) (model.MagicLinkEmailCreateResponse, error)
- func (s *Server) HandleOTPCreate(ctx context.Context, req model.ValidOTPCreateRequest) (response model.OTPCreateResponse, err error)
- func (s *Server) HandleOTPEmailCreate(ctx context.Context, req model.ValidOTPEmailCreateRequest) (response model.OTPEmailCreateResponse, err error)
- func (s *Server) HandleOTPValidate(ctx context.Context, req model.ValidOTPValidateRequest) (response model.OTPValidateResponse, err error)
- func (s *Server) HandleServiceAccountCreate(ctx context.Context, args model.ValidServiceAccountCreateRequest) (model.ServiceAccountCreateResponse, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRegisteredClaimProvided is returned when a registered claim is provided. ErrRegisteredClaimProvided = errors.New("registered claims should not be provided") // ErrJWTAlgNotFound is returned when a JWT alg is not found. ErrJWTAlgNotFound = errors.New("JWT alg not found") )
View Source
var ( // ErrToken is returned when the JWT is invalid. ErrToken = errors.New("JWT invalid") )
Functions ¶
This section is empty.
Types ¶
type MiddlewareHook ¶
type MiddlewareHook interface {
Hook(options MiddlewareOptions) MiddlewareOptions
}
MiddlewareHook is a function that can be used to modify the middleware options.
type MiddlewareHookFunc ¶
type MiddlewareHookFunc func(options MiddlewareOptions) MiddlewareOptions
MiddlewareHookFunc is a function that can be used to modify the middleware options.
func (MiddlewareHookFunc) Hook ¶
func (h MiddlewareHookFunc) Hook(options MiddlewareOptions) MiddlewareOptions
type MiddlewareOptions ¶
type MiddlewareOptions struct { Handler http.Handler Path string Toggle MiddlewareToggle }
MiddlewareOptions contains options for applying middleware.
type MiddlewareToggle ¶
MiddlewareToggle contains fields to turn middleware on and off.
type Server ¶
type Server struct { Config config.Config Ctx context.Context EmailProvider email.Provider HTTPMux *http.ServeMux JWKS jwkset.Storage Limiter rlimit.RateLimiter MagicLink magiclink.MagicLink Store storage.Storage Logger *slog.Logger MiddlewareHook MiddlewareHook }
Server is the magiclinksdev server.
func (*Server) HandleJWTCreate ¶
func (s *Server) HandleJWTCreate(ctx context.Context, req model.ValidJWTCreateRequest) (model.JWTCreateResponse, error)
func (*Server) HandleJWTValidate ¶
func (s *Server) HandleJWTValidate(ctx context.Context, req model.ValidJWTValidateRequest) (model.JWTValidateResponse, error)
func (*Server) HandleMagicLinkCreate ¶ added in v0.6.0
func (s *Server) HandleMagicLinkCreate(ctx context.Context, req model.ValidMagicLinkCreateRequest) (response model.MagicLinkCreateResponse, err error)
func (*Server) HandleMagicLinkEmailCreate ¶ added in v0.6.0
func (s *Server) HandleMagicLinkEmailCreate(ctx context.Context, req model.ValidMagicLinkEmailCreateRequest) (model.MagicLinkEmailCreateResponse, error)
func (*Server) HandleOTPCreate ¶ added in v0.6.0
func (s *Server) HandleOTPCreate(ctx context.Context, req model.ValidOTPCreateRequest) (response model.OTPCreateResponse, err error)
func (*Server) HandleOTPEmailCreate ¶ added in v0.6.0
func (s *Server) HandleOTPEmailCreate(ctx context.Context, req model.ValidOTPEmailCreateRequest) (response model.OTPEmailCreateResponse, err error)
func (*Server) HandleOTPValidate ¶ added in v0.6.0
func (s *Server) HandleOTPValidate(ctx context.Context, req model.ValidOTPValidateRequest) (response model.OTPValidateResponse, err error)
func (*Server) HandleServiceAccountCreate ¶
func (s *Server) HandleServiceAccountCreate(ctx context.Context, args model.ValidServiceAccountCreateRequest) (model.ServiceAccountCreateResponse, error)
HandleServiceAccountCreate handles the service account creation endpoint.
Click to show internal directories.
Click to hide internal directories.