Class ProtectedResourceMetadata.Builder
java.lang.Object
com.revetsec.oauth.ProtectedResourceMetadata.Builder
- Enclosing class:
ProtectedResourceMetadata
@NotThreadSafe
@CheckReturnValue
public static final class ProtectedResourceMetadata.Builder
extends Object
Mutable metadata configuration. Null optional values restore the empty/false defaults.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionPermits plain HTTP only to a recognized loopback literal or exactly localhost for local tests.authorizationServers(@Nullable List<@NonNull String> value) Replaces exact issuer identifiers.build()Checks URI policy and renders bounded metadata without I/O.scopesSupported(@Nullable List<@NonNull String> value) Replaces supported scope tokens, preserving first occurrence order and removing duplicates.
-
Method Details
-
authorizationServers
public @NonNull ProtectedResourceMetadata.Builder authorizationServers(@Nullable List<@NonNull String> value) Replaces exact issuer identifiers. Uses the default outbound URI checks; queries are also invalid.- Parameters:
value- issuer strings, or null/empty to omit- Returns:
- this builder
- Since:
- 1.0.0
-
scopesSupported
public @NonNull ProtectedResourceMetadata.Builder scopesSupported(@Nullable List<@NonNull String> value) Replaces supported scope tokens, preserving first occurrence order and removing duplicates.- Parameters:
value- scope tokens, or null/empty to omit- Returns:
- this builder
- Since:
- 1.0.0
-
allowInsecureLoopback
Permits plain HTTP only to a recognized loopback literal or exactly localhost for local tests.- Parameters:
value- whether to allow loopback HTTP, or null to restore false- Returns:
- this builder
- Since:
- 1.0.0
-
build
Checks URI policy and renders bounded metadata without I/O. Builders can be reused.- Returns:
- immutable metadata
- Throws:
IllegalArgumentException- if configuration is unsafe or serialized JSON exceeds 256 KiB- Since:
- 1.0.0
-