Interface TokenCredentialStore
- All Known Subinterfaces:
ThreadSafeTokenCredentialStore
- All Known Implementing Classes:
InMemoryTokenCredentialStore
@ExperimentalJSentinelApi("V00.74 token propagation; stable promotion staged for V00.76")
public interface TokenCredentialStore
Persistence-neutral store for the current subject's
TokenCredential. Inbound resolvers (V00.74 RestSubjectResolver
extension, V00.80 OIDC bridge) populate it; outbound wrappers
(@PropagateToken, PropagatingProxy) read from it.
Adapter-specific defaults ship in each adapter module:
VaadinSessionTokenCredentialStore(jSentinel-vaadin) — backed byVaadinSession.ThreadLocalTokenCredentialStore(jSentinel-rest) — backed by a per-requestThreadLocal, scoped byRestTokenCredentialFilter.ThreadLocalTokenCredentialStore(jSentinel-standalone) — backed by a per-threadThreadLocal, scoped byStandaloneLoginFlow.
Consumers override the SPI default through the
.propagation(p -> p.credentialStore(myStore)) sub-builder
(V00.74 Prompt 015 / 016).
The V00.74 contract intentionally omits a refresh()
surface — RefreshableTokenCredentialStore extends
TokenCredentialStore is staged for V00.76 (Konzept §6.4) so adding
it later does not break this contract.
- Since:
- 00.74.00
-
Method Summary
Modifier and TypeMethodDescriptionvoidbind(TokenCredential credential) Replace any current entry withcredential.voidclear()Reset to the empty state.current()
-
Method Details
-
bind
Replace any current entry withcredential.- Parameters:
credential- the new entry (non-null)
-
current
Optional<TokenCredential> current()- Returns:
- the current entry, or empty
-
clear
void clear()Reset to the empty state. Idempotent — repeated calls are no-ops.
-