MCP PHP SDK

ProtectedResourceMetadata implements JsonSerializable

FinalYes

OAuth 2.0 Protected Resource Metadata (RFC 9728).

Tags
see
https://datatracker.ietf.org/doc/html/rfc9728
author

Volodymyr Panivko sveneld300@gmail.com

Table of Contents

Interfaces

JsonSerializable

Constants

DEFAULT_METADATA_PATH  = '/.well-known/oauth-protected-resource'
LOCALIZED_HUMAN_READABLE_FIELD_PATTERN  = '/^(resource_name|resource_documentation|resource_policy_uri|resource_tos_uri)#[A-Za-z0-9-]+$/'

Properties

$authorizationServers  : array<int, string>
$extra  : array<string, mixed>
$localizedHumanReadable  : array<string, string>
$metadataPaths  : array<int, string>
$resource  : string|null
$resourceDocumentation  : string|null
$resourceName  : string|null
$resourcePolicyUri  : string|null
$resourceTosUri  : string|null
$scopesSupported  : array<int, string>|null

Methods

__construct()  : mixed
getMetadataPaths()  : array<int, string>
getPrimaryMetadataPath()  : string
getScopesSupported()  : array<int, string>|null
jsonSerialize()  : array<string, mixed>
normalizeLocalizedHumanReadable()  : array<string, string>
normalizeNullableString()  : string|null
normalizePaths()  : array<int, string>
normalizeStringList()  : array<int, string>

Constants

LOCALIZED_HUMAN_READABLE_FIELD_PATTERN

private mixed LOCALIZED_HUMAN_READABLE_FIELD_PATTERN = '/^(resource_name|resource_documentation|resource_policy_uri|resource_tos_uri)#[A-Za-z0-9-]+$/'

Properties

Methods

__construct()

public __construct(array<int, string> $authorizationServers[, array<int, string>|null $scopesSupported = null ][, string|null $resource = null ][, string|null $resourceName = null ][, string|null $resourceDocumentation = null ][, string|null $resourcePolicyUri = null ][, string|null $resourceTosUri = null ][, array<string, string> $localizedHumanReadable = [] ][, array<string, mixed> $extra = [] ][, array<int, string> $metadataPaths = [self::DEFAULT_METADATA_PATH] ]) : mixed
Parameters
$authorizationServers : array<int, string>
$scopesSupported : array<int, string>|null = null
$resource : string|null = null
$resourceName : string|null = null
$resourceDocumentation : string|null = null
$resourcePolicyUri : string|null = null
$resourceTosUri : string|null = null
$localizedHumanReadable : array<string, string> = []

Locale-specific values, e.g. resource_name#en => "My Resource"

$extra : array<string, mixed> = []

Additional RFC 9728 metadata fields

$metadataPaths : array<int, string> = [self::DEFAULT_METADATA_PATH]

getScopesSupported()

public getScopesSupported() : array<int, string>|null
Return values
array<int, string>|null

normalizeLocalizedHumanReadable()

private normalizeLocalizedHumanReadable(array<string, string> $localizedHumanReadable) : array<string, string>
Parameters
$localizedHumanReadable : array<string, string>
Return values
array<string, string>

normalizeNullableString()

private normalizeNullableString(string|null $value) : string|null
Parameters
$value : string|null
Return values
string|null

normalizePaths()

private normalizePaths(array<int, string> $paths) : array<int, string>
Parameters
$paths : array<int, string>
Return values
array<int, string>

normalizeStringList()

private normalizeStringList(array<int, string> $values, string $parameterName) : array<int, string>
Parameters
$values : array<int, string>
$parameterName : string
Return values
array<int, string>

        
On this page

Search results