Class BearerChallenge.Builder
java.lang.Object
com.revetsec.oauth.BearerChallenge.Builder
- Enclosing class:
BearerChallenge
Mutable challenge configuration. Null property values restore omission or the documented default.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionPermits plain HTTP only to an existing recognized loopback literal or exactly localhost, for local tests.build()Builds the field without I/O.error(@Nullable BearerError value) Sets the protocol error.errorDescription(@Nullable String value) Sets trusted ASCII prose satisfying RFC 6750's error_description grammar; quotes/backslashes are invalid.maximumHeaderLength(@Nullable Integer value) Sets the rendered ASCII field byte limit, including quote/backslash expansion.Sets a quoted ASCII realm.resourceMetadata(@Nullable URI value) Sets the trusted resource metadata location.Replaces required scopes, preserving first-occurrence order and removing duplicates.
-
Method Details
-
realm
Sets a quoted ASCII realm. Quote/backslash are escaped; controls and non-ASCII are rejected.- Parameters:
value- the realm, or null to omit- Returns:
- this builder
- Since:
- 1.0.0
-
error
Sets the protocol error. Omit for an initial missing-credential challenge.- Parameters:
value- the error, or null to omit- Returns:
- this builder
- Since:
- 1.0.0
-
errorDescription
Sets trusted ASCII prose satisfying RFC 6750's error_description grammar; quotes/backslashes are invalid.- Parameters:
value- the description, or null to omit- Returns:
- this builder
- Since:
- 1.0.0
-
scopes
-
resourceMetadata
Sets the trusted resource metadata location. HTTPS is required except explicit loopback HTTP.- Parameters:
value- the metadata URI, or null to omit- Returns:
- this builder
- Since:
- 1.0.0
-
maximumHeaderLength
Sets the rendered ASCII field byte limit, including quote/backslash expansion.- Parameters:
value- the limit from 1 KiB through 64 KiB, or null to restore 8 KiB- Returns:
- this builder
- Since:
- 1.0.0
-
allowInsecureLoopback
Permits plain HTTP only to an existing recognized loopback literal or exactly localhost, for local tests.- Parameters:
value- whether to allow local HTTP, or null to restore false- Returns:
- this builder
- Since:
- 1.0.0
-
build
Builds the field without I/O.- Returns:
- the immutable challenge
- Throws:
IllegalStateException- if no parameter would be renderedIllegalArgumentException- if the supplied configuration is incompatible, unsafe or oversized- Since:
- 1.0.0
-