Interface SamlReplayCache
- All Known Implementing Classes:
InMemorySamlReplayCache
Atomic SAML assertion replay admission. A shared implementation must make one key visible to all nodes before
reporting
SamlReplayCache.MarkResult.MARKED; an uncertain write must report SamlReplayCache.MarkResult.INDETERMINATE. The key is a
SHA-256, URL-safe encoding of length-prefixed SP, connection, IdP and assertion identifiers, not raw identity data.
Live entries must not be evicted to make room. This interface never validates an assertion by itself.- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumOutcomes of an atomic replay admission. -
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull SamlReplayCache.MarkResultmarkIfAbsent(@NonNull String connectionId, @NonNull String key, @NonNull Instant expiresAt, @NonNull Duration remaining) Atomically admit a replay key within a connection's capacity namespace.Atomically admit a previously unseen key until its final possible acceptance time across supported request bindings and time policies.
-
Method Details
-
markIfAbsent
@NonNull SamlReplayCache.MarkResult markIfAbsent(@NonNull String key, @NonNull Instant expiresAt, @NonNull Duration remaining) Atomically admit a previously unseen key until its final possible acceptance time across supported request bindings and time policies. A backend must retain the key through the supplied absolute expiry without rounding that expiry down.- Parameters:
key- the Revetsec-generated replay keyexpiresAt- the final possible acceptance time across supported completion contextsremaining- positive time budget for this operation- Returns:
- an explicit outcome; only MARKED permits identity release
- Since:
- 1.0.0
-
markIfAbsent
default @NonNull SamlReplayCache.MarkResult markIfAbsent(@NonNull String connectionId, @NonNull String key, @NonNull Instant expiresAt, @NonNull Duration remaining) Atomically admit a replay key within a connection's capacity namespace. The key itself already binds the connection, SP and IdP identifiers. Implementations shared by mutually untrusted IdP connections should override this method and reserve capacity per connection. The default preserves source compatibility for existing stores but supplies no such capacity isolation.- Parameters:
connectionId- application-approved IdP connection namespacekey- the Revetsec-generated replay keyexpiresAt- the final possible acceptance timeremaining- positive time budget- Returns:
- an explicit atomic outcome
- Since:
- 1.0.0
-