Class SigningKeyRotator

java.lang.Object
com.irurueta.authserver.authorization.api.web.keys.SigningKeyRotator

@Component public class SigningKeyRotator extends Object
Runs the key lifecycle and announces it, so every caller (the endpoint, the scheduled job and the startup bootstrap) gets the same cache refresh without depending on the adapter that holds the caches.
  • Field Details

    • rotateSigningKeysUseCase

      private final RotateSigningKeysUseCase rotateSigningKeysUseCase
      Applies the lifecycle transitions that are due.
    • eventPublisher

      private final org.springframework.context.ApplicationEventPublisher eventPublisher
      Publishes the rotation event.
    • clock

      private final Clock clock
      Source of the current time.
  • Constructor Details

    • SigningKeyRotator

      public SigningKeyRotator()
  • Method Details

    • rotate

      public void rotate()
      Applies the lifecycle transitions that are due and publishes a SigningKeysRotatedEvent: the path of the start-up runner and the scheduled job.
    • rotateNow

      public void rotateNow()
      Replaces the active key now, whatever its age, and publishes a SigningKeysRotatedEvent: the path of the administration endpoint.
    • published

      private void published()
      Publishes the rotation event, so the cached key sets are refreshed.