Interface AccessTokenObserver
- All Superinterfaces:
JoseObserver, OAuthObserver
Caller-thread resource events and inherited OAuth/JOSE events, without credentials or claims.
Hooks must be fast and thread-safe; callers contain failures except VirtualMachineError.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidReports successful build with the explicit mode.default voidReports a fixed local rejection, never infrastructure failure.default voidReports actual mode use, including a later rejection.default voidReports successful profile validation; releases no result or identity.static @NonNull AccessTokenObserverReturns a silent observer.Methods inherited from interface JoseObserver
didAcceptAnyAudience, didFailToFetchJwks, didFailToValidateJwt, didFetchJwks, didSkipJwk, didSuppressJwksFetch, didUseUnpatchedRuntime, didValidateJwt, willFetchJwksModifier and TypeMethodDescriptiondefault voiddidAcceptAnyAudience(@NonNull String issuer) Called when a validator configured to accept any audience is built, and on each of its validations, because accepting any audience lets a token issued for another application through.default voiddidFailToFetchJwks(@NonNull URI jwksUri, @NonNull JwksUnavailableException exception, @NonNull Boolean servingStaleKeys, @NonNull Duration elapsed) Called when a key set fetch failed, by the one caller that fetched it.default voiddidFailToValidateJwt(@NonNull RevetsecException exception, @NonNull Duration elapsed) Called whenJwtValidator.validateResult(String)rejects a token or cannot get its keys, before returning the rejection or propagating the key-source failure.default voiddidFetchJwks(@NonNull URI jwksUri, @NonNull Integer usableKeyCount, @NonNull Integer skippedKeyCount, @NonNull Duration timeToLive, @NonNull Duration elapsed) Called when a key set fetch succeeded, by the one caller that fetched it.default voiddidSkipJwk(@NonNull URI jwksUri, @NonNull Integer keyIndex, @NonNull JwkSkipReason reason) Called for each key a fetched key set holds but Revetsec does not use, on every fetch.default voiddidSuppressJwksFetch(@NonNull URI jwksUri, @NonNull Duration untilNextAttempt) Called on every call that needed a key set fetch but sent no request, because a recent failure, the unknown-key cooldown or the limit on attempts per cooldown held it back.default voiddidUseUnpatchedRuntime(@NonNull String runtimeVersion) Called when a component that acknowledged running below Revetsec's minimum Java runtime version is built, and on each of its fetches.default voiddidValidateJwt(@NonNull JwsAlgorithm algorithm, @NonNull Duration elapsed) Called whenJwtValidator.validateResult(String)accepted a token.default voidwillFetchJwks(@NonNull URI jwksUri) Called just before aRemoteJwksSourcesends a request for its key set, by the one caller that fetches it.Methods inherited from interface OAuthObserver
didBeginAuthorization, didEnableClientAssertionAudience, didFailClientAssertionPreparation, didFailEndpoint, didRejectCallback, didRequestEndpoint, didUseClientAssertionAudience, didUseUnencodedBasic, willRequestEndpointModifier and TypeMethodDescriptiondefault voiddidBeginAuthorization(@NonNull URI endpoint) Called after a browser authorization URL is prepared.default voidCalled once after a client successfully enables endpoint-audience assertion compatibility.default voiddidFailClientAssertionPreparation(@NonNull OAuthEndpoint endpoint, @NonNull OAuthException exception) Called once for assertion preparation failure before any endpoint will event.default voiddidFailEndpoint(@NonNull OAuthEndpoint endpoint, @NonNull URI uri, @NonNull OAuthException exception, @NonNull Duration elapsed) Called when an endpoint request fails.default voiddidRejectCallback(@NonNull OAuthValidationException exception) Called when a callback fails a local validation check.default voiddidRequestEndpoint(@NonNull OAuthEndpoint endpoint, @NonNull URI uri, @NonNull Integer status, @NonNull Duration elapsed) Called after a completed endpoint request.default voidCalled when endpoint-audience compatibility is selected for an actual assertion operation, including failure.default voidCalled when the explicit unencoded Basic interoperability mode is configured and on every request using it.default voidwillRequestEndpoint(@NonNull OAuthEndpoint endpoint, @NonNull URI uri) Called before an OAuth endpoint request.
-
Method Details
-
disabledInstance
Returns a silent observer.- Returns:
- observer
- Since:
- 1.0.0
-
didEnableCompatibilityMode
Reports successful build with the explicit mode.- Parameters:
mode- enabled mode- Since:
- 1.0.0
-
didUseCompatibilityMode
Reports actual mode use, including a later rejection.- Parameters:
mode- used mode- Since:
- 1.0.0
-
didValidateAccessToken
Reports successful profile validation; releases no result or identity.- Since:
- 1.0.0
-
didRejectAccessToken
Reports a fixed local rejection, never infrastructure failure.- Parameters:
exception- same fixed-message rejection the caller receives- Since:
- 1.0.0
-