Class SigningKeyRotator
java.lang.Object
com.irurueta.authserver.authorization.api.web.keys.SigningKeyRotator
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final ClockSource of the current time.private final org.springframework.context.ApplicationEventPublisherPublishes the rotation event.private final RotateSigningKeysUseCaseApplies the lifecycle transitions that are due. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidPublishes the rotation event, so the cached key sets are refreshed.voidrotate()Applies the lifecycle transitions that are due and publishes aSigningKeysRotatedEvent: the path of the start-up runner and the scheduled job.voidReplaces the active key now, whatever its age, and publishes aSigningKeysRotatedEvent: the path of the administration endpoint.
-
Field Details
-
rotateSigningKeysUseCase
Applies the lifecycle transitions that are due. -
eventPublisher
private final org.springframework.context.ApplicationEventPublisher eventPublisherPublishes the rotation event. -
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 aSigningKeysRotatedEvent: 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 aSigningKeysRotatedEvent: the path of the administration endpoint. -
published
private void published()Publishes the rotation event, so the cached key sets are refreshed.
-