java.lang.Object
com.irurueta.authserver.authorization.infrastructure.persistence.keys.JdbcSigningKeyRepository
All Implemented Interfaces:
SigningKeyRepository

@Repository public class JdbcSigningKeyRepository extends Object implements SigningKeyRepository
SigningKeyRepository over the signing_keys table. Rotation is serialised across application instances with a PostgreSQL transaction-level advisory lock.
  • Field Details

    • ROTATION_LOCK_KEY

      static final long ROTATION_LOCK_KEY
      Key of the advisory lock that serialises rotations.
      See Also:
    • FIND_ALL

      private static final String FIND_ALL
      Query returning every key, oldest first.
      See Also:
    • UPSERT

      private static final String UPSERT
      Statement inserting a key, or replacing the state of the key that has the same kid.
      See Also:
    • jdbcClient

      private final org.springframework.jdbc.core.simple.JdbcClient jdbcClient
      JDBC client used to run the statements.
    • transactionTemplate

      private final org.springframework.transaction.support.TransactionTemplate transactionTemplate
      Template that runs the rotation inside a transaction.
    • signingKeyRowMapper

      private final SigningKeyRowMapper signingKeyRowMapper
      Maps a row to a key.
  • Constructor Details

    • JdbcSigningKeyRepository

      public JdbcSigningKeyRepository()
  • Method Details