Documentation ¶
Index ¶
- Constants
- Variables
- func PostHookRecoveryExecutorNames(e []PostHookExecutor) []string
- type AdminHandler
- type ErrorHandler
- type ErrorHandlerProvider
- type Flow
- func (f *Flow) AfterFind(*pop.Connection) error
- func (f *Flow) AfterSave(*pop.Connection) error
- func (f *Flow) AppendTo(src *url.URL) *url.URL
- func (f *Flow) GetFlowName() flow.FlowName
- func (f Flow) GetID() uuid.UUID
- func (f Flow) GetNID() uuid.UUID
- func (f *Flow) GetRequestURL() string
- func (f *Flow) GetState() State
- func (f *Flow) GetType() flow.Type
- func (f *Flow) GetUI() *container.Container
- func (f Flow) MarshalJSON() ([]byte, error)
- func (f *Flow) SetCSRFToken(token string)
- func (f *Flow) SetReturnTo()
- func (f *Flow) SetState(state State)
- func (f Flow) TableName(ctx context.Context) string
- func (f *Flow) Valid() error
- type FlowPersistenceProvider
- type FlowPersister
- type Handler
- type HandlerProvider
- type HookExecutor
- type HookExecutorProvider
- type HooksProvider
- type PostHookExecutor
- type PostHookExecutorFunc
- type PreHookExecutor
- type PreHookExecutorFunc
- type PublicHandler
- type RecoveryMethod
- type State
- type Strategies
- type Strategy
- type StrategyProvider
Constants ¶
View Source
const ( RouteInitBrowserFlow = "/self-service/recovery/browser" RouteInitAPIFlow = "/self-service/recovery/api" RouteGetFlow = "/self-service/recovery/flows" RouteSubmitFlow = "/self-service/recovery" )
Variables ¶
View Source
var ( ErrHookAbortFlow = errors.New("aborted recovery hook execution") ErrAlreadyLoggedIn = herodot.ErrBadRequest.WithID(text.ErrIDAlreadyLoggedIn).WithReason("A valid session was detected and thus recovery is not possible.") )
Functions ¶
func PostHookRecoveryExecutorNames ¶
func PostHookRecoveryExecutorNames(e []PostHookExecutor) []string
Types ¶
type AdminHandler ¶
type AdminHandler interface {
RegisterAdminRecoveryRoutes(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.UiNodeGroup, recoveryErr error, )
type ErrorHandlerProvider ¶
type ErrorHandlerProvider interface {
RecoveryFlowErrorHandler() *ErrorHandler
}
type Flow ¶
type Flow struct { // ID represents the request's unique ID. When performing the recovery flow, this // represents the id in the recovery ui's query parameter: http://<selfservice.flows.recovery.ui_url>?request=<id> // // required: true // type: string // format: uuid 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 update the setting, // a new request has to be initiated. // // required: true ExpiresAt time.Time `json:"expires_at" faker:"time_type" db:"expires_at"` // IssuedAt is the time (UTC) when the request occurred. // // required: true 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. // // required: true RequestURL string `json:"request_url" db:"request_url"` // ReturnTo contains the requested return_to URL. ReturnTo string `json:"return_to,omitempty" db:"-"` // Active, if set, contains the recovery 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. 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. // // 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"` // RecoveredIdentityID is a helper struct field for gobuffalo.pop. RecoveredIdentityID uuid.NullUUID `json:"-" faker:"-" db:"recovered_identity_id"` NID uuid.UUID `json:"-" faker:"-" db:"nid"` // DangerousSkipCSRFCheck indicates whether anti CSRF measures should be enforced in this flow // // This is needed, because we can not enforce these measures, if the flow has been initialized by someone else than // the user. DangerousSkipCSRFCheck bool `json:"-" faker:"-" db:"skip_csrf_check"` // Contains possible actions that could follow this flow ContinueWith []flow.ContinueWith `json:"continue_with,omitempty" faker:"-" db:"-"` }
A Recovery Flow
This request is used when an identity wants to recover their account.
We recommend reading the [Account Recovery Documentation](../self-service/flows/password-reset-account-recovery)
swagger:model recoveryFlow
func FromOldFlow ¶
func (*Flow) GetFlowName ¶ added in v1.1.0
func (*Flow) GetRequestURL ¶
func (Flow) MarshalJSON ¶
func (*Flow) SetCSRFToken ¶
func (*Flow) SetReturnTo ¶
func (f *Flow) SetReturnTo()
type FlowPersistenceProvider ¶
type FlowPersistenceProvider interface {
RecoveryFlowPersister() 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 {
RecoveryHandler() *Handler
}
type HookExecutor ¶
type HookExecutor struct {
// contains filtered or unexported fields
}
func NewHookExecutor ¶
func NewHookExecutor(d executorDependencies) *HookExecutor
func (*HookExecutor) PostRecoveryHook ¶
func (e *HookExecutor) PostRecoveryHook(w http.ResponseWriter, r *http.Request, a *Flow, s *session.Session) error
func (*HookExecutor) PreRecoveryHook ¶ added in v0.11.0
func (e *HookExecutor) PreRecoveryHook(w http.ResponseWriter, r *http.Request, a *Flow) error
type HookExecutorProvider ¶
type HookExecutorProvider interface {
RecoveryExecutor() *HookExecutor
}
type HooksProvider ¶
type HooksProvider interface { PreRecoveryHooks(ctx context.Context) []PreHookExecutor PostRecoveryHooks(ctx context.Context) []PostHookExecutor }
type PostHookExecutor ¶
type PostHookExecutorFunc ¶
type PostHookExecutorFunc func(w http.ResponseWriter, r *http.Request, a *Flow, s *session.Session) error
func (PostHookExecutorFunc) ExecutePostRecoveryHook ¶
func (f PostHookExecutorFunc) ExecutePostRecoveryHook(w http.ResponseWriter, r *http.Request, a *Flow, s *session.Session) error
type PreHookExecutor ¶ added in v0.11.0
type PreHookExecutorFunc ¶ added in v0.11.0
func (PreHookExecutorFunc) ExecuteRecoveryPreHook ¶ added in v0.11.0
func (f PreHookExecutorFunc) ExecuteRecoveryPreHook(w http.ResponseWriter, r *http.Request, a *Flow) error
type PublicHandler ¶
type PublicHandler interface {
RegisterPublicRecoveryRoutes(public *x.RouterPublic)
}
type RecoveryMethod ¶ added in v0.13.0
type RecoveryMethod string
const ( RecoveryStrategyLink RecoveryMethod = "link" RecoveryStrategyCode RecoveryMethod = "code" )
type State ¶
Recovery Flow State
The state represents the state of the recovery 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 recoveryFlowState
type Strategies ¶
type Strategies []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 { AllRecoveryStrategies() Strategies RecoveryStrategies(ctx context.Context) Strategies GetActiveRecoveryStrategy(ctx context.Context) (Strategy, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.