Interface RevokedTokenRepositoryAdapter
- All Known Implementing Classes:
RevokedTokenRepositoryAdapterImpl
public interface RevokedTokenRepositoryAdapter
Adapter for revoked token operations with domain-specific exception handling.
Translates database constraint violations into business exceptions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all revoked tokens that expired before the specified timestamp.booleanisTokenRevoked(String token) Checks if a token has been revoked.saveRevokedToken(String token, LocalDateTime expiresAt) Persists a revoked token with its expiration timestamp.
-
Method Details
-
saveRevokedToken
Persists a revoked token with its expiration timestamp.- Parameters:
token- hashed refresh token to revokeexpiresAt- token expiration timestamp- Returns:
- persisted revoked token entity
- Throws:
TokenAlreadyRevokedException- if token was already revokedFailedToRevokeTokenException- if persistence fails
-
isTokenRevoked
Checks if a token has been revoked.- Parameters:
token- hashed refresh token to check- Returns:
- true if token exists in revoked tokens table
- Throws:
FailedToCheckTokenRevokedException- if check fails
-
deleteExpiredTokens
Removes all revoked tokens that expired before the specified timestamp.- Parameters:
now- cutoff timestamp for deletion- Throws:
FailedToCleanRevokedTokensException- if cleanup fails
-