Documentation ¶
Index ¶
- Constants
- Variables
- func TestPersister(p interface{ ... }) func(t *testing.T)
- type CreateRecoveryLink
- type FlowMethod
- type RecoveryToken
- type RecoveryTokenPersistenceProvider
- type RecoveryTokenPersister
- type Sender
- func (s *Sender) SendRecoveryLink(ctx context.Context, f *recovery.Flow, via identity.VerifiableAddressType, ...) error
- func (s *Sender) SendRecoveryTokenTo(ctx context.Context, address *identity.RecoveryAddress, token *RecoveryToken) error
- func (s *Sender) SendVerificationLink(ctx context.Context, f *verification.Flow, via identity.VerifiableAddressType, ...) error
- func (s *Sender) SendVerificationTokenTo(ctx context.Context, address *identity.VerifiableAddress, ...) error
- type SenderProvider
- type Strategy
- func (s *Strategy) PopulateRecoveryMethod(r *http.Request, req *recovery.Flow) error
- func (s *Strategy) PopulateVerificationMethod(r *http.Request, req *verification.Flow) error
- func (s *Strategy) RecoveryStrategyID() string
- func (s *Strategy) RegisterAdminRecoveryRoutes(admin *x.RouterAdmin)
- func (s *Strategy) RegisterAdminVerificationRoutes(admin *x.RouterAdmin)
- func (s *Strategy) RegisterPublicRecoveryRoutes(public *x.RouterPublic)
- func (s *Strategy) RegisterPublicVerificationRoutes(public *x.RouterPublic)
- func (s *Strategy) VerificationStrategyID() string
- type VerificationToken
- type VerificationTokenPersistenceProvider
- type VerificationTokenPersister
Constants ¶
View Source
const ( RouteRecovery = "/self-service/recovery/methods/link" // #nosec G101 RouteAdminCreateRecoveryLink = "/recovery/link" )
View Source
const (
RouteVerification = "/self-service/verification/methods/link"
)
Variables ¶
View Source
var ErrUnknownAddress = errors.New("verification requested for unknown address")
Functions ¶
func TestPersister ¶
func TestPersister(p interface { RecoveryTokenPersister VerificationTokenPersister recovery.FlowPersister verification.FlowPersister identity.PrivilegedPool }) func(t *testing.T)
Types ¶
type CreateRecoveryLink ¶
type CreateRecoveryLink struct { // Identity to Recover // // The identity's ID you wish to recover. // // required: true IdentityID uuid.UUID `json:"identity_id"` // Link Expires In // // The recovery link will expire at that point in time. Defaults to the configuration value of // `selfservice.flows.recovery.request_lifespan`. // // // pattern: ^[0-9]+(ns|us|ms|s|m|h)$ // example: // - 1h // - 1m // - 1s ExpiresIn string `json:"expires_in"` }
type FlowMethod ¶
FlowMethod contains the configuration for this selfservice strategy.
type RecoveryToken ¶
type RecoveryToken struct { // ID represents the tokens's unique ID. // // required: true // type: string // format: uuid ID uuid.UUID `json:"id" db:"id" faker:"-"` // Token represents the recovery token. It can not be longer than 64 chars! Token string `json:"-" db:"token"` // RecoveryAddress links this token to a recovery address. // required: true RecoveryAddress *identity.RecoveryAddress `json:"recovery_address" belongs_to:"identity_recovery_addresses" fk_id:"RecoveryAddressID"` // ExpiresAt is the time (UTC) when the token expires. // required: true ExpiresAt time.Time `json:"expires_at" faker:"time_type" db:"expires_at"` // IssuedAt is the time (UTC) when the token was issued. // required: true IssuedAt time.Time `json:"issued_at" faker:"time_type" db:"issued_at"` // 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"` // RecoveryAddressID is a helper struct field for gobuffalo.pop. RecoveryAddressID uuid.UUID `json:"-" faker:"-" db:"identity_recovery_address_id"` // FlowID is a helper struct field for gobuffalo.pop. FlowID uuid.NullUUID `json:"-" faker:"-" db:"selfservice_recovery_flow_id"` }
func NewRecoveryToken ¶
func NewRecoveryToken(address *identity.RecoveryAddress, expiresIn time.Duration) *RecoveryToken
func NewSelfServiceRecoveryToken ¶
func NewSelfServiceRecoveryToken(address *identity.RecoveryAddress, f *recovery.Flow) *RecoveryToken
func (RecoveryToken) TableName ¶
func (RecoveryToken) TableName() string
func (*RecoveryToken) Valid ¶
func (f *RecoveryToken) Valid() error
type RecoveryTokenPersistenceProvider ¶
type RecoveryTokenPersistenceProvider interface {
RecoveryTokenPersister() RecoveryTokenPersister
}
type RecoveryTokenPersister ¶
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
func NewSender ¶
func NewSender(r senderDependencies, c configuration.Provider) *Sender
func (*Sender) SendRecoveryLink ¶
func (s *Sender) SendRecoveryLink(ctx context.Context, f *recovery.Flow, via identity.VerifiableAddressType, to string) error
SendRecoveryLink sends a recovery link to the specified address. If the address does not exist in the store, an email is still being sent to prevent account enumeration attacks. In that case, this function returns the ErrUnknownAddress error.
func (*Sender) SendRecoveryTokenTo ¶
func (s *Sender) SendRecoveryTokenTo(ctx context.Context, address *identity.RecoveryAddress, token *RecoveryToken) error
func (*Sender) SendVerificationLink ¶
func (s *Sender) SendVerificationLink(ctx context.Context, f *verification.Flow, via identity.VerifiableAddressType, to string) error
SendVerificationLink sends a verification link to the specified address. If the address does not exist in the store, an email is still being sent to prevent account enumeration attacks. In that case, this function returns the ErrUnknownAddress error.
func (*Sender) SendVerificationTokenTo ¶
func (s *Sender) SendVerificationTokenTo(ctx context.Context, address *identity.VerifiableAddress, token *VerificationToken) error
type SenderProvider ¶
type SenderProvider interface {
LinkSender() *Sender
}
type Strategy ¶
type Strategy struct {
// contains filtered or unexported fields
}
func NewStrategy ¶
func NewStrategy(d strategyDependencies, c configuration.Provider) *Strategy
func (*Strategy) PopulateRecoveryMethod ¶
func (*Strategy) PopulateVerificationMethod ¶
func (*Strategy) RecoveryStrategyID ¶
func (*Strategy) RegisterAdminRecoveryRoutes ¶
func (s *Strategy) RegisterAdminRecoveryRoutes(admin *x.RouterAdmin)
func (*Strategy) RegisterAdminVerificationRoutes ¶
func (s *Strategy) RegisterAdminVerificationRoutes(admin *x.RouterAdmin)
func (*Strategy) RegisterPublicRecoveryRoutes ¶
func (s *Strategy) RegisterPublicRecoveryRoutes(public *x.RouterPublic)
func (*Strategy) RegisterPublicVerificationRoutes ¶
func (s *Strategy) RegisterPublicVerificationRoutes(public *x.RouterPublic)
func (*Strategy) VerificationStrategyID ¶
type VerificationToken ¶
type VerificationToken struct { // ID represents the tokens's unique ID. // // required: true // type: string // format: uuid ID uuid.UUID `json:"id" db:"id" faker:"-"` // Token represents the verification token. It can not be longer than 64 chars! Token string `json:"-" db:"token"` // VerifiableAddress links this token to a verification address. // required: true VerifiableAddress *identity.VerifiableAddress `json:"verification_address" belongs_to:"identity_verifiable_addresses" fk_id:"VerificationAddVerifiableAddressIDressID"` // ExpiresAt is the time (UTC) when the token expires. // required: true ExpiresAt time.Time `json:"expires_at" faker:"time_type" db:"expires_at"` // IssuedAt is the time (UTC) when the token was issued. // required: true IssuedAt time.Time `json:"issued_at" faker:"time_type" db:"issued_at"` // 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"` // VerifiableAddressID is a helper struct field for gobuffalo.pop. VerifiableAddressID uuid.UUID `json:"-" faker:"-" db:"identity_verifiable_address_id"` // FlowID is a helper struct field for gobuffalo.pop. FlowID uuid.NullUUID `json:"-" faker:"-" db:"selfservice_verification_flow_id"` }
func NewSelfServiceVerificationToken ¶
func NewSelfServiceVerificationToken(address *identity.VerifiableAddress, f *verification.Flow) *VerificationToken
func NewVerificationToken ¶
func NewVerificationToken(address *identity.VerifiableAddress, expiresIn time.Duration) *VerificationToken
func (VerificationToken) TableName ¶
func (VerificationToken) TableName() string
func (*VerificationToken) Valid ¶
func (f *VerificationToken) Valid() error
type VerificationTokenPersistenceProvider ¶
type VerificationTokenPersistenceProvider interface {
VerificationTokenPersister() VerificationTokenPersister
}
Click to show internal directories.
Click to hide internal directories.