recoverytoken

package
v0.4.6-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublicRecoveryTokenPath = "/self-service/browser/flows/recovery/link" // #nosec G101
)

Variables

This section is empty.

Functions

func TestPersister

func TestPersister(p interface {
	Persister
	recovery.RequestPersister
	identity.PrivilegedPool
}) func(t *testing.T)

Types

type PersistenceProvider

type PersistenceProvider interface {
	RecoveryTokenPersister() Persister
}

type Persister

type Persister interface {
	CreateRecoveryToken(ctx context.Context, token *Token) error
	UseRecoveryToken(ctx context.Context, token string) (*Token, error)
	DeleteRecoveryToken(ctx context.Context, token string) error
}

type Strategy

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

func NewStrategy

func NewStrategy(d strategyDependencies, c configuration.Provider) *Strategy

func (*Strategy) PopulateRecoveryMethod

func (s *Strategy) PopulateRecoveryMethod(r *http.Request, req *recovery.Request) error

func (*Strategy) RecoveryStrategyID

func (s *Strategy) RecoveryStrategyID() string

func (*Strategy) RegisterRecoveryRoutes

func (s *Strategy) RegisterRecoveryRoutes(public *x.RouterPublic)

type StrategyMethodConfig

type StrategyMethodConfig struct {
	*form.HTMLForm
}

swagger:model strategyRecoveryLinkMethodConfig

type Token

type Token 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.
	RecoveryAddress *identity.RecoveryAddress `json:"recovery_address" belongs_to:"identity_recovery_addresses" fk_id:"RecoveryAddressID"`

	// RecoveryAddress links this token to a recovery request.
	Request *recovery.Request `json:"request" belongs_to:"identity_recovery_requests" fk_id:"RequestID"`

	// 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"`
	// RequestID is a helper struct field for gobuffalo.pop.
	RequestID uuid.UUID `json:"-" faker:"-" db:"selfservice_recovery_request_id"`
}

func NewToken

func NewToken(token string, ra *identity.RecoveryAddress, req *recovery.Request) *Token

func (Token) TableName

func (Token) TableName() string

Jump to

Keyboard shortcuts

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