Record Class McpProtectedResourceMetadata

java.lang.Object
java.lang.Record
org.apache.juneau.rest.client.mcp.auth.McpProtectedResourceMetadata
Record Components:
resource - The resource identifier (the canonical URI of the protected MCP server). Never null.
authorizationServers - The authorization_servers issuer URIs, in document order. May be empty.
scopesSupported - The scopes_supported values, in document order. May be empty.
extras - Unknown / server-specific fields. Read-only map.

public record McpProtectedResourceMetadata(URI resource, List<URI> authorizationServers, Set<String> scopesSupported, Map<String,Object> extras) extends Record
Immutable view of an RFC 9728 Protected Resource Metadata (PRM) document, as an MCP client consumes it to discover which authorization server(s) protect a given MCP server.

Only the fields the client needs are surfaced; unknown fields are preserved in extras().

See Also:
Since:
10.0.0
  • Constructor Details

  • Method Details

    • firstAuthorizationServer

      Returns the first advertised authorization server, if any.

      Per RFC 9728 §7.6 the client selects the authorization server; selecting the first entry is compliant and no mandatory alternate-AS fallback is required.

      Returns:
      The first authorization-server issuer URI, or Optional.empty() if none are advertised.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • resource

      public URI resource()
      Returns the value of the resource record component.
      Returns:
      the value of the resource record component
    • authorizationServers

      Returns the value of the authorizationServers record component.
      Returns:
      the value of the authorizationServers record component
    • scopesSupported

      Returns the value of the scopesSupported record component.
      Returns:
      the value of the scopesSupported record component
    • extras

      public Map<String,Object> extras()
      Returns the value of the extras record component.
      Returns:
      the value of the extras record component