Interface OutboundTokenStrategy
- All Known Implementing Classes:
PassThroughStrategy
@ExperimentalJSentinelApi("V00.74 token propagation; stable promotion staged for V00.76")
public interface OutboundTokenStrategy
Pluggable "how does the inbound token reach the downstream call" SPI.
V00.74 ships PassThroughStrategy as the core default. The
opt-in jSentinel-propagation-oidc module adds
TokenExchangeStrategy (RFC 8693) and
ClientCredentialsStrategy (RFC 6749 §4.4). Consumers register
additional strategies via the .propagation(...) bootstrap
sub-builder.
Implementations return Optional.empty() when no header
should be set — empty is the explicit "skip" answer, not a soft
failure. Hard failures (e.g. token-exchange endpoint returns 401)
throw a runtime exception so the outbound call aborts loudly; never
silently downgrades to the no-header path.
- Since:
- 00.74.00
-
Method Summary
Modifier and TypeMethodDescriptionname()resolve(OutboundCall call, Optional<TokenCredential> inbound)
-
Method Details
-
name
String name()- Returns:
- stable lookup key (e.g.
"pass-through","exchange"); used by@PropagateToken(strategy = …)
-
resolve
- Parameters:
call- the outbound call about to fireinbound- the current inbound credential, if any- Returns:
- the header to bind, or empty to skip
-