Documentation ¶
Index ¶
- Constants
- func WithTransaction(ctx context.Context, tx *pop.Connection) context.Context
- type Persister
- func (p *Persister) Add(ctx context.Context, csrfToken string, errs error) (uuid.UUID, error)
- func (p *Persister) AddMessage(ctx context.Context, m *courier.Message) error
- func (p *Persister) CleanupDatabase(ctx context.Context, wait time.Duration, older time.Duration, batchSize int) error
- func (p *Persister) Clear(ctx context.Context, olderThan time.Duration, force bool) (err error)
- func (p *Persister) Close(ctx context.Context) error
- func (p *Persister) Connection(ctx context.Context) *pop.Connection
- func (p *Persister) CountIdentities(ctx context.Context) (int64, error)
- func (p *Persister) CreateIdentity(ctx context.Context, i *identity.Identity) error
- func (p *Persister) CreateLoginFlow(ctx context.Context, r *login.Flow) error
- func (p *Persister) CreateRecoveryCode(ctx context.Context, dto *code.CreateRecoveryCodeParams) (*code.RecoveryCode, error)
- func (p *Persister) CreateRecoveryFlow(ctx context.Context, r *recovery.Flow) error
- func (p *Persister) CreateRecoveryToken(ctx context.Context, token *link.RecoveryToken) error
- func (p *Persister) CreateRegistrationFlow(ctx context.Context, r *registration.Flow) error
- func (p *Persister) CreateSettingsFlow(ctx context.Context, r *settings.Flow) error
- func (p *Persister) CreateVerificationCode(ctx context.Context, c *code.CreateVerificationCodeParams) (*code.VerificationCode, error)
- func (p *Persister) CreateVerificationFlow(ctx context.Context, r *verification.Flow) error
- func (p *Persister) CreateVerificationToken(ctx context.Context, token *link.VerificationToken) error
- func (p *Persister) DeleteContinuitySession(ctx context.Context, id uuid.UUID) error
- func (p *Persister) DeleteExpiredContinuitySessions(ctx context.Context, expiresAt time.Time, limit int) error
- func (p *Persister) DeleteExpiredLoginFlows(ctx context.Context, expiresAt time.Time, limit int) error
- func (p *Persister) DeleteExpiredRecoveryFlows(ctx context.Context, expiresAt time.Time, limit int) error
- func (p *Persister) DeleteExpiredRegistrationFlows(ctx context.Context, expiresAt time.Time, limit int) error
- func (p *Persister) DeleteExpiredSessions(ctx context.Context, expiresAt time.Time, limit int) (err error)
- func (p *Persister) DeleteExpiredSettingsFlows(ctx context.Context, expiresAt time.Time, limit int) error
- func (p *Persister) DeleteExpiredVerificationFlows(ctx context.Context, expiresAt time.Time, limit int) error
- func (p *Persister) DeleteIdentity(ctx context.Context, id uuid.UUID) error
- func (p *Persister) DeleteRecoveryCodesOfFlow(ctx context.Context, fID uuid.UUID) error
- func (p *Persister) DeleteRecoveryToken(ctx context.Context, token string) error
- func (p *Persister) DeleteSession(ctx context.Context, sid uuid.UUID) (err error)
- func (p *Persister) DeleteSessionByToken(ctx context.Context, token string) (err error)
- func (p *Persister) DeleteSessionsByIdentity(ctx context.Context, identityID uuid.UUID) (err error)
- func (p *Persister) DeleteVerificationCodesOfFlow(ctx context.Context, fID uuid.UUID) error
- func (p *Persister) DeleteVerificationToken(ctx context.Context, token string) error
- func (p *Persister) DetermineNetwork(ctx context.Context) (*networkx.Network, error)
- func (p *Persister) FetchMessage(ctx context.Context, msgID uuid.UUID) (*courier.Message, error)
- func (p *Persister) FindByCredentialsIdentifier(ctx context.Context, ct identity.CredentialsType, match string) (*identity.Identity, *identity.Credentials, error)
- func (p *Persister) FindRecoveryAddressByValue(ctx context.Context, via identity.RecoveryAddressType, value string) (*identity.RecoveryAddress, error)
- func (p *Persister) FindVerifiableAddressByValue(ctx context.Context, via identity.VerifiableAddressType, value string) (*identity.VerifiableAddress, error)
- func (p *Persister) ForceLoginFlow(ctx context.Context, id uuid.UUID) error
- func (p *Persister) GetConnection(ctx context.Context) *pop.Connection
- func (p *Persister) GetContinuitySession(ctx context.Context, id uuid.UUID) (*continuity.Container, error)
- func (p *Persister) GetIdentity(ctx context.Context, id uuid.UUID, expand identity.Expandables) (res *identity.Identity, err error)
- func (p *Persister) GetIdentityConfidential(ctx context.Context, id uuid.UUID) (res *identity.Identity, err error)
- func (p *Persister) GetLoginFlow(ctx context.Context, id uuid.UUID) (*login.Flow, error)
- func (p *Persister) GetRecoveryFlow(ctx context.Context, id uuid.UUID) (*recovery.Flow, error)
- func (p *Persister) GetRegistrationFlow(ctx context.Context, id uuid.UUID) (*registration.Flow, error)
- func (p *Persister) GetSession(ctx context.Context, sid uuid.UUID, expandables session.Expandables) (_ *session.Session, err error)
- func (p *Persister) GetSessionByToken(ctx context.Context, token string, expand session.Expandables, ...) (res *session.Session, err error)
- func (p *Persister) GetSettingsFlow(ctx context.Context, id uuid.UUID) (*settings.Flow, error)
- func (p *Persister) GetVerificationFlow(ctx context.Context, id uuid.UUID) (*verification.Flow, error)
- func (p *Persister) HydrateIdentityAssociations(ctx context.Context, i *identity.Identity, expand identity.Expandables) (err error)
- func (p *Persister) IncrementMessageSendCount(ctx context.Context, id uuid.UUID) error
- func (p *Persister) LatestQueuedMessage(ctx context.Context) (*courier.Message, error)
- func (p *Persister) ListIdentities(ctx context.Context, expand identity.Expandables, page, perPage int) (res []identity.Identity, err error)
- func (p *Persister) ListMessages(ctx context.Context, filter courier.ListCourierMessagesParameters, ...) ([]courier.Message, int64, *keysetpagination.Paginator, error)
- func (p *Persister) ListRecoveryAddresses(ctx context.Context, page, itemsPerPage int) (a []identity.RecoveryAddress, err error)
- func (p *Persister) ListSessions(ctx context.Context, active *bool, paginatorOpts []keysetpagination.Option, ...) (_ []session.Session, _ int64, _ *keysetpagination.Paginator, err error)
- func (p *Persister) ListSessionsByIdentity(ctx context.Context, iID uuid.UUID, active *bool, page, perPage int, ...) (_ []*session.Session, _ int64, err error)
- func (p *Persister) ListVerifiableAddresses(ctx context.Context, page, itemsPerPage int) (a []identity.VerifiableAddress, err error)
- func (p *Persister) MigrateDown(ctx context.Context, steps int) error
- func (p *Persister) MigrateUp(ctx context.Context) error
- func (p *Persister) MigrationStatus(ctx context.Context) (popx.MigrationStatuses, error)
- func (p *Persister) Migrator() *popx.Migrator
- func (p *Persister) NetworkID(ctx context.Context) uuid.UUID
- func (p *Persister) NextMessages(ctx context.Context, limit uint8) (messages []courier.Message, err error)
- func (p *Persister) Ping() error
- func (p *Persister) Read(ctx context.Context, id uuid.UUID) (*errorx.ErrorContainer, error)
- func (p *Persister) RecordDispatch(ctx context.Context, msgID uuid.UUID, ...) error
- func (p *Persister) RevokeSession(ctx context.Context, iID, sID uuid.UUID) (err error)
- func (p *Persister) RevokeSessionById(ctx context.Context, sID uuid.UUID) (err error)
- func (p *Persister) RevokeSessionByToken(ctx context.Context, token string) (err error)
- func (p *Persister) RevokeSessionsIdentityExcept(ctx context.Context, iID, sID uuid.UUID) (res int, err error)
- func (p *Persister) SaveContinuitySession(ctx context.Context, c *continuity.Container) error
- func (p *Persister) SetMessageStatus(ctx context.Context, id uuid.UUID, ms courier.MessageStatus) error
- func (p *Persister) Transaction(ctx context.Context, ...) error
- func (p *Persister) UpdateIdentity(ctx context.Context, i *identity.Identity) error
- func (p *Persister) UpdateLoginFlow(ctx context.Context, r *login.Flow) error
- func (p *Persister) UpdateRecoveryFlow(ctx context.Context, r *recovery.Flow) error
- func (p *Persister) UpdateRegistrationFlow(ctx context.Context, r *registration.Flow) error
- func (p *Persister) UpdateSettingsFlow(ctx context.Context, r *settings.Flow) error
- func (p *Persister) UpdateVerifiableAddress(ctx context.Context, address *identity.VerifiableAddress) error
- func (p *Persister) UpdateVerificationFlow(ctx context.Context, r *verification.Flow) error
- func (p *Persister) UpsertSession(ctx context.Context, s *session.Session) (err error)
- func (p *Persister) UseRecoveryCode(ctx context.Context, fID uuid.UUID, codeVal string) (*code.RecoveryCode, error)
- func (p *Persister) UseRecoveryToken(ctx context.Context, fID uuid.UUID, token string) (*link.RecoveryToken, error)
- func (p *Persister) UseVerificationCode(ctx context.Context, fID uuid.UUID, codeVal string) (*code.VerificationCode, error)
- func (p *Persister) UseVerificationToken(ctx context.Context, fID uuid.UUID, token string) (*link.VerificationToken, error)
- func (p *Persister) VerifyAddress(ctx context.Context, code string) error
- func (p Persister) WithNetworkID(sid uuid.UUID) persistence.Persister
Constants ¶
const SessionDeviceLocationMaxLength = 512
const SessionDeviceUserAgentMaxLength = 512
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Persister ¶
type Persister struct {
// contains filtered or unexported fields
}
func NewPersister ¶
func (*Persister) AddMessage ¶
func (*Persister) CleanupDatabase ¶ added in v0.11.0
func (*Persister) Connection ¶
func (*Persister) CountIdentities ¶
func (*Persister) CreateIdentity ¶
func (*Persister) CreateLoginFlow ¶
func (*Persister) CreateRecoveryCode ¶ added in v0.11.0
func (p *Persister) CreateRecoveryCode(ctx context.Context, dto *code.CreateRecoveryCodeParams) (*code.RecoveryCode, error)
func (*Persister) CreateRecoveryFlow ¶
func (*Persister) CreateRecoveryToken ¶
func (*Persister) CreateRegistrationFlow ¶
func (*Persister) CreateSettingsFlow ¶
func (*Persister) CreateVerificationCode ¶ added in v0.11.0
func (p *Persister) CreateVerificationCode(ctx context.Context, c *code.CreateVerificationCodeParams) (*code.VerificationCode, error)
func (*Persister) CreateVerificationFlow ¶
func (*Persister) CreateVerificationToken ¶
func (*Persister) DeleteContinuitySession ¶
func (*Persister) DeleteExpiredContinuitySessions ¶ added in v0.11.0
func (*Persister) DeleteExpiredLoginFlows ¶ added in v0.11.0
func (*Persister) DeleteExpiredRecoveryFlows ¶ added in v0.11.0
func (*Persister) DeleteExpiredRegistrationFlows ¶ added in v0.11.0
func (*Persister) DeleteExpiredSessions ¶ added in v0.11.0
func (*Persister) DeleteExpiredSettingsFlows ¶ added in v0.11.0
func (*Persister) DeleteExpiredVerificationFlows ¶ added in v0.11.0
func (*Persister) DeleteIdentity ¶
func (*Persister) DeleteRecoveryCodesOfFlow ¶ added in v0.11.0
func (*Persister) DeleteRecoveryToken ¶
func (*Persister) DeleteSession ¶
func (*Persister) DeleteSessionByToken ¶
func (*Persister) DeleteSessionsByIdentity ¶
func (*Persister) DeleteVerificationCodesOfFlow ¶ added in v0.11.0
func (*Persister) DeleteVerificationToken ¶
func (*Persister) DetermineNetwork ¶
func (*Persister) FetchMessage ¶ added in v0.11.1
func (*Persister) FindByCredentialsIdentifier ¶
func (*Persister) FindRecoveryAddressByValue ¶
func (p *Persister) FindRecoveryAddressByValue(ctx context.Context, via identity.RecoveryAddressType, value string) (*identity.RecoveryAddress, error)
func (*Persister) FindVerifiableAddressByValue ¶
func (p *Persister) FindVerifiableAddressByValue(ctx context.Context, via identity.VerifiableAddressType, value string) (*identity.VerifiableAddress, error)
func (*Persister) ForceLoginFlow ¶
func (*Persister) GetConnection ¶
func (*Persister) GetContinuitySession ¶
func (*Persister) GetIdentity ¶
func (*Persister) GetIdentityConfidential ¶
func (*Persister) GetLoginFlow ¶
func (*Persister) GetRecoveryFlow ¶
func (*Persister) GetRegistrationFlow ¶
func (*Persister) GetSession ¶
func (*Persister) GetSessionByToken ¶
func (*Persister) GetSettingsFlow ¶
func (*Persister) GetVerificationFlow ¶
func (*Persister) HydrateIdentityAssociations ¶ added in v0.11.1
func (*Persister) IncrementMessageSendCount ¶ added in v0.11.0
func (*Persister) LatestQueuedMessage ¶
func (*Persister) ListIdentities ¶
func (*Persister) ListMessages ¶ added in v0.11.0
func (p *Persister) ListMessages(ctx context.Context, filter courier.ListCourierMessagesParameters, opts []keysetpagination.Option) ([]courier.Message, int64, *keysetpagination.Paginator, error)
func (*Persister) ListRecoveryAddresses ¶
func (*Persister) ListSessions ¶ added in v0.11.0
func (p *Persister) ListSessions(ctx context.Context, active *bool, paginatorOpts []keysetpagination.Option, expandables session.Expandables) (_ []session.Session, _ int64, _ *keysetpagination.Paginator, err error)
func (*Persister) ListSessionsByIdentity ¶
func (p *Persister) ListSessionsByIdentity(ctx context.Context, iID uuid.UUID, active *bool, page, perPage int, except uuid.UUID, expandables session.Expandables) (_ []*session.Session, _ int64, err error)
ListSessionsByIdentity retrieves sessions for an identity from the store.
func (*Persister) ListVerifiableAddresses ¶
func (*Persister) MigrateDown ¶
func (*Persister) MigrationStatus ¶
func (*Persister) NextMessages ¶
func (*Persister) RecordDispatch ¶ added in v0.11.1
func (*Persister) RevokeSession ¶
RevokeSession revokes a given session. If the session does not exist or was not modified, it effectively has been revoked already, and therefore that case does not return an error.
func (*Persister) RevokeSessionById ¶ added in v0.11.0
RevokeSessionById revokes a given session
func (*Persister) RevokeSessionByToken ¶
func (*Persister) RevokeSessionsIdentityExcept ¶
func (p *Persister) RevokeSessionsIdentityExcept(ctx context.Context, iID, sID uuid.UUID) (res int, err error)
RevokeSessionsIdentityExcept marks all except the given session of an identity inactive.
func (*Persister) SaveContinuitySession ¶
func (*Persister) SetMessageStatus ¶
func (*Persister) Transaction ¶
func (*Persister) UpdateIdentity ¶
func (*Persister) UpdateLoginFlow ¶
func (*Persister) UpdateRecoveryFlow ¶
func (*Persister) UpdateRegistrationFlow ¶
func (*Persister) UpdateSettingsFlow ¶
func (*Persister) UpdateVerifiableAddress ¶
func (*Persister) UpdateVerificationFlow ¶
func (*Persister) UpsertSession ¶
UpsertSession creates a session if not found else updates. This operation also inserts Session device records when a session is being created. The update operation skips updating Session device records since only one record would need to be updated in this case.
func (*Persister) UseRecoveryCode ¶ added in v0.11.0
func (p *Persister) UseRecoveryCode(ctx context.Context, fID uuid.UUID, codeVal string) (*code.RecoveryCode, error)
UseRecoveryCode attempts to "use" the supplied code in the flow
If the supplied code matched a code from the flow, no error is returned If an invalid code was submitted with this flow more than 5 times, an error is returned TODO: Extract the business logic to a new service/manager (https://github.com/ory/kratos/issues/2785)
func (*Persister) UseRecoveryToken ¶
func (*Persister) UseVerificationCode ¶ added in v0.11.0
func (*Persister) UseVerificationToken ¶
func (*Persister) VerifyAddress ¶
func (Persister) WithNetworkID ¶
func (p Persister) WithNetworkID(sid uuid.UUID) persistence.Persister