authstorage

package
v0.0.0-...-c6a46fa Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIKeysStorage

func NewAPIKeysStorage(db *gorm.DB, logger *logging.Logger) authsvc.APIKeysStorage

func NewOAuthClientsStorage

func NewOAuthClientsStorage(db *gorm.DB, logger *logging.Logger) authsvc.OAuthClientsStorage

func NewOAuthCodesStorage

func NewOAuthCodesStorage(db *gorm.DB, logger *logging.Logger) authsvc.OAuthCodesStorage

func NewOAuthGrantsStorage

func NewOAuthGrantsStorage(db *gorm.DB, logger *logging.Logger) authsvc.OAuthGrantsStorage

func NewOAuthRefreshTokensStorage

func NewOAuthRefreshTokensStorage(db *gorm.DB, logger *logging.Logger) authsvc.OAuthRefreshTokensStorage

func NewOIDCIdentitiesStorage

func NewOIDCIdentitiesStorage(db *gorm.DB, logger *logging.Logger) authsvc.OIDCIdentitiesStorage

func NewOIDCStatesStorage

func NewOIDCStatesStorage(db *gorm.DB, logger *logging.Logger) authsvc.OIDCStatesStorage

func NewPasswordResetTokensStorage

func NewPasswordResetTokensStorage(db *gorm.DB, logger *logging.Logger) authsvc.PasswordResetTokensStorage

func NewRateLimitsStorage

func NewRateLimitsStorage(db *gorm.DB, logger *logging.Logger) authsvc.RateLimitsStorage

func NewRefreshTokensStorage

func NewRefreshTokensStorage(db *gorm.DB, logger *logging.Logger) authsvc.RefreshTokensStorage

func NewTableGenerators

func NewTableGenerators() table.GeneratorList

func NewUsersStorage

func NewUsersStorage(db *gorm.DB, logger *logging.Logger) authsvc.UsersStorage

Types

type OAuthStorage

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

OAuthStorage runs the OAuth queries the generated storage cannot express.

func NewOAuthStorage

func NewOAuthStorage(db *gorm.DB) *OAuthStorage

func (*OAuthStorage) ConsumeOAuthCode

func (s *OAuthStorage) ConsumeOAuthCode(ctx context.Context, codeHash string) (*authservice.OAuthCode, error)

func (*OAuthStorage) DeleteExpiredOAuthKeys

func (s *OAuthStorage) DeleteExpiredOAuthKeys(ctx context.Context, before time.Time) error

func (*OAuthStorage) DeleteLapsedOAuthGrants

func (s *OAuthStorage) DeleteLapsedOAuthGrants(ctx context.Context, before time.Time) error

DeleteLapsedOAuthGrants deletes the expired refresh tokens, then the grants left without one; their API keys go with them by the foreign key cascade.

func (*OAuthStorage) DeleteUnusedOAuthClients

func (s *OAuthStorage) DeleteUnusedOAuthClients(ctx context.Context, neverGrantedBefore, lastGrantedBefore time.Time) error

func (*OAuthStorage) MarkOAuthRefreshTokenUsed

func (s *OAuthStorage) MarkOAuthRefreshTokenUsed(ctx context.Context, tokenHash string, at time.Time) (*authservice.OAuthRefreshToken, error)

type RateLimitStorage

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

RateLimitStorage counts hits per key in auth.rate_limits.

func NewRateLimitStorage

func NewRateLimitStorage(db *gorm.DB) *RateLimitStorage

func (*RateLimitStorage) HitRateLimit

func (s *RateLimitStorage) HitRateLimit(ctx context.Context, key string, now time.Time, window time.Duration) (int, error)

type Storages

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

func NewStorages

func NewStorages(db *gorm.DB, logger *logging.Logger, processors []txoutbox.MessageProcessor) *Storages

func (Storages) APIKeys

func (s Storages) APIKeys() authsvc.APIKeysStorage

func (Storages) ExecuteInTransaction

func (s Storages) ExecuteInTransaction(ctx context.Context, cb func(ctx context.Context, tx authsvc.Storage) error) error

func (Storages) IdempotencyKeys

func (s Storages) IdempotencyKeys() idempotency.Storage

func (Storages) OAuthClients

func (s Storages) OAuthClients() authsvc.OAuthClientsStorage

func (Storages) OAuthCodes

func (s Storages) OAuthCodes() authsvc.OAuthCodesStorage

func (Storages) OAuthGrants

func (s Storages) OAuthGrants() authsvc.OAuthGrantsStorage

func (Storages) OAuthRefreshTokens

func (s Storages) OAuthRefreshTokens() authsvc.OAuthRefreshTokensStorage

func (Storages) OIDCIdentities

func (s Storages) OIDCIdentities() authsvc.OIDCIdentitiesStorage

func (Storages) OIDCStates

func (s Storages) OIDCStates() authsvc.OIDCStatesStorage

func (Storages) PasswordResetTokens

func (s Storages) PasswordResetTokens() authsvc.PasswordResetTokensStorage

func (Storages) RateLimits

func (s Storages) RateLimits() authsvc.RateLimitsStorage

func (Storages) RefreshTokens

func (s Storages) RefreshTokens() authsvc.RefreshTokensStorage

func (Storages) Users

func (s Storages) Users() authsvc.UsersStorage

func (*Storages) WithAdvisoryLock

func (s *Storages) WithAdvisoryLock(ctx context.Context, scope string, lockID int64) error

type UserIDStorage

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

UserIDStorage answers id-only questions about user accounts.

func NewUserIDStorage

func NewUserIDStorage(db *gorm.DB) *UserIDStorage

func (*UserIDStorage) ExistingUserIDs

func (s *UserIDStorage) ExistingUserIDs(ctx context.Context, ids []uuid.UUID) ([]uuid.UUID, error)

Jump to

Keyboard shortcuts

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