handler

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2023 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HankoThirdpartyStateCookie = "hanko_thirdparty_state"
	HankoTokenQuery            = "hanko_token"
)

Variables

This section is empty.

Functions

func NewAdminRouter added in v0.6.0

func NewAdminRouter(cfg *config.Config, persister persistence.Persister, prometheus *prometheus.Prometheus) *echo.Echo

func NewPublicRouter added in v0.6.0

func NewPublicRouter(cfg *config.Config, persister persistence.Persister, prometheus *prometheus.Prometheus) *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:"uuid4"`
}

type EmailHandler

type EmailHandler struct {
	// contains filtered or unexported fields
}

func NewEmailHandler

func NewEmailHandler(cfg *config.Config, persister persistence.Persister, sessionManager session.Manager, auditLogger auditlog.Logger) (*EmailHandler, error)

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 PasscodeHandler

type PasscodeHandler struct {
	TTL int
	// contains filtered or unexported fields
}

func NewPasscodeHandler

func NewPasscodeHandler(cfg *config.Config, persister persistence.Persister, sessionManager session.Manager, mailer mail.Mailer, auditLogger auditlog.Logger) (*PasscodeHandler, error)

func (*PasscodeHandler) Finish

func (h *PasscodeHandler) Finish(c echo.Context) error

func (*PasscodeHandler) Init

func (h *PasscodeHandler) Init(c echo.Context) error

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 PasswordLoginBody struct {
	UserId   string `json:"user_id" validate:"required,uuid4"`
	Password string `json:"password" validate:"required"`
}

type PasswordSetBody

type PasswordSetBody struct {
	UserID   string `json:"user_id" validate:"required,uuid4"`
	Password string `json:"password" validate:"required"`
}

type ThirdPartyHandler added in v0.5.0

type ThirdPartyHandler struct {
	// contains filtered or unexported fields
}

func NewThirdPartyHandler added in v0.5.0

func NewThirdPartyHandler(cfg *config.Config, persister persistence.Persister, sessionManager session.Manager, auditLogger auditlog.Logger) *ThirdPartyHandler

func (*ThirdPartyHandler) Auth added in v0.5.0

func (h *ThirdPartyHandler) Auth(c echo.Context) error

func (*ThirdPartyHandler) Callback added in v0.5.0

func (h *ThirdPartyHandler) Callback(c echo.Context) error

type TokenHandler added in v0.6.0

type TokenHandler struct {
	// contains filtered or unexported fields
}

func NewTokenHandler added in v0.6.0

func NewTokenHandler(cfg *config.Config, persister persistence.Persister, sessionManager session.Manager, auditLogger auditlog.Logger) *TokenHandler

func (TokenHandler) Validate added in v0.6.0

func (h TokenHandler) Validate(c echo.Context) error

type TokenValidationBody added in v0.6.0

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 added in v0.6.0

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 added in v0.5.0

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) 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 UserListRequest struct {
	PerPage       int    `query:"per_page"`
	Page          int    `query:"page"`
	Email         string `query:"email"`
	UserId        string `query:"user_id"`
	SortDirection string `query:"sort_direction"`
}

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) (*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 WellKnownHandler

type WellKnownHandler struct {
	// contains filtered or unexported fields
}

func NewWellKnownHandler

func NewWellKnownHandler(config config.Config, jwkManager hankoJwk.Manager) (*WellKnownHandler, error)

func (*WellKnownHandler) GetConfig

func (h *WellKnownHandler) GetConfig(c echo.Context) error

func (*WellKnownHandler) GetPublicKeys

func (h *WellKnownHandler) GetPublicKeys(c echo.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL