Documentation ¶
Index ¶
- Constants
- Variables
- func HasReachedState(expected, actual State) bool
- func PostHookVerificationExecutorNames(e []PostHookExecutor) []string
- type AdminHandler
- type ErrorHandler
- type ErrorHandlerProvider
- type Flow
- type FlowExpiredError
- type FlowPersistenceProvider
- type FlowPersister
- type Handler
- type HandlerProvider
- type HookExecutor
- type HookExecutorProvider
- type HooksProvider
- type PostHookExecutor
- type PostHookExecutorFunc
- type PublicHandler
- type State
- type Strategies
- type Strategy
- type StrategyProvider
Constants ¶
View Source
const ( RouteInitBrowserFlow = "/self-service/verification/browser" RouteInitAPIFlow = "/self-service/verification/api" RouteGetFlow = "/self-service/verification/flows" RouteSubmitFlow = "/self-service/verification" )
View Source
const (
StrategyVerificationLinkName = "link"
)
Variables ¶
View Source
var (
ErrHookAbortFlow = errors.New("aborted verification hook execution")
)
Functions ¶
func HasReachedState ¶
func PostHookVerificationExecutorNames ¶
func PostHookVerificationExecutorNames(e []PostHookExecutor) []string
Types ¶
type AdminHandler ¶
type AdminHandler interface {
RegisterAdminVerificationRoutes(admin *x.RouterAdmin)
}
type ErrorHandler ¶
type ErrorHandler struct {
// contains filtered or unexported fields
}
func NewErrorHandler ¶
func NewErrorHandler(d errorHandlerDependencies) *ErrorHandler
func (*ErrorHandler) WriteFlowError ¶
func (s *ErrorHandler) WriteFlowError( w http.ResponseWriter, r *http.Request, f *Flow, group node.Group, err error, )
type ErrorHandlerProvider ¶
type ErrorHandlerProvider interface {
VerificationFlowErrorHandler() *ErrorHandler
}
type Flow ¶
type Flow struct { // ID represents the request's unique ID. When performing the verification flow, this // represents the id in the verify ui's query parameter: http://<selfservice.flows.verification.ui_url>?request=<id> // // type: string // format: uuid // required: true ID uuid.UUID `json:"id" db:"id" faker:"-"` // Type represents the flow's type which can be either "api" or "browser", depending on the flow interaction. // required: true Type flow.Type `json:"type" db:"type" faker:"flow_type"` // ExpiresAt is the time (UTC) when the request expires. If the user still wishes to verify the address, // a new request has to be initiated. ExpiresAt time.Time `json:"expires_at" faker:"time_type" db:"expires_at"` // IssuedAt is the time (UTC) when the request occurred. IssuedAt time.Time `json:"issued_at" faker:"time_type" db:"issued_at"` // RequestURL is the initial URL that was requested from Ory Kratos. It can be used // to forward information contained in the URL's path or query for example. RequestURL string `json:"request_url" db:"request_url"` // Active, if set, contains the registration method that is being used. It is initially // not set. Active sqlxx.NullString `json:"active,omitempty" faker:"-" db:"active_method"` // UI contains data which must be shown in the user interface. // // required: true UI *container.Container `json:"ui" db:"ui"` // State represents the state of this request: // // - choose_method: ask the user to choose a method (e.g. verify your email) // - sent_email: the email has been sent to the user // - passed_challenge: the request was successful and the verification challenge was passed. // // required: true State State `json:"state" faker:"-" db:"state"` // CSRFToken contains the anti-csrf token associated with this request. CSRFToken string `json:"-" db:"csrf_token"` // CreatedAt is a helper struct field for gobuffalo.pop. CreatedAt time.Time `json:"-" faker:"-" db:"created_at"` // UpdatedAt is a helper struct field for gobuffalo.pop. UpdatedAt time.Time `json:"-" faker:"-" db:"updated_at"` NID uuid.UUID `json:"-" faker:"-" db:"nid"` }
A Verification Flow
Used to verify an out-of-band communication channel such as an email address or a phone number.
For more information head over to: https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation
swagger:model selfServiceVerificationFlow
func NewPostHookFlow ¶
func (*Flow) GetRequestURL ¶
type FlowExpiredError ¶
type FlowExpiredError struct { *herodot.DefaultError // contains filtered or unexported fields }
func NewFlowExpiredError ¶
func NewFlowExpiredError(at time.Time) *FlowExpiredError
type FlowPersistenceProvider ¶
type FlowPersistenceProvider interface {
VerificationFlowPersister() FlowPersister
}
type FlowPersister ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(d handlerDependencies) *Handler
func (*Handler) RegisterAdminRoutes ¶
func (h *Handler) RegisterAdminRoutes(admin *x.RouterAdmin)
func (*Handler) RegisterPublicRoutes ¶
func (h *Handler) RegisterPublicRoutes(public *x.RouterPublic)
type HandlerProvider ¶
type HandlerProvider interface {
VerificationHandler() *Handler
}
type HookExecutor ¶
type HookExecutor struct {
// contains filtered or unexported fields
}
func NewHookExecutor ¶
func NewHookExecutor(d executorDependencies) *HookExecutor
func (*HookExecutor) PostVerificationHook ¶
func (e *HookExecutor) PostVerificationHook(w http.ResponseWriter, r *http.Request, a *Flow, i *identity.Identity) error
type HookExecutorProvider ¶
type HookExecutorProvider interface {
VerificationExecutor() *HookExecutor
}
type HooksProvider ¶
type HooksProvider interface {
PostVerificationHooks(ctx context.Context) []PostHookExecutor
}
type PostHookExecutor ¶
type PostHookExecutorFunc ¶
type PostHookExecutorFunc func(w http.ResponseWriter, r *http.Request, a *Flow, i *identity.Identity) error
func (PostHookExecutorFunc) ExecutePostVerificationHook ¶
func (f PostHookExecutorFunc) ExecutePostVerificationHook(w http.ResponseWriter, r *http.Request, a *Flow, i *identity.Identity) error
type PublicHandler ¶
type PublicHandler interface {
RegisterPublicVerificationRoutes(public *x.RouterPublic)
}
type State ¶
type State string
Verification Flow State
The state represents the state of the verification flow.
- choose_method: ask the user to choose a method (e.g. recover account via email) - sent_email: the email has been sent to the user - passed_challenge: the request was successful and the recovery challenge was passed.
swagger:model selfServiceVerificationFlowState
type Strategies ¶
type Strategies []Strategy
func (Strategies) MustStrategy ¶
func (s Strategies) MustStrategy(id string) Strategy
func (Strategies) RegisterAdminRoutes ¶
func (s Strategies) RegisterAdminRoutes(r *x.RouterAdmin)
func (Strategies) RegisterPublicRoutes ¶
func (s Strategies) RegisterPublicRoutes(r *x.RouterPublic)
type StrategyProvider ¶
type StrategyProvider interface { VerificationStrategies(ctx context.Context) Strategies AllVerificationStrategies() Strategies }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.