Documentation
¶
Index ¶
- Constants
- func NewAdminRouter(cfg *config.Config, persister persistence.Persister, ...) *echo.Echo
- func NewPublicRouter(cfg *config.Config, persister persistence.Persister, ...) *echo.Echo
- type AuditLogHandler
- type AuditLogListRequest
- type BeginAuthenticationBody
- type EmailAdminHandler
- type EmailHandler
- type HealthHandler
- type MetadataAdminHandler
- type OTPAdminHandler
- type PasscodeHandler
- type PasswordAdminHandler
- type PasswordHandler
- type PasswordLoginBody
- type PasswordSetBody
- type SessionAdminHandler
- type SessionHandler
- type StatusHandler
- type ThirdPartyHandler
- type TokenHandler
- type TokenValidationBody
- type UserCreateBody
- type UserGetByEmailBody
- type UserHandler
- func (h *UserHandler) Create(c echo.Context) error
- func (h *UserHandler) Delete(c echo.Context) error
- func (h *UserHandler) Get(c echo.Context) error
- func (h *UserHandler) GetUserIdByEmail(c echo.Context) error
- func (h *UserHandler) Logout(c echo.Context) error
- func (h *UserHandler) Me(c echo.Context) error
- type UserHandlerAdmin
- type UserListRequest
- type WebauthnCredentialAdminHandler
- type WebauthnHandler
- func (h *WebauthnHandler) BeginAuthentication(c echo.Context) error
- func (h *WebauthnHandler) BeginRegistration(c echo.Context) error
- func (h *WebauthnHandler) DeleteCredential(c echo.Context) error
- func (h *WebauthnHandler) FinishAuthentication(c echo.Context) error
- func (h *WebauthnHandler) FinishRegistration(c echo.Context) error
- func (h *WebauthnHandler) ListCredentials(c echo.Context) error
- func (h *WebauthnHandler) UpdateCredential(c echo.Context) error
- type WebhookHandler
- type WellKnownHandler
Constants ¶
View Source
const ( GetUserFailureMessage = "failed to get user: %w" CastSessionFailureMessage = "failed to cast session object" CreateAuditLogFailureMessage = "failed to create audit log: %w" UserNotFoundMessage = "user not found" SubjectParseFailureMessage = "failed to parse subject as uuid: %w" GetWebauthnCredentialFailureMessage = "failed to get webauthn credentials: %w" StoredChallengeMismatchMessage = "Stored challenge and received challenge do not match" UnknownUserMessage = "unknown user" )
Variables ¶
This section is empty.
Functions ¶
func NewAdminRouter ¶
func NewAdminRouter(cfg *config.Config, persister persistence.Persister, prometheus echo.MiddlewareFunc) *echo.Echo
func NewPublicRouter ¶
func NewPublicRouter(cfg *config.Config, persister persistence.Persister, prometheus echo.MiddlewareFunc, authenticatorMetadata mapper.AuthenticatorMetadata) *echo.Echo
Types ¶
type AuditLogHandler ¶
type AuditLogHandler struct {
// contains filtered or unexported fields
}
func NewAuditLogHandler ¶
func NewAuditLogHandler(persister persistence.Persister) *AuditLogHandler
func (AuditLogHandler) List ¶
func (h AuditLogHandler) List(c echo.Context) error
type AuditLogListRequest ¶
type AuditLogListRequest struct { Page int `query:"page"` PerPage int `query:"per_page"` StartTime *time.Time `query:"start_time"` EndTime *time.Time `query:"end_time"` Types []string `query:"type"` UserId string `query:"actor_user_id"` Email string `query:"actor_email"` IP string `query:"meta_source_ip"` SearchString string `query:"q"` }
type BeginAuthenticationBody ¶
type BeginAuthenticationBody struct {
UserID *string `json:"user_id" validate:"uuid"`
}
type EmailAdminHandler ¶
type EmailAdminHandler interface { List(ctx echo.Context) error Create(ctx echo.Context) error Get(ctx echo.Context) error Delete(ctx echo.Context) error SetPrimaryEmail(ctx echo.Context) error }
func NewEmailAdminHandler ¶
func NewEmailAdminHandler(cfg *config.Config, persister persistence.Persister) EmailAdminHandler
type EmailHandler ¶
type EmailHandler struct {
// contains filtered or unexported fields
}
func NewEmailHandler ¶
func NewEmailHandler(cfg *config.Config, persister persistence.Persister, auditLogger auditlog.Logger) *EmailHandler
func (*EmailHandler) Create ¶
func (h *EmailHandler) Create(c echo.Context) error
func (*EmailHandler) Delete ¶
func (h *EmailHandler) Delete(c echo.Context) error
func (*EmailHandler) List ¶
func (h *EmailHandler) List(c echo.Context) error
func (*EmailHandler) SetPrimaryEmail ¶
func (h *EmailHandler) SetPrimaryEmail(c echo.Context) error
type HealthHandler ¶
type HealthHandler struct{}
func NewHealthHandler ¶
func NewHealthHandler() *HealthHandler
func (*HealthHandler) Alive ¶
func (handler *HealthHandler) Alive(c echo.Context) error
func (*HealthHandler) Ready ¶
func (handler *HealthHandler) Ready(c echo.Context) error
type MetadataAdminHandler ¶
type MetadataAdminHandler struct {
// contains filtered or unexported fields
}
func NewMetadataAdminHandler ¶
func NewMetadataAdminHandler(persister persistence.Persister) *MetadataAdminHandler
func (*MetadataAdminHandler) GetMetadata ¶
func (h *MetadataAdminHandler) GetMetadata(c echo.Context) error
func (*MetadataAdminHandler) PatchMetadata ¶
func (h *MetadataAdminHandler) PatchMetadata(c echo.Context) error
type OTPAdminHandler ¶
func NewOTPAdminHandler ¶
func NewOTPAdminHandler(persister persistence.Persister) OTPAdminHandler
type PasscodeHandler ¶
type PasscodeHandler struct { TTL int // contains filtered or unexported fields }
func NewPasscodeHandler ¶
func (*PasscodeHandler) Finish ¶
func (h *PasscodeHandler) Finish(c echo.Context) error
func (*PasscodeHandler) GetSessionToken ¶
func (h *PasscodeHandler) GetSessionToken(c echo.Context) jwt.Token
func (*PasscodeHandler) Init ¶
func (h *PasscodeHandler) Init(c echo.Context) error
type PasswordAdminHandler ¶
type PasswordAdminHandler interface { Get(ctx echo.Context) error Create(ctx echo.Context) error Update(ctx echo.Context) error Delete(ctx echo.Context) error }
func NewPasswordAdminHandler ¶
func NewPasswordAdminHandler(persister persistence.Persister) PasswordAdminHandler
type PasswordHandler ¶
type PasswordHandler struct {
// contains filtered or unexported fields
}
func NewPasswordHandler ¶
func NewPasswordHandler(persister persistence.Persister, sessionManager session.Manager, cfg *config.Config, auditLogger auditlog.Logger) *PasswordHandler
func (*PasswordHandler) Login ¶
func (h *PasswordHandler) Login(c echo.Context) error
func (*PasswordHandler) Set ¶
func (h *PasswordHandler) Set(c echo.Context) error
type PasswordLoginBody ¶
type PasswordSetBody ¶
type SessionAdminHandler ¶
type SessionAdminHandler struct {
// contains filtered or unexported fields
}
func NewSessionAdminHandler ¶
func NewSessionAdminHandler(cfg *config.Config, persister persistence.Persister, sessionManager session.Manager, auditLogger auditlog.Logger) SessionAdminHandler
func (*SessionAdminHandler) Delete ¶
func (h *SessionAdminHandler) Delete(ctx echo.Context) error
func (*SessionAdminHandler) Generate ¶
func (h *SessionAdminHandler) Generate(ctx echo.Context) error
func (*SessionAdminHandler) List ¶
func (h *SessionAdminHandler) List(ctx echo.Context) error
type SessionHandler ¶
type SessionHandler struct {
// contains filtered or unexported fields
}
func NewSessionHandler ¶
func NewSessionHandler(persister persistence.Persister, sessionManager session.Manager, cfg config.Config) *SessionHandler
func (*SessionHandler) ValidateSession ¶
func (h *SessionHandler) ValidateSession(c echo.Context) error
func (*SessionHandler) ValidateSessionFromBody ¶
func (h *SessionHandler) ValidateSessionFromBody(c echo.Context) error
type StatusHandler ¶
type StatusHandler struct {
// contains filtered or unexported fields
}
func NewStatusHandler ¶
func NewStatusHandler(persister persistence.Persister) *StatusHandler
func (*StatusHandler) Status ¶
func (h *StatusHandler) Status(c echo.Context) error
type ThirdPartyHandler ¶
type ThirdPartyHandler struct {
// contains filtered or unexported fields
}
func NewThirdPartyHandler ¶
func NewThirdPartyHandler(cfg *config.Config, persister persistence.Persister, sessionManager session.Manager, auditLogger auditlog.Logger) *ThirdPartyHandler
func (*ThirdPartyHandler) Auth ¶
func (h *ThirdPartyHandler) Auth(c echo.Context) error
func (*ThirdPartyHandler) Callback ¶
func (h *ThirdPartyHandler) Callback(c echo.Context) error
func (*ThirdPartyHandler) CallbackPost ¶
func (h *ThirdPartyHandler) CallbackPost(c echo.Context) error
type TokenHandler ¶
type TokenHandler struct {
// contains filtered or unexported fields
}
func NewTokenHandler ¶
func NewTokenHandler(cfg *config.Config, persister persistence.Persister, sessionManager session.Manager, auditLogger auditlog.Logger) *TokenHandler
func (TokenHandler) Validate ¶
func (h TokenHandler) Validate(c echo.Context) error
type TokenValidationBody ¶
type TokenValidationBody struct {
Value string `json:"value" validate:"required"`
}
type UserCreateBody ¶
type UserCreateBody struct {
Email string `json:"email" validate:"required,email"`
}
type UserGetByEmailBody ¶
type UserGetByEmailBody struct {
Email string `json:"email" validate:"required,email"`
}
type UserHandler ¶
type UserHandler struct {
// contains filtered or unexported fields
}
func NewUserHandler ¶
func NewUserHandler(cfg *config.Config, persister persistence.Persister, sessionManager session.Manager, auditLogger auditlog.Logger) *UserHandler
func (*UserHandler) Create ¶
func (h *UserHandler) Create(c echo.Context) error
func (*UserHandler) Delete ¶
func (h *UserHandler) Delete(c echo.Context) error
func (*UserHandler) Get ¶
func (h *UserHandler) Get(c echo.Context) error
func (*UserHandler) GetUserIdByEmail ¶
func (h *UserHandler) GetUserIdByEmail(c echo.Context) error
func (*UserHandler) Logout ¶
func (h *UserHandler) Logout(c echo.Context) error
func (*UserHandler) Me ¶
func (h *UserHandler) Me(c echo.Context) error
type UserHandlerAdmin ¶
type UserHandlerAdmin struct {
// contains filtered or unexported fields
}
func NewUserHandlerAdmin ¶
func NewUserHandlerAdmin(persister persistence.Persister) *UserHandlerAdmin
func (*UserHandlerAdmin) Create ¶
func (h *UserHandlerAdmin) Create(c echo.Context) error
func (*UserHandlerAdmin) Delete ¶
func (h *UserHandlerAdmin) Delete(c echo.Context) error
func (*UserHandlerAdmin) Get ¶
func (h *UserHandlerAdmin) Get(c echo.Context) error
func (*UserHandlerAdmin) List ¶
func (h *UserHandlerAdmin) List(c echo.Context) error
type UserListRequest ¶
type WebauthnCredentialAdminHandler ¶
type WebauthnCredentialAdminHandler interface { List(ctx echo.Context) error Get(ctx echo.Context) error Delete(ctx echo.Context) error }
func NewWebauthnCredentialAdminHandler ¶
func NewWebauthnCredentialAdminHandler(persister persistence.Persister) WebauthnCredentialAdminHandler
type WebauthnHandler ¶
type WebauthnHandler struct {
// contains filtered or unexported fields
}
func NewWebauthnHandler ¶
func NewWebauthnHandler(cfg *config.Config, persister persistence.Persister, sessionManager session.Manager, auditLogger auditlog.Logger, authenticatorMetadata mapper.AuthenticatorMetadata) (*WebauthnHandler, error)
NewWebauthnHandler creates a new handler which handles all webauthn related routes
func (*WebauthnHandler) BeginAuthentication ¶
func (h *WebauthnHandler) BeginAuthentication(c echo.Context) error
BeginAuthentication returns credential assertion options for the WebAuthnAPI.
func (*WebauthnHandler) BeginRegistration ¶
func (h *WebauthnHandler) BeginRegistration(c echo.Context) error
BeginRegistration returns credential creation options for the WebAuthnAPI. It expects a valid session JWT in the request.
func (*WebauthnHandler) DeleteCredential ¶
func (h *WebauthnHandler) DeleteCredential(c echo.Context) error
func (*WebauthnHandler) FinishAuthentication ¶
func (h *WebauthnHandler) FinishAuthentication(c echo.Context) error
FinishAuthentication validates the WebAuthnAPI response and on success it returns a new session JWT.
func (*WebauthnHandler) FinishRegistration ¶
func (h *WebauthnHandler) FinishRegistration(c echo.Context) error
FinishRegistration validates the WebAuthnAPI response and associates the credential with the user. It expects a valid session JWT in the request. The session JWT must be associated to the same user who requested the credential creation options.
func (*WebauthnHandler) ListCredentials ¶
func (h *WebauthnHandler) ListCredentials(c echo.Context) error
func (*WebauthnHandler) UpdateCredential ¶
func (h *WebauthnHandler) UpdateCredential(c echo.Context) error
type WebhookHandler ¶
type WebhookHandler interface { List(ctx echo.Context) error Create(ctx echo.Context) error Get(ctx echo.Context) error Delete(ctx echo.Context) error Update(ctx echo.Context) error }
func NewWebhookHandler ¶
func NewWebhookHandler(cfg config.WebhookSettings, persister persistence.Persister) WebhookHandler
type WellKnownHandler ¶
type WellKnownHandler struct {
// contains filtered or unexported fields
}
func NewWellKnownHandler ¶
func (*WellKnownHandler) GetConfig ¶
func (h *WellKnownHandler) GetConfig(c echo.Context) error
func (*WellKnownHandler) GetPublicKeys ¶
func (h *WellKnownHandler) GetPublicKeys(c echo.Context) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.