Class OAuthIssuerKeySnapshot.Builder
java.lang.Object
com.revetsec.oauth.server.OAuthIssuerKeySnapshot.Builder
- Enclosing class:
OAuthIssuerKeySnapshot
@NotThreadSafe
@CheckReturnValue
public static final class OAuthIssuerKeySnapshot.Builder
extends Object
Builds a checked immutable declaration without signing or provider lookup.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Checks and snapshots the configuration.generation(@Nullable String value) Sets the required generation declaration.publishedAt(@Nullable Instant value) Sets the required publication instant.Declares the earliest removal instants for published keys; it does not retire them automatically.Sets additional public keys; an equal active duplicate is allowed, different material for its ID is refused.
-
Method Details
-
verificationKeys
@CheckReturnValue public @NonNull OAuthIssuerKeySnapshot.Builder verificationKeys(@Nullable Map<@NonNull String, @NonNull PublicKey> value) Sets additional public keys; an equal active duplicate is allowed, different material for its ID is refused.- Parameters:
value- at most 100 checked public RSA keys, or null to reset empty- Returns:
- this builder
- Throws:
IllegalArgumentException- if supplied configuration is invalid- Since:
- 1.0.0
-
generation
Sets the required generation declaration.- Parameters:
value- nonempty text of at most 256 characters, or null to clear required- Returns:
- this builder
- Throws:
IllegalArgumentException- if supplied text is invalid- Since:
- 1.0.0
-
publishedAt
@CheckReturnValue public @NonNull OAuthIssuerKeySnapshot.Builder publishedAt(@Nullable Instant value) Sets the required publication instant. Preserve the actual instant for an unchanged generation across restarts; do not backdate a new generation to avoid the publication wait. This setter does not publish keys or restore prior history.- Parameters:
value- an instant before the permanent storage sentinel, or null to clear required- Returns:
- this builder
- Throws:
IllegalArgumentException- if the supplied instant is invalid- Since:
- 1.0.0
-
retirementNotBefore
@CheckReturnValue public @NonNull OAuthIssuerKeySnapshot.Builder retirementNotBefore(@Nullable Map<@NonNull String, @NonNull Instant> value) Declares the earliest removal instants for published keys; it does not retire them automatically.- Parameters:
value- at most 100 key IDs to finite instants, or null to reset empty- Returns:
- this builder
- Throws:
IllegalArgumentException- if supplied configuration is invalid- Since:
- 1.0.0
-
build
Checks and snapshots the configuration.- Returns:
- immutable lifecycle declaration
- Throws:
IllegalStateException- if generation or publishedAt is missingIllegalArgumentException- if supplied configuration is inconsistent- Since:
- 1.0.0
-