Versions in this module Expand all Collapse all v0 v0.3.0 Aug 26, 2026 Changes in this version + var ErrConflict = errors.New("authit/store: conflict") + var ErrNotFound = errors.New("authit/store: not found") + type DeviceAuthorization struct + ClientID string + CreatedAt time.Time + DeviceCodeHash string + ExpiresAt time.Time + ID string + IntervalSeconds int + LastPolledAt *time.Time + Scope string + Status DeviceAuthorizationStatus + UserCode string + UserID *string + type DeviceAuthorizationStatus string + const DeviceAuthorizationApproved + const DeviceAuthorizationDenied + const DeviceAuthorizationPending + type DeviceAuthorizationStore interface + CreateDeviceAuthorization func(ctx context.Context, d *DeviceAuthorization) error + DeleteDeviceAuthorization func(ctx context.Context, id string) error + GetDeviceAuthorizationByDeviceCodeHash func(ctx context.Context, hash string) (*DeviceAuthorization, error) + GetDeviceAuthorizationByUserCode func(ctx context.Context, userCode string) (*DeviceAuthorization, error) + UpdateDeviceAuthorization func(ctx context.Context, d *DeviceAuthorization) error + type EmailVerificationStore interface + CreateEmailVerificationToken func(ctx context.Context, t *EmailVerificationToken) error + DeleteUserEmailVerificationTokens func(ctx context.Context, userID string) error + GetEmailVerificationTokenByHash func(ctx context.Context, hash string) (*EmailVerificationToken, error) + MarkEmailVerificationTokenUsed func(ctx context.Context, id string) error + type EmailVerificationToken struct + CreatedAt time.Time + ExpiresAt time.Time + ID string + TokenHash string + UsedAt *time.Time + UserID string + type FailedLoginAttempt struct + CreatedAt time.Time + Email string + ID string + IPAddress string + type Invitation struct + AcceptedAt *time.Time + CreatedAt time.Time + Email string + ExpiresAt time.Time + ID string + InvitedByID string + Role Role + Status InvitationStatus + TeamID string + TokenHash string + UpdatedAt time.Time + type InvitationStatus string + const InvitationAccepted + const InvitationPending + const InvitationRevoked + type InvitationStore interface + CreateInvitation func(ctx context.Context, i *Invitation) error + GetInvitation func(ctx context.Context, id string) (*Invitation, error) + GetInvitationByTokenHash func(ctx context.Context, hash string) (*Invitation, error) + ListInvitationsByTeam func(ctx context.Context, teamID string) ([]*Invitation, error) + UpdateInvitation func(ctx context.Context, i *Invitation) error + type LockoutStore interface + ClearFailedLoginAttempts func(ctx context.Context, email string) error + CountRecentFailedLoginAttempts func(ctx context.Context, email string, since time.Time) (int, error) + IsAccountLocked func(ctx context.Context, userID string) (bool, error) + LockAccount func(ctx context.Context, userID string) error + RecordFailedLoginAttempt func(ctx context.Context, a *FailedLoginAttempt) error + UnlockAccount func(ctx context.Context, userID string) error + type Member struct + CreatedAt time.Time + DisplayName string + Email string + ID string + IsActive bool + Role Role + TeamID string + UpdatedAt time.Time + UserID *string + type MemberStore interface + CreateMember func(ctx context.Context, m *Member) error + DeleteMember func(ctx context.Context, id string) error + GetMember func(ctx context.Context, id string) (*Member, error) + GetMemberByUserAndTeam func(ctx context.Context, userID, teamID string) (*Member, error) + ListMembersByTeam func(ctx context.Context, teamID string) ([]*Member, error) + ListMembershipsByUser func(ctx context.Context, userID string) ([]*Member, error) + UpdateMember func(ctx context.Context, m *Member) error + type PasswordResetStore interface + CreatePasswordResetToken func(ctx context.Context, t *PasswordResetToken) error + DeleteUserPasswordResetTokens func(ctx context.Context, userID string) error + GetPasswordResetTokenByHash func(ctx context.Context, hash string) (*PasswordResetToken, error) + MarkPasswordResetTokenUsed func(ctx context.Context, id string) error + type PasswordResetToken struct + CreatedAt time.Time + ExpiresAt time.Time + ID string + TokenHash string + UsedAt *time.Time + UserID string + type PendingTwoFactorSession struct + CreatedAt time.Time + ExpiresAt time.Time + ID string + TokenHash string + UserID string + type PendingTwoFactorStore interface + CreatePendingTwoFactorSession func(ctx context.Context, s *PendingTwoFactorSession) error + DeletePendingTwoFactorSession func(ctx context.Context, id string) error + GetPendingTwoFactorSessionByHash func(ctx context.Context, hash string) (*PendingTwoFactorSession, error) + type PersonalAccessToken struct + CreatedAt time.Time + ExpiresAt *time.Time + ID string + LastUsedAt *time.Time + Name string + RevokedAt *time.Time + Scopes []string + TokenHash string + UserID string + type PersonalAccessTokenStore interface + CreatePersonalAccessToken func(ctx context.Context, t *PersonalAccessToken) error + GetPersonalAccessToken func(ctx context.Context, id string) (*PersonalAccessToken, error) + GetPersonalAccessTokenByHash func(ctx context.Context, hash string) (*PersonalAccessToken, error) + ListPersonalAccessTokensByUser func(ctx context.Context, userID string) ([]*PersonalAccessToken, error) + UpdatePersonalAccessToken func(ctx context.Context, t *PersonalAccessToken) error + type RefreshToken struct + CreatedAt time.Time + ExpiresAt time.Time + ID string + IPAddress string + RevokedAt *time.Time + TokenHash string + UserAgent string + UserID string + type RefreshTokenStore interface + CreateRefreshToken func(ctx context.Context, t *RefreshToken) error + GetRefreshTokenByHash func(ctx context.Context, hash string) (*RefreshToken, error) + ListActiveRefreshTokens func(ctx context.Context, userID string) ([]*RefreshToken, error) + RevokeAllUserRefreshTokens func(ctx context.Context, userID string) error + RevokeRefreshToken func(ctx context.Context, id string) error + type Role string + const RoleAdmin + const RoleMember + const RoleOwner + type Superuser struct + CreatedAt time.Time + CreatedBy *string + DisplayName string + Email string + ID string + IsActive bool + LastLoginAt *time.Time + PasswordHash string + UpdatedAt time.Time + type SuperuserRefreshToken struct + CreatedAt time.Time + ExpiresAt time.Time + ID string + IPAddress string + RevokedAt *time.Time + SuperuserID string + TokenHash string + UserAgent string + type SuperuserRefreshTokenStore interface + CreateSuperuserRefreshToken func(ctx context.Context, t *SuperuserRefreshToken) error + GetSuperuserRefreshTokenByHash func(ctx context.Context, hash string) (*SuperuserRefreshToken, error) + RevokeAllSuperuserRefreshTokens func(ctx context.Context, superuserID string) error + RevokeSuperuserRefreshToken func(ctx context.Context, id string) error + type SuperuserStore interface + CountSuperusers func(ctx context.Context) (int, error) + CreateSuperuser func(ctx context.Context, s *Superuser) error + GetSuperuserByEmail func(ctx context.Context, email string) (*Superuser, error) + GetSuperuserByID func(ctx context.Context, id string) (*Superuser, error) + ListSuperusers func(ctx context.Context) ([]*Superuser, error) + UpdateSuperuser func(ctx context.Context, s *Superuser) error + type TOTPSettings struct + CreatedAt time.Time + Enabled bool + ID string + RecoveryCodeHashes []string + RecoveryCodesUsed int + SecretEncrypted []byte + UpdatedAt time.Time + UserID string + VerifiedAt *time.Time + type TOTPStore interface + CreateTOTPSettings func(ctx context.Context, t *TOTPSettings) error + DeleteTOTPSettings func(ctx context.Context, userID string) error + GetTOTPSettingsByUserID func(ctx context.Context, userID string) (*TOTPSettings, error) + UpdateTOTPSettings func(ctx context.Context, t *TOTPSettings) error + type Team struct + CreatedAt time.Time + ID string + Name string + OwnerID string + Slug string + UpdatedAt time.Time + type TeamStore interface + CreateTeam func(ctx context.Context, t *Team) error + DeleteTeam func(ctx context.Context, id string) error + GetTeam func(ctx context.Context, id string) (*Team, error) + GetTeamBySlug func(ctx context.Context, slug string) (*Team, error) + UpdateTeam func(ctx context.Context, t *Team) error + type User struct + CreatedAt time.Time + Email string + EmailVerified bool + EmailVerifiedAt *time.Time + ID string + PasswordHash string + UpdatedAt time.Time + type UserStore interface + CreateUser func(ctx context.Context, u *User) error + GetUserByEmail func(ctx context.Context, email string) (*User, error) + GetUserByID func(ctx context.Context, id string) (*User, error) + UpdateUser func(ctx context.Context, u *User) error v0.2.0 Aug 25, 2026