Interface PendingSamlAuthenticationStore

All Known Implementing Classes:
InMemoryPendingSamlAuthenticationStore

Atomic storage for browser-bound SAML login and logout attempts. A shared implementation must consume a record at most once across all nodes. The record is sealed by Revetsec and is opaque to the provider. A process-local provider is suitable only for a single node.

This low-level backend SPI deliberately retains opaque String lookup fields for exact existing store framing, including retained SAML spellings. Application-facing pending save/source APIs require BrowserBinding; the SPI value is not identity, authorization or authenticated request provenance.

Since:
1.0.0
  • Method Details

    • save

      @NonNull SamlPendingSaveResult save(@NonNull String browserBinding, @NonNull String relayStateHandle, @NonNull String sealedRecord, @NonNull Instant expiresAt, @NonNull Duration remaining)
      Saves a fresh record without replacing a live record with the same binding and handle.
      Parameters:
      browserBinding - browser-specific secret
      relayStateHandle - generated opaque lookup handle
      sealedRecord - Revetsec-sealed record
      expiresAt - exact expiry
      remaining - positive operation budget
      Returns:
      the save outcome
      Since:
      1.0.0
    • consume

      @NonNull SamlPendingConsumeResult consume(@NonNull String browserBinding, @NonNull String relayStateHandle, @NonNull Duration remaining)
      Atomically removes and returns one matching record. An uncertain removal is indeterminate.
      Parameters:
      browserBinding - browser-specific secret
      relayStateHandle - generated opaque lookup handle
      remaining - positive operation budget
      Returns:
      the consume outcome
      Since:
      1.0.0
    • consumeIfMatches

      default @NonNull SamlPendingConsumeResult consumeIfMatches(@NonNull String browserBinding, @NonNull String relayStateHandle, @NonNull Predicate<@NonNull String> sealedRecordMatches, @NonNull Duration remaining)
      Validates one live sealed record before atomically removing that same record. The predicate must accept the exact record returned by a successful consume; a replacement record must be validated separately. A false predicate returns SamlPendingConsumeResult.Missing without removing the record. A predicate exception or exhausted operation budget returns SamlPendingConsumeResult.Unavailable without removal. An uncertain removal is indeterminate.

      The default implementation returns unavailable without reading, validating or consuming state. Implementations must supply an atomic conditional consume to support this operation; falling back to consume(String, String, Duration) cannot preserve rejected state. Logout completion requires this operation and fails closed until the store overrides it. The predicate should perform only bounded validation and must not mutate store state.

      Parameters:
      browserBinding - browser-specific secret
      relayStateHandle - generated opaque lookup handle
      sealedRecordMatches - validation of the exact live sealed record
      remaining - positive budget including validation and removal
      Returns:
      conditional consume outcome
      Since:
      1.0.0