Interface OAuthServerObserver
Safe synchronous caller-thread issuer events. Hooks run outside held locks and transactions and must be fast
and thread-safe. Failures are contained except VirtualMachineError; interruption is restored. No event includes
a client, subject, grant, credential, key identifier, URL, request or claims. Exactly one terminal hook follows
each will hook during ordinary completion; status is absent only for validation or trusted management work.
Terminal events describe the processing checkpoint before that hook runs. A hook that delays return or
changes admission/clock health can still cause a subsequent release check to withhold normal output;
that withholding does not emit a second terminal event. A successful event is not a delivery receipt.
- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumFixed operation kinds, without request or application data. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidCalled once after successful construction when the port-less HTTP localhost any-port option is enabled.default voiddidFailToHandleEndpoint(@NonNull OAuthServerObserver.Endpoint endpoint, @NonNull OAuthServerException failure, @NonNull Duration elapsed) Called after infrastructure failure; the same fixed exception reaches the caller.default voiddidHandleEndpoint(@NonNull OAuthServerObserver.Endpoint endpoint, @Nullable Integer statusCode, @NonNull Duration elapsed) Called after ordinary successful completion.default voiddidRejectEndpoint(@NonNull OAuthServerObserver.Endpoint endpoint, @NonNull OAuthServerException.Reason reason, @Nullable Integer statusCode, @NonNull Duration elapsed) Called after an expected rejection, including explicit application denial.default voidCalled once per authorization operation that relies on port-less HTTP localhost any-port matching.static @NonNull OAuthServerObserverReturns the shared observer whose hooks do nothing.default voidCalled before handling an operation.
-
Method Details
-
disabledInstance
Returns the shared observer whose hooks do nothing.- Returns:
- disabled observer
- Since:
- 1.0.0
-
didEnableLocalhostAnyPortRedirects
Called once after successful construction when the port-less HTTP localhost any-port option is enabled. This event carries no configuration or request data.- Since:
- 1.0.0
-
didUseLocalhostAnyPortRedirects
Called once per authorization operation that relies on port-less HTTP localhost any-port matching. It runs before store work, even if a later admission check rejects the request. Exact matches allowed by the separate exact-localhost option do not use this relaxation. This event carries no request data.- Since:
- 1.0.0
-
willHandleEndpoint
Called before handling an operation.- Parameters:
endpoint- fixed operation kind- Since:
- 1.0.0
-
didHandleEndpoint
default void didHandleEndpoint(@NonNull OAuthServerObserver.Endpoint endpoint, @Nullable Integer statusCode, @NonNull Duration elapsed) Called after ordinary successful completion.- Parameters:
endpoint- fixed operation kindstatusCode- HTTP status or null for non-HTTP workelapsed- monotonic elapsed duration- Since:
- 1.0.0
-
didRejectEndpoint
default void didRejectEndpoint(@NonNull OAuthServerObserver.Endpoint endpoint, @NonNull OAuthServerException.Reason reason, @Nullable Integer statusCode, @NonNull Duration elapsed) Called after an expected rejection, including explicit application denial.- Parameters:
endpoint- fixed operation kindreason- fixed rejection reasonstatusCode- HTTP status or null for non-HTTP workelapsed- monotonic elapsed duration- Since:
- 1.0.0
-
didFailToHandleEndpoint
default void didFailToHandleEndpoint(@NonNull OAuthServerObserver.Endpoint endpoint, @NonNull OAuthServerException failure, @NonNull Duration elapsed) Called after infrastructure failure; the same fixed exception reaches the caller.- Parameters:
endpoint- fixed operation kindfailure- fixed exception without external causeselapsed- monotonic elapsed duration- Since:
- 1.0.0
-