Documentation
¶
Index ¶
- Constants
- Variables
- func TestRequestPersister(p RequestPersister) func(t *testing.T)
- type ErrorHandler
- type ErrorHandlerProvider
- type Handler
- type HandlerProvider
- type HookExecutor
- type HookExecutorProvider
- type HooksProvider
- type PostHookPostPersistExecutor
- type PostHookPostPersistExecutorFunc
- type PostHookPrePersistExecutor
- type PostHookPrePersistExecutorFunc
- type PreHookExecutor
- type PreHookExecutorFunc
- type Request
- func (r *Request) AfterCreate(c *pop.Connection) error
- func (r *Request) AfterFind(_ *pop.Connection) error
- func (r *Request) AfterUpdate(c *pop.Connection) error
- func (r *Request) BeforeSave(_ *pop.Connection) error
- func (r *Request) GetID() uuid.UUID
- func (r *Request) IsForced() bool
- func (r Request) TableName() string
- func (r *Request) Valid() error
- type RequestMethod
- type RequestMethodConfig
- type RequestMethodConfigurator
- type RequestMethods
- type RequestMethodsRaw
- type RequestPersistenceProvider
- type RequestPersister
- type Strategies
- type Strategy
- type StrategyProvider
Constants ¶
View Source
const ( BrowserRegistrationPath = "/self-service/browser/flows/registration" BrowserRegistrationRequestsPath = "/self-service/browser/flows/requests/registration" )
Variables ¶
View Source
var (
ErrHookAbortRequest = errors.New("aborted registration hook execution")
)
Functions ¶
func TestRequestPersister ¶
func TestRequestPersister(p RequestPersister) func(t *testing.T)
Types ¶
type ErrorHandler ¶
type ErrorHandler struct {
// contains filtered or unexported fields
}
func NewErrorHandler ¶
func NewErrorHandler(d errorHandlerDependencies, c configuration.Provider) *ErrorHandler
func (*ErrorHandler) HandleRegistrationError ¶
func (s *ErrorHandler) HandleRegistrationError( w http.ResponseWriter, r *http.Request, ct identity.CredentialsType, rr *Request, err error, )
type ErrorHandlerProvider ¶
type ErrorHandlerProvider interface{ RegistrationRequestErrorHandler() *ErrorHandler }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(d handlerDependencies, c configuration.Provider) *Handler
func (*Handler) NewRegistrationRequest ¶
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 {
RegistrationHandler() *Handler
}
type HookExecutor ¶
type HookExecutor struct {
// contains filtered or unexported fields
}
func NewHookExecutor ¶
func NewHookExecutor(d executorDependencies, c configuration.Provider) *HookExecutor
func (*HookExecutor) PostRegistrationHook ¶
func (e *HookExecutor) PostRegistrationHook(w http.ResponseWriter, r *http.Request, ct identity.CredentialsType, a *Request, i *identity.Identity) error
func (*HookExecutor) PreRegistrationHook ¶
func (e *HookExecutor) PreRegistrationHook(w http.ResponseWriter, r *http.Request, a *Request) error
type HookExecutorProvider ¶
type HookExecutorProvider interface {
RegistrationExecutor() *HookExecutor
}
type HooksProvider ¶
type HooksProvider interface { PreRegistrationHooks() []PreHookExecutor PostRegistrationPrePersistHooks(credentialsType identity.CredentialsType) []PostHookPrePersistExecutor PostRegistrationPostPersistHooks(credentialsType identity.CredentialsType) []PostHookPostPersistExecutor }
type PostHookPostPersistExecutorFunc ¶
type PostHookPostPersistExecutorFunc func(w http.ResponseWriter, r *http.Request, a *Request, s *session.Session) error
func (PostHookPostPersistExecutorFunc) ExecutePostRegistrationPostPersistHook ¶
func (f PostHookPostPersistExecutorFunc) ExecutePostRegistrationPostPersistHook(w http.ResponseWriter, r *http.Request, a *Request, s *session.Session) error
type PostHookPrePersistExecutorFunc ¶
type PostHookPrePersistExecutorFunc func(w http.ResponseWriter, r *http.Request, a *Request, i *identity.Identity) error
func (PostHookPrePersistExecutorFunc) ExecutePostRegistrationPrePersistHook ¶
func (f PostHookPrePersistExecutorFunc) ExecutePostRegistrationPrePersistHook(w http.ResponseWriter, r *http.Request, a *Request, i *identity.Identity) error
type PreHookExecutor ¶
type PreHookExecutorFunc ¶
func (PreHookExecutorFunc) ExecuteRegistrationPreHook ¶
func (f PreHookExecutorFunc) ExecuteRegistrationPreHook(w http.ResponseWriter, r *http.Request, a *Request) error
type Request ¶
type Request struct { // ID represents the request's unique ID. When performing the registration flow, this // represents the id in the registration ui's query parameter: http://<urls.registration_ui>/?request=<id> // // required: true ID uuid.UUID `json:"id" faker:"uuid" db:"id" rw:"r"` // ExpiresAt is the time (UTC) when the request expires. If the user still wishes to log in, // 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"` // Active, if set, contains the registration method that is being used. It is initially // not set. // // required: true Active identity.CredentialsType `json:"active,omitempty" db:"active_method"` // Methods contains context for all enabled registration methods. If a registration request has been // processed, but for example the password is incorrect, this will contain error messages. // // required: true Methods map[identity.CredentialsType]*RequestMethod `json:"methods" faker:"registration_request_methods" db:"-"` // MethodsRaw is a helper struct field for gobuffalo.pop. MethodsRaw RequestMethodsRaw `json:"-" faker:"-" has_many:"selfservice_registration_request_methods" fk_id:"selfservice_registration_request_id"` // CreatedAt is a helper struct field for gobuffalo.pop. CreatedAt time.Time `json:"-" db:"created_at"` // UpdatedAt is a helper struct field for gobuffalo.pop. UpdatedAt time.Time `json:"-" db:"updated_at"` // CSRFToken contains the anti-csrf token associated with this request. CSRFToken string `json:"-" db:"csrf_token"` }
swagger:model registrationRequest
func (*Request) AfterCreate ¶
func (*Request) AfterUpdate ¶
func (*Request) BeforeSave ¶
type RequestMethod ¶
type RequestMethod struct { // Method contains the request credentials type. Method identity.CredentialsType `json:"method" db:"method"` // Config is the credential type's config. Config *RequestMethodConfig `json:"config" db:"config"` // ID is a helper struct field for gobuffalo.pop. ID uuid.UUID `json:"-" db:"id" rw:"r"` // RequestID is a helper struct field for gobuffalo.pop. RequestID uuid.UUID `json:"-" db:"selfservice_registration_request_id"` // Request is a helper struct field for gobuffalo.pop. Request *Request `json:"-" belongs_to:"selfservice_registration_request" fk_id:"RequestID"` // CreatedAt is a helper struct field for gobuffalo.pop. CreatedAt time.Time `json:"-" db:"created_at"` // UpdatedAt is a helper struct field for gobuffalo.pop. UpdatedAt time.Time `json:"-" db:"updated_at"` }
swagger:model registrationRequestMethod
func (RequestMethod) TableName ¶
func (u RequestMethod) TableName() string
type RequestMethodConfig ¶
type RequestMethodConfig struct { // swagger:ignore RequestMethodConfigurator // contains filtered or unexported fields }
swagger:model registrationRequestMethodConfig
func (*RequestMethodConfig) MarshalJSON ¶
func (c *RequestMethodConfig) MarshalJSON() ([]byte, error)
func (*RequestMethodConfig) Scan ¶
func (c *RequestMethodConfig) Scan(value interface{}) error
func (*RequestMethodConfig) UnmarshalJSON ¶
func (c *RequestMethodConfig) UnmarshalJSON(data []byte) error
type RequestMethodConfigurator ¶
type RequestMethodConfigurator interface { form.ErrorParser form.FieldSetter form.ValueSetter form.Resetter form.CSRFSetter form.FieldSorter form.ErrorAdder }
swagger:ignore
type RequestMethods ¶
type RequestMethods map[identity.CredentialsType]*RequestMethod
func (RequestMethods) TableName ¶
func (u RequestMethods) TableName() string
type RequestMethodsRaw ¶
type RequestMethodsRaw []RequestMethod // workaround for https://github.com/gobuffalo/pop/pull/478
func (RequestMethodsRaw) TableName ¶
func (u RequestMethodsRaw) TableName() string
type RequestPersistenceProvider ¶
type RequestPersistenceProvider interface {
RegistrationRequestPersister() RequestPersister
}
type RequestPersister ¶
type Strategies ¶
type Strategies []Strategy
func (Strategies) MustStrategy ¶
func (s Strategies) MustStrategy(id identity.CredentialsType) Strategy
func (Strategies) RegisterPublicRoutes ¶
func (s Strategies) RegisterPublicRoutes(r *x.RouterPublic)
func (Strategies) Strategy ¶
func (s Strategies) Strategy(id identity.CredentialsType) (Strategy, error)
type Strategy ¶
type Strategy interface { ID() identity.CredentialsType RegisterRegistrationRoutes(*x.RouterPublic) PopulateRegistrationMethod(r *http.Request, sr *Request) error }
type StrategyProvider ¶
type StrategyProvider interface {
RegistrationStrategies() Strategies
}
Click to show internal directories.
Click to hide internal directories.