Interface ClientAssertionReplayRegistry

All Known Implementing Classes:
JdbcClientAssertionReplayRegistry

public interface ClientAssertionReplayRegistry
Port that remembers the identifiers (jti) of the client assertions already accepted, so an assertion cannot be presented twice. Implementations never return null.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Forgets the identifiers of the assertions that expired at or before an instant.
    boolean
    register(String clientId, String jti, Instant expiresAt)
    Records the first use of an assertion identifier of a client.
  • Method Details

    • register

      boolean register(String clientId, String jti, Instant expiresAt)
      Records the first use of an assertion identifier of a client. Safe under concurrency: of several simultaneous registrations of the same pair exactly one returns true.
      Parameters:
      clientId - identifier of the client.
      jti - the jti claim of the assertion.
      expiresAt - instant at which the assertion expires.
      Returns:
      true only when the pair had not been registered before, false for a replay.
    • purgeExpired

      int purgeExpired(Instant now)
      Forgets the identifiers of the assertions that expired at or before an instant.
      Parameters:
      now - the current instant.
      Returns:
      the number of identifiers removed.