Class OAuthClientMetadataPolicy
java.lang.Object
com.revetsec.oauth.server.OAuthClientMetadataPolicy
Immutable opt-in configuration for public client metadata documents.
The default is disabled. Enabling requires a trusted bounded address resolver and an explicitly
selected cache backend. Select
InMemoryOAuthClientMetadataCache for bounded volatile,
single-process storage, or supply an application-owned shared implementation. No build performs
DNS, HTTP, signing, provider calls or thread creation. This policy is configuration, not client
authorization or evidence of identity. Retrieved client names are untrusted display text.
Origin restrictions can narrow public HTTPS eligibility, never permit private destinations.
Actual retrieval also requires Revetsec's pinned transport and complete operation admission.- Since:
- 1.0.0
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds an enabled policy; null property values reset defaults, except resolver and cache null clear required properties. -
Method Summary
Modifier and TypeMethodDescriptionReturns the disabled default configuration.fromAddressResolverAndCache(@NonNull OAuthClientMetadataAddressResolver addressResolver, @NonNull OAuthClientMetadataCache cache) Builds an enabled policy with an explicit resolver and cache, without callbacks or I/O.Returns the required resolver when enabled.Returns the exact origin restriction snapshot.getCache()Returns the explicitly selected storage.Returns whether metadata retrieval is configured.Returns the configured bound on active metadata fetches.Returns the configured bytes bound for maximumDocumentBytes.Returns the configured time bound for maximumFreshness.Returns the configured addresses bound for maximumResolvedAddresses.toString()withAddressResolver(@NonNull OAuthClientMetadataAddressResolver addressResolver) Starts an enabled policy with its required trusted resolver.
-
Method Details
-
disabledInstance
Returns the disabled default configuration.- Returns:
- the disabled policy
- Since:
- 1.0.0
-
withAddressResolver
@CheckReturnValue public static @NonNull OAuthClientMetadataPolicy.Builder withAddressResolver(@NonNull OAuthClientMetadataAddressResolver addressResolver) Starts an enabled policy with its required trusted resolver. Select the cache withOAuthClientMetadataPolicy.Builder.cache(OAuthClientMetadataCache)before building.- Parameters:
addressResolver- the bounded resolver- Returns:
- the builder
- Throws:
NullPointerException- if addressResolver is null- Since:
- 1.0.0
-
fromAddressResolverAndCache
@CheckReturnValue public static @NonNull OAuthClientMetadataPolicy fromAddressResolverAndCache(@NonNull OAuthClientMetadataAddressResolver addressResolver, @NonNull OAuthClientMetadataCache cache) Builds an enabled policy with an explicit resolver and cache, without callbacks or I/O.- Parameters:
addressResolver- the bounded resolvercache- the explicitly selected storage backend- Returns:
- the enabled policy
- Throws:
NullPointerException- if either required argument is null- Since:
- 1.0.0
-
getEnabled
Returns whether metadata retrieval is configured.- Returns:
- the enabled flag, not a transport availability or authorization proof
- Since:
- 1.0.0
-
getAddressResolver
Returns the required resolver when enabled.- Returns:
- empty only for the disabled policy
- Since:
- 1.0.0
-
getCache
Returns the explicitly selected storage. Reusing this policy reuses that same backend; a process-local backend remains local even when multiple engines share it. The backend owns capacity and eviction policy; no engine substitutes an implicit in-memory implementation.- Returns:
- the configured storage, or empty only for the disabled policy
- Since:
- 1.0.0
-
getAllowedOrigins
-
getMaximumDocumentBytes
Returns the configured bytes bound for maximumDocumentBytes.- Returns:
- the configured limit
- Since:
- 1.0.0
-
getMaximumFreshness
Returns the configured time bound for maximumFreshness.- Returns:
- the configured limit
- Since:
- 1.0.0
-
getMaximumConcurrentFetches
Returns the configured bound on active metadata fetches. Callers wait interruptibly within the original operation deadline. When the bound is at least two, authorization requests cannot occupy the final slot reserved for locally eligible credential transitions. Applications bound incoming concurrency.- Returns:
- the configured limit
- Since:
- 1.0.0
-
getMaximumResolvedAddresses
Returns the configured addresses bound for maximumResolvedAddresses.- Returns:
- the configured limit
- Since:
- 1.0.0
-
toString
-