Documentation
¶
Overview ¶
Package memstore is a reference in-memory implementation of every interface in the store package. It is safe for concurrent use. It exists so authit is usable and testable with zero external dependencies; host applications that need durability implement the same interfaces against their own database.
Index ¶
- type AccountStore
- func (s *AccountStore) CreateAccount(_ context.Context, a *store.Account) error
- func (s *AccountStore) DeleteAccount(_ context.Context, id string) error
- func (s *AccountStore) GetAccount(_ context.Context, id string) (*store.Account, error)
- func (s *AccountStore) GetAccountByProvider(_ context.Context, provider, providerAccountID string) (*store.Account, error)
- func (s *AccountStore) ListAccountsByUser(_ context.Context, userID string) ([]*store.Account, error)
- func (s *AccountStore) UpdateAccount(_ context.Context, a *store.Account) error
- type DeviceAuthorizationStore
- func (s *DeviceAuthorizationStore) CreateDeviceAuthorization(_ context.Context, d *store.DeviceAuthorization) error
- func (s *DeviceAuthorizationStore) DeleteDeviceAuthorization(_ context.Context, id string) error
- func (s *DeviceAuthorizationStore) GetDeviceAuthorizationByDeviceCodeHash(_ context.Context, hash string) (*store.DeviceAuthorization, error)
- func (s *DeviceAuthorizationStore) GetDeviceAuthorizationByUserCode(_ context.Context, userCode string) (*store.DeviceAuthorization, error)
- func (s *DeviceAuthorizationStore) UpdateDeviceAuthorization(_ context.Context, d *store.DeviceAuthorization) error
- type EmailLoginStore
- func (s *EmailLoginStore) CreateEmailLoginToken(_ context.Context, t *store.EmailLoginToken) error
- func (s *EmailLoginStore) DeleteEmailLoginTokens(_ context.Context, email string, kind store.EmailLoginKind) error
- func (s *EmailLoginStore) GetEmailLoginTokenByEmail(_ context.Context, email string, kind store.EmailLoginKind) (*store.EmailLoginToken, error)
- func (s *EmailLoginStore) GetEmailLoginTokenByHash(_ context.Context, hash string) (*store.EmailLoginToken, error)
- func (s *EmailLoginStore) IncrementEmailLoginTokenAttempts(_ context.Context, id string) (int, error)
- func (s *EmailLoginStore) MarkEmailLoginTokenUsed(_ context.Context, id string, usedAt time.Time) error
- type EmailVerificationStore
- func (s *EmailVerificationStore) CreateEmailVerificationToken(_ context.Context, t *store.EmailVerificationToken) error
- func (s *EmailVerificationStore) DeleteUserEmailVerificationTokens(_ context.Context, userID string) error
- func (s *EmailVerificationStore) GetEmailVerificationTokenByHash(_ context.Context, hash string) (*store.EmailVerificationToken, error)
- func (s *EmailVerificationStore) MarkEmailVerificationTokenUsed(_ context.Context, id string) error
- type InvitationStore
- func (s *InvitationStore) CreateInvitation(_ context.Context, i *store.Invitation) error
- func (s *InvitationStore) GetInvitation(_ context.Context, id string) (*store.Invitation, error)
- func (s *InvitationStore) GetInvitationByTokenHash(_ context.Context, hash string) (*store.Invitation, error)
- func (s *InvitationStore) ListInvitationsByTeam(_ context.Context, teamID string) ([]*store.Invitation, error)
- func (s *InvitationStore) UpdateInvitation(_ context.Context, i *store.Invitation) error
- type LockoutStore
- func (s *LockoutStore) ClearFailedLoginAttempts(_ context.Context, email string) error
- func (s *LockoutStore) CountRecentFailedLoginAttempts(_ context.Context, email string, since time.Time) (int, error)
- func (s *LockoutStore) IsAccountLocked(_ context.Context, userID string) (bool, error)
- func (s *LockoutStore) LockAccount(_ context.Context, userID string) error
- func (s *LockoutStore) RecordFailedLoginAttempt(_ context.Context, a *store.FailedLoginAttempt) error
- func (s *LockoutStore) UnlockAccount(_ context.Context, userID string) error
- type MemberStore
- func (s *MemberStore) CreateMember(_ context.Context, m *store.Member) error
- func (s *MemberStore) DeleteMember(_ context.Context, id string) error
- func (s *MemberStore) GetMember(_ context.Context, id string) (*store.Member, error)
- func (s *MemberStore) GetMemberByUserAndTeam(_ context.Context, userID, teamID string) (*store.Member, error)
- func (s *MemberStore) ListMembersByTeam(_ context.Context, teamID string) ([]*store.Member, error)
- func (s *MemberStore) ListMembershipsByUser(_ context.Context, userID string) ([]*store.Member, error)
- func (s *MemberStore) UpdateMember(_ context.Context, m *store.Member) error
- type PasswordResetStore
- func (s *PasswordResetStore) CreatePasswordResetToken(_ context.Context, t *store.PasswordResetToken) error
- func (s *PasswordResetStore) DeleteUserPasswordResetTokens(_ context.Context, userID string) error
- func (s *PasswordResetStore) GetPasswordResetTokenByHash(_ context.Context, hash string) (*store.PasswordResetToken, error)
- func (s *PasswordResetStore) MarkPasswordResetTokenUsed(_ context.Context, id string) error
- type PendingTwoFactorStore
- func (s *PendingTwoFactorStore) CreatePendingTwoFactorSession(_ context.Context, sess *store.PendingTwoFactorSession) error
- func (s *PendingTwoFactorStore) DeletePendingTwoFactorSession(_ context.Context, id string) error
- func (s *PendingTwoFactorStore) GetPendingTwoFactorSessionByHash(_ context.Context, hash string) (*store.PendingTwoFactorSession, error)
- type PersonalAccessTokenStore
- func (s *PersonalAccessTokenStore) CreatePersonalAccessToken(_ context.Context, t *store.PersonalAccessToken) error
- func (s *PersonalAccessTokenStore) GetPersonalAccessToken(_ context.Context, id string) (*store.PersonalAccessToken, error)
- func (s *PersonalAccessTokenStore) GetPersonalAccessTokenByHash(_ context.Context, hash string) (*store.PersonalAccessToken, error)
- func (s *PersonalAccessTokenStore) ListPersonalAccessTokensByUser(_ context.Context, userID string) ([]*store.PersonalAccessToken, error)
- func (s *PersonalAccessTokenStore) UpdatePersonalAccessToken(_ context.Context, t *store.PersonalAccessToken) error
- type RefreshTokenStore
- func (s *RefreshTokenStore) ConsumeRefreshToken(_ context.Context, id string) (bool, error)
- func (s *RefreshTokenStore) CreateRefreshToken(_ context.Context, t *store.RefreshToken) error
- func (s *RefreshTokenStore) GetRefreshTokenByHash(_ context.Context, hash string) (*store.RefreshToken, error)
- func (s *RefreshTokenStore) ListActiveRefreshTokens(_ context.Context, userID string) ([]*store.RefreshToken, error)
- func (s *RefreshTokenStore) RevokeAllUserRefreshTokens(_ context.Context, userID string) error
- func (s *RefreshTokenStore) RevokeRefreshToken(_ context.Context, id string) error
- func (s *RefreshTokenStore) TouchRefreshToken(_ context.Context, id string, expiresAt time.Time) error
- type SuperuserRefreshTokenStore
- func (s *SuperuserRefreshTokenStore) ConsumeSuperuserRefreshToken(_ context.Context, id string) (bool, error)
- func (s *SuperuserRefreshTokenStore) CreateSuperuserRefreshToken(_ context.Context, t *store.SuperuserRefreshToken) error
- func (s *SuperuserRefreshTokenStore) GetSuperuserRefreshTokenByHash(_ context.Context, hash string) (*store.SuperuserRefreshToken, error)
- func (s *SuperuserRefreshTokenStore) ListActiveSuperuserRefreshTokens(_ context.Context, superuserID string) ([]*store.SuperuserRefreshToken, error)
- func (s *SuperuserRefreshTokenStore) RevokeAllSuperuserRefreshTokens(_ context.Context, superuserID string) error
- func (s *SuperuserRefreshTokenStore) RevokeSuperuserRefreshToken(_ context.Context, id string) error
- type SuperuserStore
- func (s *SuperuserStore) CountSuperusers(_ context.Context) (int, error)
- func (s *SuperuserStore) CreateSuperuser(_ context.Context, su *store.Superuser) error
- func (s *SuperuserStore) GetSuperuserByEmail(_ context.Context, email string) (*store.Superuser, error)
- func (s *SuperuserStore) GetSuperuserByID(_ context.Context, id string) (*store.Superuser, error)
- func (s *SuperuserStore) ListSuperusers(_ context.Context) ([]*store.Superuser, error)
- func (s *SuperuserStore) UpdateSuperuser(_ context.Context, su *store.Superuser) error
- type SuperuserTwoFactorStore
- func (s *SuperuserTwoFactorStore) CreateSuperuserPendingTwoFactorSession(ctx context.Context, p *store.PendingTwoFactorSession) error
- func (s *SuperuserTwoFactorStore) CreateSuperuserTOTPSettings(ctx context.Context, t *store.TOTPSettings) error
- func (s *SuperuserTwoFactorStore) DeleteSuperuserPendingTwoFactorSession(ctx context.Context, id string) error
- func (s *SuperuserTwoFactorStore) DeleteSuperuserTOTPSettings(ctx context.Context, superuserID string) error
- func (s *SuperuserTwoFactorStore) GetSuperuserPendingTwoFactorSessionByHash(ctx context.Context, hash string) (*store.PendingTwoFactorSession, error)
- func (s *SuperuserTwoFactorStore) GetSuperuserTOTPSettings(ctx context.Context, superuserID string) (*store.TOTPSettings, error)
- func (s *SuperuserTwoFactorStore) UpdateSuperuserTOTPSettings(ctx context.Context, t *store.TOTPSettings) error
- type TOTPStore
- func (s *TOTPStore) CreateTOTPSettings(_ context.Context, t *store.TOTPSettings) error
- func (s *TOTPStore) DeleteTOTPSettings(_ context.Context, userID string) error
- func (s *TOTPStore) GetTOTPSettingsByUserID(_ context.Context, userID string) (*store.TOTPSettings, error)
- func (s *TOTPStore) UpdateTOTPSettings(_ context.Context, t *store.TOTPSettings) error
- type TeamStore
- func (s *TeamStore) CreateTeam(_ context.Context, t *store.Team) error
- func (s *TeamStore) DeleteTeam(_ context.Context, id string) error
- func (s *TeamStore) GetTeam(_ context.Context, id string) (*store.Team, error)
- func (s *TeamStore) GetTeamBySlug(_ context.Context, slug string) (*store.Team, error)
- func (s *TeamStore) UpdateTeam(_ context.Context, t *store.Team) error
- type UserStore
- func (s *UserStore) CreateUser(_ context.Context, u *store.User) error
- func (s *UserStore) GetUserByEmail(_ context.Context, email string) (*store.User, error)
- func (s *UserStore) GetUserByID(_ context.Context, id string) (*store.User, error)
- func (s *UserStore) UpdateUser(_ context.Context, u *store.User) error
- type WebAuthnChallengeStore
- type WebAuthnCredentialStore
- func (s *WebAuthnCredentialStore) CreateWebAuthnCredential(_ context.Context, c *store.WebAuthnCredential) error
- func (s *WebAuthnCredentialStore) DeleteWebAuthnCredential(_ context.Context, id string) error
- func (s *WebAuthnCredentialStore) GetWebAuthnCredential(_ context.Context, id string) (*store.WebAuthnCredential, error)
- func (s *WebAuthnCredentialStore) GetWebAuthnCredentialByCredentialID(_ context.Context, credentialID []byte) (*store.WebAuthnCredential, error)
- func (s *WebAuthnCredentialStore) ListWebAuthnCredentialsByUser(_ context.Context, userID string) ([]*store.WebAuthnCredential, error)
- func (s *WebAuthnCredentialStore) UpdateWebAuthnCredential(_ context.Context, c *store.WebAuthnCredential) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountStore ¶ added in v0.4.0
type AccountStore struct {
// contains filtered or unexported fields
}
AccountStore is an in-memory store.AccountStore.
func NewAccountStore ¶ added in v0.4.0
func NewAccountStore() *AccountStore
func (*AccountStore) CreateAccount ¶ added in v0.4.0
func (*AccountStore) DeleteAccount ¶ added in v0.4.0
func (s *AccountStore) DeleteAccount(_ context.Context, id string) error
func (*AccountStore) GetAccount ¶ added in v0.4.0
func (*AccountStore) GetAccountByProvider ¶ added in v0.4.0
func (*AccountStore) ListAccountsByUser ¶ added in v0.4.0
func (*AccountStore) UpdateAccount ¶ added in v0.4.0
type DeviceAuthorizationStore ¶
type DeviceAuthorizationStore struct {
// contains filtered or unexported fields
}
DeviceAuthorizationStore is an in-memory store.DeviceAuthorizationStore.
func NewDeviceAuthorizationStore ¶
func NewDeviceAuthorizationStore() *DeviceAuthorizationStore
func (*DeviceAuthorizationStore) CreateDeviceAuthorization ¶
func (s *DeviceAuthorizationStore) CreateDeviceAuthorization(_ context.Context, d *store.DeviceAuthorization) error
func (*DeviceAuthorizationStore) DeleteDeviceAuthorization ¶
func (s *DeviceAuthorizationStore) DeleteDeviceAuthorization(_ context.Context, id string) error
func (*DeviceAuthorizationStore) GetDeviceAuthorizationByDeviceCodeHash ¶
func (s *DeviceAuthorizationStore) GetDeviceAuthorizationByDeviceCodeHash(_ context.Context, hash string) (*store.DeviceAuthorization, error)
func (*DeviceAuthorizationStore) GetDeviceAuthorizationByUserCode ¶
func (s *DeviceAuthorizationStore) GetDeviceAuthorizationByUserCode(_ context.Context, userCode string) (*store.DeviceAuthorization, error)
func (*DeviceAuthorizationStore) UpdateDeviceAuthorization ¶
func (s *DeviceAuthorizationStore) UpdateDeviceAuthorization(_ context.Context, d *store.DeviceAuthorization) error
type EmailLoginStore ¶ added in v0.4.0
type EmailLoginStore struct {
// contains filtered or unexported fields
}
EmailLoginStore is an in-memory store.EmailLoginStore.
func NewEmailLoginStore ¶ added in v0.4.0
func NewEmailLoginStore() *EmailLoginStore
func (*EmailLoginStore) CreateEmailLoginToken ¶ added in v0.4.0
func (s *EmailLoginStore) CreateEmailLoginToken(_ context.Context, t *store.EmailLoginToken) error
func (*EmailLoginStore) DeleteEmailLoginTokens ¶ added in v0.4.0
func (s *EmailLoginStore) DeleteEmailLoginTokens(_ context.Context, email string, kind store.EmailLoginKind) error
func (*EmailLoginStore) GetEmailLoginTokenByEmail ¶ added in v0.4.0
func (s *EmailLoginStore) GetEmailLoginTokenByEmail(_ context.Context, email string, kind store.EmailLoginKind) (*store.EmailLoginToken, error)
func (*EmailLoginStore) GetEmailLoginTokenByHash ¶ added in v0.4.0
func (s *EmailLoginStore) GetEmailLoginTokenByHash(_ context.Context, hash string) (*store.EmailLoginToken, error)
func (*EmailLoginStore) IncrementEmailLoginTokenAttempts ¶ added in v0.4.0
func (*EmailLoginStore) MarkEmailLoginTokenUsed ¶ added in v0.4.0
func (s *EmailLoginStore) MarkEmailLoginTokenUsed(_ context.Context, id string, usedAt time.Time) error
MarkEmailLoginTokenUsed marks used under one lock, and refuses a token already marked. Both halves happen without releasing the lock, which is what makes it a compare-and-set rather than a read followed by a write.
type EmailVerificationStore ¶
type EmailVerificationStore struct {
// contains filtered or unexported fields
}
EmailVerificationStore is an in-memory store.EmailVerificationStore.
func NewEmailVerificationStore ¶
func NewEmailVerificationStore() *EmailVerificationStore
func (*EmailVerificationStore) CreateEmailVerificationToken ¶
func (s *EmailVerificationStore) CreateEmailVerificationToken(_ context.Context, t *store.EmailVerificationToken) error
func (*EmailVerificationStore) DeleteUserEmailVerificationTokens ¶
func (s *EmailVerificationStore) DeleteUserEmailVerificationTokens(_ context.Context, userID string) error
func (*EmailVerificationStore) GetEmailVerificationTokenByHash ¶
func (s *EmailVerificationStore) GetEmailVerificationTokenByHash(_ context.Context, hash string) (*store.EmailVerificationToken, error)
func (*EmailVerificationStore) MarkEmailVerificationTokenUsed ¶
func (s *EmailVerificationStore) MarkEmailVerificationTokenUsed(_ context.Context, id string) error
type InvitationStore ¶
type InvitationStore struct {
// contains filtered or unexported fields
}
InvitationStore is an in-memory store.InvitationStore.
func NewInvitationStore ¶
func NewInvitationStore() *InvitationStore
func (*InvitationStore) CreateInvitation ¶
func (s *InvitationStore) CreateInvitation(_ context.Context, i *store.Invitation) error
func (*InvitationStore) GetInvitation ¶
func (s *InvitationStore) GetInvitation(_ context.Context, id string) (*store.Invitation, error)
func (*InvitationStore) GetInvitationByTokenHash ¶
func (s *InvitationStore) GetInvitationByTokenHash(_ context.Context, hash string) (*store.Invitation, error)
func (*InvitationStore) ListInvitationsByTeam ¶
func (s *InvitationStore) ListInvitationsByTeam(_ context.Context, teamID string) ([]*store.Invitation, error)
func (*InvitationStore) UpdateInvitation ¶
func (s *InvitationStore) UpdateInvitation(_ context.Context, i *store.Invitation) error
type LockoutStore ¶
type LockoutStore struct {
// contains filtered or unexported fields
}
LockoutStore is an in-memory store.LockoutStore, shared by the user and superuser planes (they key lockouts by their own IDs/emails, which never collide across planes in practice since a host application uses separate instances per plane).
func NewLockoutStore ¶
func NewLockoutStore() *LockoutStore
func (*LockoutStore) ClearFailedLoginAttempts ¶
func (s *LockoutStore) ClearFailedLoginAttempts(_ context.Context, email string) error
func (*LockoutStore) CountRecentFailedLoginAttempts ¶
func (*LockoutStore) IsAccountLocked ¶
func (*LockoutStore) LockAccount ¶
func (s *LockoutStore) LockAccount(_ context.Context, userID string) error
func (*LockoutStore) RecordFailedLoginAttempt ¶
func (s *LockoutStore) RecordFailedLoginAttempt(_ context.Context, a *store.FailedLoginAttempt) error
func (*LockoutStore) UnlockAccount ¶
func (s *LockoutStore) UnlockAccount(_ context.Context, userID string) error
type MemberStore ¶
type MemberStore struct {
// contains filtered or unexported fields
}
MemberStore is an in-memory store.MemberStore.
func NewMemberStore ¶
func NewMemberStore() *MemberStore
func (*MemberStore) CreateMember ¶
func (*MemberStore) DeleteMember ¶
func (s *MemberStore) DeleteMember(_ context.Context, id string) error
func (*MemberStore) GetMemberByUserAndTeam ¶
func (*MemberStore) ListMembersByTeam ¶
func (*MemberStore) ListMembershipsByUser ¶
func (*MemberStore) UpdateMember ¶
type PasswordResetStore ¶
type PasswordResetStore struct {
// contains filtered or unexported fields
}
PasswordResetStore is an in-memory store.PasswordResetStore.
func NewPasswordResetStore ¶
func NewPasswordResetStore() *PasswordResetStore
func (*PasswordResetStore) CreatePasswordResetToken ¶
func (s *PasswordResetStore) CreatePasswordResetToken(_ context.Context, t *store.PasswordResetToken) error
func (*PasswordResetStore) DeleteUserPasswordResetTokens ¶
func (s *PasswordResetStore) DeleteUserPasswordResetTokens(_ context.Context, userID string) error
func (*PasswordResetStore) GetPasswordResetTokenByHash ¶
func (s *PasswordResetStore) GetPasswordResetTokenByHash(_ context.Context, hash string) (*store.PasswordResetToken, error)
func (*PasswordResetStore) MarkPasswordResetTokenUsed ¶
func (s *PasswordResetStore) MarkPasswordResetTokenUsed(_ context.Context, id string) error
type PendingTwoFactorStore ¶
type PendingTwoFactorStore struct {
// contains filtered or unexported fields
}
PendingTwoFactorStore is an in-memory store.PendingTwoFactorStore.
func NewPendingTwoFactorStore ¶
func NewPendingTwoFactorStore() *PendingTwoFactorStore
func (*PendingTwoFactorStore) CreatePendingTwoFactorSession ¶
func (s *PendingTwoFactorStore) CreatePendingTwoFactorSession(_ context.Context, sess *store.PendingTwoFactorSession) error
func (*PendingTwoFactorStore) DeletePendingTwoFactorSession ¶
func (s *PendingTwoFactorStore) DeletePendingTwoFactorSession(_ context.Context, id string) error
func (*PendingTwoFactorStore) GetPendingTwoFactorSessionByHash ¶
func (s *PendingTwoFactorStore) GetPendingTwoFactorSessionByHash(_ context.Context, hash string) (*store.PendingTwoFactorSession, error)
type PersonalAccessTokenStore ¶
type PersonalAccessTokenStore struct {
// contains filtered or unexported fields
}
PersonalAccessTokenStore is an in-memory store.PersonalAccessTokenStore.
func NewPersonalAccessTokenStore ¶
func NewPersonalAccessTokenStore() *PersonalAccessTokenStore
func (*PersonalAccessTokenStore) CreatePersonalAccessToken ¶
func (s *PersonalAccessTokenStore) CreatePersonalAccessToken(_ context.Context, t *store.PersonalAccessToken) error
func (*PersonalAccessTokenStore) GetPersonalAccessToken ¶
func (s *PersonalAccessTokenStore) GetPersonalAccessToken(_ context.Context, id string) (*store.PersonalAccessToken, error)
func (*PersonalAccessTokenStore) GetPersonalAccessTokenByHash ¶
func (s *PersonalAccessTokenStore) GetPersonalAccessTokenByHash(_ context.Context, hash string) (*store.PersonalAccessToken, error)
func (*PersonalAccessTokenStore) ListPersonalAccessTokensByUser ¶
func (s *PersonalAccessTokenStore) ListPersonalAccessTokensByUser(_ context.Context, userID string) ([]*store.PersonalAccessToken, error)
func (*PersonalAccessTokenStore) UpdatePersonalAccessToken ¶
func (s *PersonalAccessTokenStore) UpdatePersonalAccessToken(_ context.Context, t *store.PersonalAccessToken) error
type RefreshTokenStore ¶
type RefreshTokenStore struct {
// contains filtered or unexported fields
}
RefreshTokenStore is an in-memory store.RefreshTokenStore.
func NewRefreshTokenStore ¶
func NewRefreshTokenStore() *RefreshTokenStore
func (*RefreshTokenStore) ConsumeRefreshToken ¶ added in v0.6.0
func (*RefreshTokenStore) CreateRefreshToken ¶
func (s *RefreshTokenStore) CreateRefreshToken(_ context.Context, t *store.RefreshToken) error
func (*RefreshTokenStore) GetRefreshTokenByHash ¶
func (s *RefreshTokenStore) GetRefreshTokenByHash(_ context.Context, hash string) (*store.RefreshToken, error)
func (*RefreshTokenStore) ListActiveRefreshTokens ¶
func (s *RefreshTokenStore) ListActiveRefreshTokens(_ context.Context, userID string) ([]*store.RefreshToken, error)
func (*RefreshTokenStore) RevokeAllUserRefreshTokens ¶
func (s *RefreshTokenStore) RevokeAllUserRefreshTokens(_ context.Context, userID string) error
func (*RefreshTokenStore) RevokeRefreshToken ¶
func (s *RefreshTokenStore) RevokeRefreshToken(_ context.Context, id string) error
func (*RefreshTokenStore) TouchRefreshToken ¶ added in v0.4.0
func (s *RefreshTokenStore) TouchRefreshToken(_ context.Context, id string, expiresAt time.Time) error
TouchRefreshToken extends a live token, and refuses a revoked one under the same lock that reads it -- otherwise a session revoked between a request's lookup and its extension would come back with a fresh lifetime.
type SuperuserRefreshTokenStore ¶
type SuperuserRefreshTokenStore struct {
// contains filtered or unexported fields
}
SuperuserRefreshTokenStore is an in-memory store.SuperuserRefreshTokenStore.
func NewSuperuserRefreshTokenStore ¶
func NewSuperuserRefreshTokenStore() *SuperuserRefreshTokenStore
func (*SuperuserRefreshTokenStore) ConsumeSuperuserRefreshToken ¶ added in v0.6.0
func (*SuperuserRefreshTokenStore) CreateSuperuserRefreshToken ¶
func (s *SuperuserRefreshTokenStore) CreateSuperuserRefreshToken(_ context.Context, t *store.SuperuserRefreshToken) error
func (*SuperuserRefreshTokenStore) GetSuperuserRefreshTokenByHash ¶
func (s *SuperuserRefreshTokenStore) GetSuperuserRefreshTokenByHash(_ context.Context, hash string) (*store.SuperuserRefreshToken, error)
func (*SuperuserRefreshTokenStore) ListActiveSuperuserRefreshTokens ¶ added in v0.4.0
func (s *SuperuserRefreshTokenStore) ListActiveSuperuserRefreshTokens(_ context.Context, superuserID string) ([]*store.SuperuserRefreshToken, error)
func (*SuperuserRefreshTokenStore) RevokeAllSuperuserRefreshTokens ¶
func (s *SuperuserRefreshTokenStore) RevokeAllSuperuserRefreshTokens(_ context.Context, superuserID string) error
func (*SuperuserRefreshTokenStore) RevokeSuperuserRefreshToken ¶
func (s *SuperuserRefreshTokenStore) RevokeSuperuserRefreshToken(_ context.Context, id string) error
type SuperuserStore ¶
type SuperuserStore struct {
// contains filtered or unexported fields
}
SuperuserStore is an in-memory store.SuperuserStore.
func NewSuperuserStore ¶
func NewSuperuserStore() *SuperuserStore
func (*SuperuserStore) CountSuperusers ¶
func (s *SuperuserStore) CountSuperusers(_ context.Context) (int, error)
func (*SuperuserStore) CreateSuperuser ¶
func (*SuperuserStore) GetSuperuserByEmail ¶
func (*SuperuserStore) GetSuperuserByID ¶
func (*SuperuserStore) ListSuperusers ¶
func (*SuperuserStore) UpdateSuperuser ¶
type SuperuserTwoFactorStore ¶ added in v0.4.0
type SuperuserTwoFactorStore struct {
// contains filtered or unexported fields
}
SuperuserTwoFactorStore is an in-memory store.SuperuserTwoFactorStore. The rows are the user plane's shapes, so it delegates to those stores; the separate instance is what keeps the two planes' rows apart.
func NewSuperuserTwoFactorStore ¶ added in v0.4.0
func NewSuperuserTwoFactorStore() *SuperuserTwoFactorStore
func (*SuperuserTwoFactorStore) CreateSuperuserPendingTwoFactorSession ¶ added in v0.4.0
func (s *SuperuserTwoFactorStore) CreateSuperuserPendingTwoFactorSession(ctx context.Context, p *store.PendingTwoFactorSession) error
func (*SuperuserTwoFactorStore) CreateSuperuserTOTPSettings ¶ added in v0.4.0
func (s *SuperuserTwoFactorStore) CreateSuperuserTOTPSettings(ctx context.Context, t *store.TOTPSettings) error
func (*SuperuserTwoFactorStore) DeleteSuperuserPendingTwoFactorSession ¶ added in v0.4.0
func (s *SuperuserTwoFactorStore) DeleteSuperuserPendingTwoFactorSession(ctx context.Context, id string) error
func (*SuperuserTwoFactorStore) DeleteSuperuserTOTPSettings ¶ added in v0.4.0
func (s *SuperuserTwoFactorStore) DeleteSuperuserTOTPSettings(ctx context.Context, superuserID string) error
func (*SuperuserTwoFactorStore) GetSuperuserPendingTwoFactorSessionByHash ¶ added in v0.4.0
func (s *SuperuserTwoFactorStore) GetSuperuserPendingTwoFactorSessionByHash(ctx context.Context, hash string) (*store.PendingTwoFactorSession, error)
func (*SuperuserTwoFactorStore) GetSuperuserTOTPSettings ¶ added in v0.4.0
func (s *SuperuserTwoFactorStore) GetSuperuserTOTPSettings(ctx context.Context, superuserID string) (*store.TOTPSettings, error)
func (*SuperuserTwoFactorStore) UpdateSuperuserTOTPSettings ¶ added in v0.4.0
func (s *SuperuserTwoFactorStore) UpdateSuperuserTOTPSettings(ctx context.Context, t *store.TOTPSettings) error
type TOTPStore ¶
type TOTPStore struct {
// contains filtered or unexported fields
}
TOTPStore is an in-memory store.TOTPStore.
func NewTOTPStore ¶
func NewTOTPStore() *TOTPStore
func (*TOTPStore) CreateTOTPSettings ¶
func (*TOTPStore) DeleteTOTPSettings ¶
func (*TOTPStore) GetTOTPSettingsByUserID ¶
func (*TOTPStore) UpdateTOTPSettings ¶
type TeamStore ¶
type TeamStore struct {
// contains filtered or unexported fields
}
TeamStore is an in-memory store.TeamStore.
func NewTeamStore ¶
func NewTeamStore() *TeamStore
func (*TeamStore) CreateTeam ¶
func (*TeamStore) GetTeamBySlug ¶
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
UserStore is an in-memory store.UserStore.
func (*UserStore) CreateUser ¶
func (*UserStore) GetUserByEmail ¶
func (*UserStore) GetUserByID ¶
type WebAuthnChallengeStore ¶ added in v0.4.0
type WebAuthnChallengeStore struct {
// contains filtered or unexported fields
}
WebAuthnChallengeStore is an in-memory store.WebAuthnChallengeStore.
func NewWebAuthnChallengeStore ¶ added in v0.4.0
func NewWebAuthnChallengeStore() *WebAuthnChallengeStore
func (*WebAuthnChallengeStore) ConsumeWebAuthnChallenge ¶ added in v0.4.0
func (s *WebAuthnChallengeStore) ConsumeWebAuthnChallenge(_ context.Context, tokenHash string) (*store.WebAuthnChallenge, error)
ConsumeWebAuthnChallenge deletes and returns under one lock, which is what makes it atomic here. A Get method followed by a Delete method would not be: two callers could both read before either deleted, and both would then be finishing the same ceremony.
func (*WebAuthnChallengeStore) CreateWebAuthnChallenge ¶ added in v0.4.0
func (s *WebAuthnChallengeStore) CreateWebAuthnChallenge(_ context.Context, c *store.WebAuthnChallenge) error
type WebAuthnCredentialStore ¶ added in v0.4.0
type WebAuthnCredentialStore struct {
// contains filtered or unexported fields
}
WebAuthnCredentialStore is an in-memory store.WebAuthnCredentialStore.
func NewWebAuthnCredentialStore ¶ added in v0.4.0
func NewWebAuthnCredentialStore() *WebAuthnCredentialStore
func (*WebAuthnCredentialStore) CreateWebAuthnCredential ¶ added in v0.4.0
func (s *WebAuthnCredentialStore) CreateWebAuthnCredential(_ context.Context, c *store.WebAuthnCredential) error
func (*WebAuthnCredentialStore) DeleteWebAuthnCredential ¶ added in v0.4.0
func (s *WebAuthnCredentialStore) DeleteWebAuthnCredential(_ context.Context, id string) error
func (*WebAuthnCredentialStore) GetWebAuthnCredential ¶ added in v0.4.0
func (s *WebAuthnCredentialStore) GetWebAuthnCredential(_ context.Context, id string) (*store.WebAuthnCredential, error)
func (*WebAuthnCredentialStore) GetWebAuthnCredentialByCredentialID ¶ added in v0.4.0
func (s *WebAuthnCredentialStore) GetWebAuthnCredentialByCredentialID(_ context.Context, credentialID []byte) (*store.WebAuthnCredential, error)
func (*WebAuthnCredentialStore) ListWebAuthnCredentialsByUser ¶ added in v0.4.0
func (s *WebAuthnCredentialStore) ListWebAuthnCredentialsByUser(_ context.Context, userID string) ([]*store.WebAuthnCredential, error)
func (*WebAuthnCredentialStore) UpdateWebAuthnCredential ¶ added in v0.4.0
func (s *WebAuthnCredentialStore) UpdateWebAuthnCredential(_ context.Context, c *store.WebAuthnCredential) error