Class OAuthAuthorizationServer
java.lang.Object
com.revetsec.oauth.server.OAuthAuthorizationServer
Caller-thread OAuth code issuer with authoritative online grant status. Applications supply users, consent,
atomic durable storage, admitted store time, healthy worker clocks, keys and authorization policy. Register the exact configured
routes; request headers never select issuer authority. Protect completion with the app's session and CSRF
controls. Infrastructure faults remain exceptions; expected remote rejection is a restricted result.
Construction performs no application data callbacks, network I/O, signing or thread startup; the builder documents
its explicit observer notification. No positive grant-status cache.
Revetsec has not been independently audited.
- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable, non-thread-safe issuer configuration. -
Method Summary
Modifier and TypeMethodDescriptionbeginAuthorizationResult(@NonNull String httpMethod, @Nullable String rawQuery, byte @NonNull [] rawBody, @NonNull Map<@NonNull String, @NonNull List<@NonNull String>> rawHeaderValues, @NonNull BrowserBinding browserBinding) Admits a GET authorization request and creates a browser-bound interaction.completeAuthorizationResult(@NonNull String interactionValue, @NonNull BrowserBinding browserBinding, @NonNull OAuthAuthorizationDecision decision) Completes app-protected consent once, with a fresh narrowing policy check before commit.voidestablishNewSubject(@NonNull String subject) Explicitly registers a never-used subject; never use this to repair lost permanent fences.Returns configured AuthorizationEndpoint.Returns configured IntrospectionEndpoint.Returns configured Issuer.Returns configured JwksEndpoint.Returns configured RevocationEndpoint.Returns configured TokenEndpoint.Explicitly initializes a namespace the operator knows has never been used or restored.introspectionResult(@NonNull String httpMethod, @Nullable String rawQuery, byte @NonNull [] rawBody, @NonNull Map<@NonNull String, @NonNull List<@NonNull String>> rawHeaderValues) Handles one bounded introspection form request on its configured route.jwksResponse(@NonNull String httpMethod) Prepares bounded public json web key set for GET or HEAD.metadataResponse(@NonNull String httpMethod) Prepares bounded public metadata for GET or HEAD.Attempts one authenticated reseal CAS without changing grant authority or retention.Translates a caught infrastructure exception to a fixed, bounded local503 response.resumeAuthorizationResult(@NonNull String interactionValue, @NonNull BrowserBinding browserBinding) Rechecks a continuation before rendering consent; this does not authenticate a user.voidAdvances the established issuer fence; UNKNOWN requires reconciliation.voidrevokeGrant(@NonNull String grantValue) Revokes a trusted grant reference monotonically.revokeResult(@NonNull String httpMethod, @Nullable String rawQuery, byte @NonNull [] rawBody, @NonNull Map<@NonNull String, @NonNull List<@NonNull String>> rawHeaderValues) Handles one bounded revocation form request on its configured route.voidrevokeSubject(@NonNull String subject) Advances an established subject fence; UNKNOWN requires reconciliation.tokenResult(@NonNull String httpMethod, @Nullable String rawQuery, byte @NonNull [] rawBody, @NonNull Map<@NonNull String, @NonNull List<@NonNull String>> rawHeaderValues) Handles one bounded token form request on its configured route.toString()Returns a fixed description without configuration or credentials.validateAccessTokenResult(@NonNull BearerToken token, @NonNull String resource) Validates local M5 signature/profile facts and uncached authoritative issuer status before releasing the checked token and its sensitive issuer-local grant management handle.voidwarmUp()Checks configured signing keys and the established issuer fence on one shrinking caller budget.withIssuer(@NonNull String issuer) Starts configuration with an exact issuer identity, retained for the lifetime of the builder/server.
-
Method Details
-
withIssuer
@CheckReturnValue public static @NonNull OAuthAuthorizationServer.Builder withIssuer(@NonNull String issuer) Starts configuration with an exact issuer identity, retained for the lifetime of the builder/server. The primary argument is required and cannot be cleared. This factory checks its URI shape; numeric HTTP loopback is admitted provisionally but still requiresOAuthAuthorizationServer.Builder.allowInsecureLoopback(Boolean)at build. Localhost HTTP issuers are not supported. No endpoint routes are inferred or network calls made.- Parameters:
issuer- absolute HTTPS issuer, or a numeric HTTP loopback issuer for explicit local opt-in- Returns:
- an otherwise unconfigured builder
- Throws:
NullPointerException- if issuer is nullIllegalArgumentException- if issuer is not a permitted absolute issuer URI- Since:
- 1.0.0
-
beginAuthorizationResult
@CheckReturnValue public @NonNull OAuthAuthorizationResult beginAuthorizationResult(@NonNull String httpMethod, @Nullable String rawQuery, byte @NonNull [] rawBody, @NonNull Map<@NonNull String, @NonNull List<@NonNull String>> rawHeaderValues, @NonNull BrowserBinding browserBinding) Admits a GET authorization request and creates a browser-bound interaction.- Parameters:
httpMethod- materialized methodrawQuery- original query or absencerawBody- materialized bodyrawHeaderValues- original header names and all occurrencesbrowserBinding- independent app-owned canonical random binding- Returns:
- interaction or fixed local rejection
- Since:
- 1.0.0
-
resumeAuthorizationResult
@CheckReturnValue public @NonNull OAuthAuthorizationResult resumeAuthorizationResult(@NonNull String interactionValue, @NonNull BrowserBinding browserBinding) Rechecks a continuation before rendering consent; this does not authenticate a user.- Parameters:
interactionValue- secret continuationbrowserBinding- independent app-owned binding- Returns:
- checked restricted interaction or rejection
- Since:
- 1.0.0
-
completeAuthorizationResult
@CheckReturnValue public @NonNull OAuthAuthorizationResult completeAuthorizationResult(@NonNull String interactionValue, @NonNull BrowserBinding browserBinding, @NonNull OAuthAuthorizationDecision decision) Completes app-protected consent once, with a fresh narrowing policy check before commit.- Parameters:
interactionValue- secret continuationbrowserBinding- independent app-owned bindingdecision- trusted server-side app decision- Returns:
- retained committed redirect or rejection
- Since:
- 1.0.0
-
tokenResult
@CheckReturnValue public @NonNull OAuthTokenResult tokenResult(@NonNull String httpMethod, @Nullable String rawQuery, byte @NonNull [] rawBody, @NonNull Map<@NonNull String, @NonNull List<@NonNull String>> rawHeaderValues) Handles one bounded token form request on its configured route.- Parameters:
httpMethod- materialized methodrawQuery- original query or absencerawBody- materialized bodyrawHeaderValues- original names and every occurrence- Returns:
- committed response or fixed local rejection
- Since:
- 1.0.0
-
revokeResult
@CheckReturnValue public @NonNull OAuthRevocationResult revokeResult(@NonNull String httpMethod, @Nullable String rawQuery, byte @NonNull [] rawBody, @NonNull Map<@NonNull String, @NonNull List<@NonNull String>> rawHeaderValues) Handles one bounded revocation form request on its configured route.- Parameters:
httpMethod- materialized methodrawQuery- original query or absencerawBody- materialized bodyrawHeaderValues- original names and every occurrence- Returns:
- committed response or fixed local rejection
- Since:
- 1.0.0
-
introspectionResult
@CheckReturnValue public @NonNull OAuthIntrospectionResult introspectionResult(@NonNull String httpMethod, @Nullable String rawQuery, byte @NonNull [] rawBody, @NonNull Map<@NonNull String, @NonNull List<@NonNull String>> rawHeaderValues) Handles one bounded introspection form request on its configured route.- Parameters:
httpMethod- materialized methodrawQuery- original query or absencerawBody- materialized bodyrawHeaderValues- original names and every occurrence- Returns:
- committed response or fixed local rejection
- Since:
- 1.0.0
-
validateAccessTokenResult
@CheckReturnValue public @NonNull OAuthIssuerAccessTokenResult validateAccessTokenResult(@NonNull BearerToken token, @NonNull String resource) Validates local M5 signature/profile facts and uncached authoritative issuer status before releasing the checked token and its sensitive issuer-local grant management handle. The handle is constructed from the same access/grant snapshot only after the atomic status barrier commits; it is not a generic JWT claim.- Parameters:
token- unverified bearer credentialresource- exact configured application resource- Returns:
- restricted checked proof plus grant handle, or fixed rejection
- Since:
- 1.0.0
-
revokeGrant
Revokes a trusted grant reference monotonically.- Parameters:
grantValue- trusted management identity- Since:
- 1.0.0
-
revokeSubject
Advances an established subject fence; UNKNOWN requires reconciliation.- Parameters:
subject- trusted management identity- Since:
- 1.0.0
-
revokeAllGrants
Advances the established issuer fence; UNKNOWN requires reconciliation.- Since:
- 1.0.0
-
establishNewSubject
Explicitly registers a never-used subject; never use this to repair lost permanent fences.- Parameters:
subject- trusted management identity- Since:
- 1.0.0
-
initializeFreshIssuer
Explicitly initializes a namespace the operator knows has never been used or restored. Existing state yields CONFLICT. UNKNOWN never means ready; reconcile before traffic or retry.- Returns:
- one authoritative initialization outcome
- Since:
- 1.0.0
-
resealStoreEntry
@CheckReturnValue public @NonNull OAuthStoreCommitReceipt resealStoreEntry(@NonNull OAuthStoreKey key) Attempts one authenticated reseal CAS without changing grant authority or retention.- Parameters:
key- privileged namespace-bound maintenance key- Returns:
- the factual store outcome: COMMITTED, CONFLICT for absence/race/expired row, UNKNOWN requiring reconciliation, or another explicit refusal reported by the configured store
- Since:
- 1.0.0
-
metadataResponse
Prepares bounded public metadata for GET or HEAD.- Parameters:
httpMethod- exact method- Returns:
- safe public response, including method rejection
- Throws:
OAuthServerConfigurationException- if the configured representation exceeds publication capacity- Since:
- 1.0.0
-
jwksResponse
Prepares bounded public json web key set for GET or HEAD.- Parameters:
httpMethod- exact method- Returns:
- safe public response, including method rejection
- Throws:
OAuthServerConfigurationException- if the configured representation exceeds publication capacity- Since:
- 1.0.0
-
responseForFailure
@CheckReturnValue public @NonNull OAuthServerResponse responseForFailure(@NonNull OAuthServerException failure) Translates a caught infrastructure exception to a fixed, bounded local503 response.- Parameters:
failure- restricted issuer failure- Returns:
- safe response with no redirect or reflected descriptions
- Since:
- 1.0.0
-
warmUp
Checks configured signing keys and the established issuer fence on one shrinking caller budget. Never initializes missing state or fetches arbitrary client metadata.- Since:
- 1.0.0
-
getIssuer
-
getAuthorizationEndpoint
Returns configured AuthorizationEndpoint.- Returns:
- exact setting or optional absence
- Since:
- 1.0.0
-
getTokenEndpoint
Returns configured TokenEndpoint.- Returns:
- exact setting or optional absence
- Since:
- 1.0.0
-
getJwksEndpoint
Returns configured JwksEndpoint.- Returns:
- exact setting or optional absence
- Since:
- 1.0.0
-
getRevocationEndpoint
Returns configured RevocationEndpoint.- Returns:
- exact setting or optional absence
- Since:
- 1.0.0
-
getIntrospectionEndpoint
Returns configured IntrospectionEndpoint.- Returns:
- exact setting or optional absence
- Since:
- 1.0.0
-
toString
-