Class JdbcClientAssertionReplayRegistry
java.lang.Object
com.irurueta.authserver.authorization.infrastructure.persistence.clientauth.JdbcClientAssertionReplayRegistry
- All Implemented Interfaces:
ClientAssertionReplayRegistry
@Repository
public class JdbcClientAssertionReplayRegistry
extends Object
implements ClientAssertionReplayRegistry
ClientAssertionReplayRegistry over the client_assertion_jtis table. Each method is a single
statement run in the caller's transaction. The primary key (client_id, jti) makes the insert atomic: of
concurrent registrations of the same pair exactly one inserts a row, the others do nothing and report a replay,
without a constraint violation that would abort the caller's transaction.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
INSERT
Statement recording a first use; a replay inserts nothing.- See Also:
-
DELETE_EXPIRED
Statement deleting the expired identifiers.- See Also:
-
jdbcClient
private final org.springframework.jdbc.core.simple.JdbcClient jdbcClientJDBC client used to run the statements.
-
-
Constructor Details
-
JdbcClientAssertionReplayRegistry
public JdbcClientAssertionReplayRegistry()
-
-
Method Details
-
register
Description copied from interface:ClientAssertionReplayRegistryRecords the first use of an assertion identifier of a client. Safe under concurrency: of several simultaneous registrations of the same pair exactly one returnstrue.- Specified by:
registerin interfaceClientAssertionReplayRegistry- Parameters:
clientId- identifier of the client.jti- thejticlaim of the assertion.expiresAt- instant at which the assertion expires.- Returns:
trueonly when the pair had not been registered before,falsefor a replay.
-
purgeExpired
Description copied from interface:ClientAssertionReplayRegistryForgets the identifiers of the assertions that expired at or before an instant.- Specified by:
purgeExpiredin interfaceClientAssertionReplayRegistry- Parameters:
now- the current instant.- Returns:
- the number of identifiers removed.
-