Documentation
¶
Index ¶
- type InMemoryStorage
- func (s *InMemoryStorage) Close() error
- func (s *InMemoryStorage) Delete(_ context.Context, key string) error
- func (s *InMemoryStorage) Get(_ context.Context, key string) (any, error)
- func (s *InMemoryStorage) Incr(_ context.Context, _ string, _ *time.Duration) (int, error)
- func (s *InMemoryStorage) Scan(_ context.Context, prefix string) ([]string, error)
- func (s *InMemoryStorage) Set(_ context.Context, key string, value any, _ *time.Duration) error
- func (s *InMemoryStorage) TTL(_ context.Context, _ string) (*time.Duration, error)
- type MockBlacklistService
- func (m *MockBlacklistService) BlacklistAllSessionTokens(ctx context.Context, sessionID string, expiresAt time.Time) error
- func (m *MockBlacklistService) BlacklistToken(ctx context.Context, jti string, expiresAt time.Time) error
- func (m *MockBlacklistService) CleanupExpired(ctx context.Context) error
- func (m *MockBlacklistService) IsBlacklisted(ctx context.Context, jti string) (bool, error)
- type MockCacheService
- func (m *MockCacheService) CacheJWKS(ctx context.Context, set jwk.Set) error
- func (m *MockCacheService) FetchJWKSFromDatabase(ctx context.Context) (jwk.Set, error)
- func (m *MockCacheService) GetCachedJWKS(ctx context.Context) (jwk.Set, error)
- func (m *MockCacheService) GetJWKSWithFallback(ctx context.Context) (jwk.Set, error)
- func (m *MockCacheService) InvalidateCache(ctx context.Context) error
- type MockJWKSRepository
- func (m *MockJWKSRepository) GetJWKSKeyByID(ctx context.Context, id string) (*jwtservicesTypes.JWKS, error)
- func (m *MockJWKSRepository) GetJWKSKeys(ctx context.Context) ([]*jwtservicesTypes.JWKS, error)
- func (m *MockJWKSRepository) MarkKeyExpired(ctx context.Context, id string, expiresAt time.Time) error
- func (m *MockJWKSRepository) PurgeExpiredKeys(ctx context.Context) error
- func (m *MockJWKSRepository) StoreJWKSKey(ctx context.Context, key *jwtservicesTypes.JWKS) error
- func (m *MockJWKSRepository) UpdateJWKSKey(ctx context.Context, key *jwtservicesTypes.JWKS) error
- type MockJWTService
- type MockKeyService
- func (m *MockKeyService) GenerateKeysIfMissing(ctx context.Context) error
- func (m *MockKeyService) GetActiveKey(ctx context.Context) (*jwtservicesTypes.JWKS, error)
- func (m *MockKeyService) IsKeyRotationDue(ctx context.Context, rotationInterval time.Duration) bool
- func (m *MockKeyService) RotateKeysIfNeeded(ctx context.Context, rotationInterval time.Duration, gracePeriod time.Duration, ...) (bool, error)
- type MockRefreshTokenRepository
- func (m *MockRefreshTokenRepository) CleanupExpiredTokens(ctx context.Context) error
- func (m *MockRefreshTokenRepository) GetRefreshToken(ctx context.Context, tokenHash string) (*jwtservicesTypes.RefreshToken, error)
- func (m *MockRefreshTokenRepository) RevokeAllSessionTokens(ctx context.Context, sessionID string) error
- func (m *MockRefreshTokenRepository) RevokeRefreshToken(ctx context.Context, tokenHash string) error
- func (m *MockRefreshTokenRepository) SetLastReuseAttempt(ctx context.Context, tokenHash string) error
- func (m *MockRefreshTokenRepository) StoreRefreshToken(ctx context.Context, record *jwtservicesTypes.RefreshToken) error
- type MockRefreshTokenService
- type MockSessionService
- func (m *MockSessionService) Create(ctx context.Context, userID string, hashedToken string, ipAddress *string, ...) (*models.Session, error)
- func (m *MockSessionService) Delete(ctx context.Context, ID string) error
- func (m *MockSessionService) DeleteAllByUserID(ctx context.Context, userID string) error
- func (m *MockSessionService) DeleteAllExpired(ctx context.Context) error
- func (m *MockSessionService) DeleteOldestByUserID(ctx context.Context, userID string, maxCount int) error
- func (m *MockSessionService) GetByID(ctx context.Context, id string) (*models.Session, error)
- func (m *MockSessionService) GetByToken(ctx context.Context, hashedToken string) (*models.Session, error)
- func (m *MockSessionService) GetByUserID(ctx context.Context, userID string) (*models.Session, error)
- func (m *MockSessionService) GetDistinctUserIDs(ctx context.Context) ([]string, error)
- func (m *MockSessionService) Update(ctx context.Context, session *models.Session) (*models.Session, error)
- type MockTokenService
- func (m *MockTokenService) GenerateMachineToken(ctx context.Context, clientID string, organizationID string, scopes []string) (*jwtservicesTypes.TokenPair, error)
- func (m *MockTokenService) GenerateUserToken(ctx context.Context, userID string, sessionID string) (*jwtservicesTypes.TokenPair, error)
- func (m *MockTokenService) ValidateToken(ctx context.Context, token string) (*models.Actor, error)
- type MockTokenServiceCore
- type NopTokenService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryStorage ¶
type InMemoryStorage struct {
// contains filtered or unexported fields
}
func NewInMemoryStorage ¶
func NewInMemoryStorage() *InMemoryStorage
func (*InMemoryStorage) Close ¶
func (s *InMemoryStorage) Close() error
func (*InMemoryStorage) Delete ¶
func (s *InMemoryStorage) Delete(_ context.Context, key string) error
type MockBlacklistService ¶
func (*MockBlacklistService) BlacklistAllSessionTokens ¶
func (*MockBlacklistService) BlacklistToken ¶
func (*MockBlacklistService) CleanupExpired ¶
func (m *MockBlacklistService) CleanupExpired(ctx context.Context) error
func (*MockBlacklistService) IsBlacklisted ¶
type MockCacheService ¶
func (*MockCacheService) FetchJWKSFromDatabase ¶
func (*MockCacheService) GetCachedJWKS ¶
func (*MockCacheService) GetJWKSWithFallback ¶
func (*MockCacheService) InvalidateCache ¶
func (m *MockCacheService) InvalidateCache(ctx context.Context) error
type MockJWKSRepository ¶
func (*MockJWKSRepository) GetJWKSKeyByID ¶
func (m *MockJWKSRepository) GetJWKSKeyByID(ctx context.Context, id string) (*jwtservicesTypes.JWKS, error)
func (*MockJWKSRepository) GetJWKSKeys ¶
func (m *MockJWKSRepository) GetJWKSKeys(ctx context.Context) ([]*jwtservicesTypes.JWKS, error)
func (*MockJWKSRepository) MarkKeyExpired ¶
func (*MockJWKSRepository) PurgeExpiredKeys ¶
func (m *MockJWKSRepository) PurgeExpiredKeys(ctx context.Context) error
func (*MockJWKSRepository) StoreJWKSKey ¶
func (m *MockJWKSRepository) StoreJWKSKey(ctx context.Context, key *jwtservicesTypes.JWKS) error
func (*MockJWKSRepository) UpdateJWKSKey ¶
func (m *MockJWKSRepository) UpdateJWKSKey(ctx context.Context, key *jwtservicesTypes.JWKS) error
type MockJWTService ¶
func (*MockJWTService) ValidateToken ¶
type MockKeyService ¶
func (*MockKeyService) GenerateKeysIfMissing ¶
func (m *MockKeyService) GenerateKeysIfMissing(ctx context.Context) error
func (*MockKeyService) GetActiveKey ¶
func (m *MockKeyService) GetActiveKey(ctx context.Context) (*jwtservicesTypes.JWKS, error)
func (*MockKeyService) IsKeyRotationDue ¶
type MockRefreshTokenRepository ¶
func (*MockRefreshTokenRepository) CleanupExpiredTokens ¶
func (m *MockRefreshTokenRepository) CleanupExpiredTokens(ctx context.Context) error
func (*MockRefreshTokenRepository) GetRefreshToken ¶
func (m *MockRefreshTokenRepository) GetRefreshToken(ctx context.Context, tokenHash string) (*jwtservicesTypes.RefreshToken, error)
func (*MockRefreshTokenRepository) RevokeAllSessionTokens ¶
func (m *MockRefreshTokenRepository) RevokeAllSessionTokens(ctx context.Context, sessionID string) error
func (*MockRefreshTokenRepository) RevokeRefreshToken ¶
func (m *MockRefreshTokenRepository) RevokeRefreshToken(ctx context.Context, tokenHash string) error
func (*MockRefreshTokenRepository) SetLastReuseAttempt ¶
func (m *MockRefreshTokenRepository) SetLastReuseAttempt(ctx context.Context, tokenHash string) error
func (*MockRefreshTokenRepository) StoreRefreshToken ¶
func (m *MockRefreshTokenRepository) StoreRefreshToken(ctx context.Context, record *jwtservicesTypes.RefreshToken) error
type MockRefreshTokenService ¶
func (*MockRefreshTokenService) RefreshTokens ¶
func (m *MockRefreshTokenService) RefreshTokens(ctx context.Context, refreshToken string) (*jwtservicesTypes.RefreshTokenResponse, error)
func (*MockRefreshTokenService) StoreInitialRefreshToken ¶
type MockSessionService ¶
func (*MockSessionService) Delete ¶
func (m *MockSessionService) Delete(ctx context.Context, ID string) error
func (*MockSessionService) DeleteAllByUserID ¶
func (m *MockSessionService) DeleteAllByUserID(ctx context.Context, userID string) error
func (*MockSessionService) DeleteAllExpired ¶
func (m *MockSessionService) DeleteAllExpired(ctx context.Context) error
func (*MockSessionService) DeleteOldestByUserID ¶
func (*MockSessionService) GetByToken ¶
func (*MockSessionService) GetByUserID ¶
func (*MockSessionService) GetDistinctUserIDs ¶
func (m *MockSessionService) GetDistinctUserIDs(ctx context.Context) ([]string, error)
type MockTokenService ¶
func (*MockTokenService) GenerateMachineToken ¶
func (m *MockTokenService) GenerateMachineToken(ctx context.Context, clientID string, organizationID string, scopes []string) (*jwtservicesTypes.TokenPair, error)
func (*MockTokenService) GenerateUserToken ¶
func (m *MockTokenService) GenerateUserToken(ctx context.Context, userID string, sessionID string) (*jwtservicesTypes.TokenPair, error)
func (*MockTokenService) ValidateToken ¶
type MockTokenServiceCore ¶
func (*MockTokenServiceCore) Decrypt ¶
func (m *MockTokenServiceCore) Decrypt(encrypted string) (string, error)
func (*MockTokenServiceCore) Encrypt ¶
func (m *MockTokenServiceCore) Encrypt(token string) (string, error)
func (*MockTokenServiceCore) Generate ¶
func (m *MockTokenServiceCore) Generate() (string, error)
func (*MockTokenServiceCore) Hash ¶
func (m *MockTokenServiceCore) Hash(token string) string
type NopTokenService ¶
type NopTokenService struct{}
func (NopTokenService) Generate ¶
func (NopTokenService) Generate() (string, error)
func (NopTokenService) Hash ¶
func (NopTokenService) Hash(token string) string
Click to show internal directories.
Click to hide internal directories.