Versions in this module Expand all Collapse all v1 v1.0.0 Mar 21, 2026 Changes in this version + func HashRefreshToken(token string) string + func NewJWTService(logger models.Logger, sessionService services.SessionService, ...) services.JWTService + type BlacklistService interface + BlacklistAllSessionTokens func(ctx context.Context, sessionID string, expiresAt time.Time) error + BlacklistToken func(ctx context.Context, jti string, expiresAt time.Time) error + CleanupExpired func(ctx context.Context) error + IsBlacklisted func(ctx context.Context, jti string) (bool, error) + func NewBlacklistService(storage models.SecondaryStorage, logger models.Logger) BlacklistService + type CacheService interface + CacheJWKS func(ctx context.Context, set jwk.Set) error + FetchJWKSFromDatabase func(ctx context.Context) (jwk.Set, error) + GetCachedJWKS func(ctx context.Context) (jwk.Set, error) + GetJWKSWithFallback func(ctx context.Context) (jwk.Set, error) + InvalidateCache func(ctx context.Context) error + func NewCacheService(repo repositories.JWKSRepository, secondaryStorage models.SecondaryStorage, ...) CacheService + type JWTServiceImpl struct + func (s *JWTServiceImpl) GenerateTokens(ctx context.Context, userID string, sessionID string) (*types.TokenPair, error) + func (s *JWTServiceImpl) ValidateToken(token string) (userID string, err error) + type JwtService interface + GenerateTokens func(ctx context.Context, userID string, sessionID string) (*types.TokenPair, error) + type KeyService interface + GenerateKeysIfMissing func(ctx context.Context) error + GetActiveKey func(ctx context.Context) (*types.JWKS, error) + IsKeyRotationDue func(ctx context.Context, rotationInterval time.Duration) bool + RotateKeysIfNeeded func(ctx context.Context, rotationInterval time.Duration, gracePeriod time.Duration, ...) (bool, error) + func NewKeyService(repo repositories.JWKSRepository, logger models.Logger, ...) KeyService + type RefreshTokenRepository interface + CleanupExpiredTokens func(ctx context.Context) error + GetRefreshToken func(ctx context.Context, tokenHash string) (*types.RefreshToken, error) + RevokeAllSessionTokens func(ctx context.Context, sessionID string) error + RevokeRefreshToken func(ctx context.Context, tokenHash string) error + SetLastReuseAttempt func(ctx context.Context, tokenHash string) error + StoreRefreshToken func(ctx context.Context, record *types.RefreshToken) error + type RefreshTokenResponse struct + AccessToken string + RefreshToken string + type RefreshTokenService interface + RefreshTokens func(ctx context.Context, refreshToken string) (*RefreshTokenResponse, error) + StoreInitialRefreshToken func(ctx context.Context, refreshToken string, sessionID string, ...) error + func NewRefreshTokenService(logger models.Logger, eventBus models.EventBus, ...) RefreshTokenService + type RefreshTokenStorage interface + GetRefreshToken func(ctx context.Context, tokenHash string) (*types.RefreshToken, error) + RevokeAllSessionTokens func(ctx context.Context, sessionID string) error + RevokeRefreshToken func(ctx context.Context, tokenHash string) error + SetLastReuseAttempt func(ctx context.Context, tokenHash string) error + StoreRefreshToken func(ctx context.Context, record *types.RefreshToken) error