Class ProtectedResourceMetadata

java.lang.Object
com.revetsec.oauth.ProtectedResourceMetadata

@Immutable public final class ProtectedResourceMetadata extends Object
Application-configured protected-resource metadata (RFC 9728 sections 2 and 3). The resource identifier is preserved exactly, including its raw path/query; no URI normalization or I/O occurs. The app serves toJson() as application/json and chooses cache policy. This metadata grants no permission.
Since:
1.0.0
Author:
Mark Allen
  • Method Details

    • withResource

      Starts metadata for an exact configured resource identifier.
      Parameters:
      resource - the resource URI; HTTPS is required unless loopback HTTP is explicitly allowed
      Returns:
      the builder
      Throws:
      NullPointerException - if resource is null
      Since:
      1.0.0
    • getResource

      Returns the exact configured resource identifier.
      Returns:
      the resource
      Since:
      1.0.0
    • getAuthorizationServers

      Returns exact authorization-server issuer strings in configured order, without duplicates.
      Returns:
      immutable issuer strings
      Since:
      1.0.0
    • getScopesSupported

      Returns supported scope tokens in first-occurrence order.
      Returns:
      immutable scopes
      Since:
      1.0.0
    • getWellKnownUri

      Derives the RFC 9728 well-known location using raw components and stripping a terminating literal path slash. The configured resource identifier is unchanged, including percent escapes, dot segments and query.
      Returns:
      the metadata URI
      Since:
      1.0.0
    • toJson

      Returns bounded compact JSON advertising only header bearer presentation. Empty optional arrays are omitted.
      Returns:
      the JSON text, at most 256 KiB in UTF-8
      Since:
      1.0.0
    • toString

      Redacts metadata configuration from diagnostic text.
      Overrides:
      toString in class Object
      Returns:
      the redacted description
      Since:
      1.0.0