Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelandis committed Sep 6, 2023
1 parent cc2e869 commit 9a4aba4
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@

import java.time.Instant;
import java.util.concurrent.locks.StampedLock;
import java.util.function.Consumer;

/**
* Helper class to provide {@link SecureString} that can be rotated. Once rotated the prior secret is available for a configured amount
* of time before it is invalidated. This allows for secrete rotation without temporary failures or the need to tightly orchestrate
* A {@link SecureString} that can be rotated with a grace period for the secret that has been rotated out.
* Once rotated the prior secret is available for a configured amount of time before it is invalidated.
* This allows for secrete rotation without temporary failures or the need to tightly orchestrate
* multiple parties. This class is threadsafe, however it is also assumes that matching secrets are frequent but rotation is a rare.
*/
public class RotatableSecret {
Expand Down Expand Up @@ -85,7 +87,8 @@ boolean isWriteLocked() {
}

/**
* Checks to see if the prior secret TTL has expired. If expired, evict from the backing data structure.
* Checks to see if the prior secret TTL has expired. If expired, evict from the backing data structure. Always call this before
* reading the secret(s).
*/
private void checkExpired() {
boolean needToUnlock = false;
Expand Down

0 comments on commit 9a4aba4

Please sign in to comment.