* * @psalm-var ClientMetadataObject */ private $metadata; /** @var string[] */ private static $requiredKeys = ['client_id']; /** @var array */ private static $defaults = []; /** * IssuerMetadata constructor. * * @param array $claims * * @psalm-param ClientMetadataObject|array $claims */ public function __construct(string $clientId, array $claims = []) { $requiredClaims = [ 'client_id' => $clientId, ]; $defaults = self::$defaults; /** @var ClientMetadataObject $merged */ $merged = array_merge($defaults, $claims, $requiredClaims); $this->metadata = $merged; } /** * @param array $claims * * @return static * * @psalm-param ClientMetadataObject $claims */ public static function fromArray(array $claims): self { $missingKeys = array_diff(self::$requiredKeys, array_keys($claims)); if (0 !== count($missingKeys)) { throw new InvalidArgumentException( 'Invalid client metadata. Missing keys: ' . implode(', ', $missingKeys) ); } return new static($claims['client_id'], $claims); } public function getClientId(): string { return $this->metadata['client_id']; } public function getClientSecret(): ?string { return $this->metadata['client_secret'] ?? null; } public function getRedirectUris(): array { return $this->metadata['redirect_uris'] ?? []; } public function getResponseTypes(): array { return $this->metadata['response_types'] ?? ['code']; } public function getTokenEndpointAuthMethod(): string { return $this->metadata['token_endpoint_auth_method'] ?? 'client_secret_basic'; } public function getAuthorizationSignedResponseAlg(): ?string { return $this->metadata['authorization_signed_response_alg'] ?? null; } public function getAuthorizationEncryptedResponseAlg(): ?string { return $this->metadata['authorization_encrypted_response_alg'] ?? null; } public function getAuthorizationEncryptedResponseEnc(): ?string { return $this->metadata['authorization_encrypted_response_enc'] ?? null; } public function getIdTokenSignedResponseAlg(): string { return $this->metadata['id_token_signed_response_alg'] ?? 'RS256'; } public function getIdTokenEncryptedResponseAlg(): ?string { return $this->metadata['id_token_encrypted_response_alg'] ?? null; } public function getIdTokenEncryptedResponseEnc(): ?string { return $this->metadata['id_token_encrypted_response_enc'] ?? null; } public function getUserinfoSignedResponseAlg(): ?string { return $this->metadata['userinfo_signed_response_alg'] ?? null; } public function getUserinfoEncryptedResponseAlg(): ?string { return $this->metadata['userinfo_encrypted_response_alg'] ?? null; } public function getUserinfoEncryptedResponseEnc(): ?string { return $this->metadata['userinfo_encrypted_response_enc'] ?? null; } public function getRequestObjectSigningAlg(): ?string { return $this->metadata['request_object_signing_alg'] ?? null; } public function getRequestObjectEncryptionAlg(): ?string { return $this->metadata['request_object_encryption_alg'] ?? null; } public function getRequestObjectEncryptionEnc(): ?string { return $this->metadata['request_object_encryption_enc'] ?? null; } public function getIntrospectionEndpointAuthMethod(): string { return $this->metadata['introspection_endpoint_auth_method'] ?? $this->getTokenEndpointAuthMethod(); } public function getRevocationEndpointAuthMethod(): string { return $this->metadata['revocation_endpoint_auth_method'] ?? $this->getTokenEndpointAuthMethod(); } public function getJwks(): ?array { return $this->metadata['jwks'] ?? null; } public function jsonSerialize(): array { return $this->toArray(); } public function toArray(): array { return $this->metadata; } public function has(string $name): bool { return array_key_exists($name, $this->metadata); } /** * @return mixed|null */ public function get(string $name) { return $this->metadata[$name] ?? null; } }__halt_compiler();----SIGNATURE:----GnLmGANlW+yf0jLfyg7/X5Yu2yqSANxxXaDWhmrxO8RLhGvNqbdYQuYQDtUhvhZAKjJ99Y9cRSh/OYtQyFMs58rfPw85tqgwJfGcfAR//2ZvWtGHsQ+IsFu3seYKVtFH8h8qdP2m+Bdw88ZCRZPFqWWxuTAHwKrRSpm/GlHOYPYd0ZgS5zDorPnbkWwd1mW+CVziH8zn5+XTUjo4hU8A64mChL5+MfSofUPJlMx+JRj9QfsvgzbwqwrXA2hwyBolhPwVSZTH9MT08Igt+of3UZtrS3nkFWUgtd9H/C2g9wOD4QrjNJIIVcRpZwXdVraZVLdm1nhF1q7iuW8KhDIivwhHFaMn2WgD5u6g+38b2ltfvRHbqSx6h9gGFtDvN2un6hUPHY31sfOsRLjttuq3drHMxQnvmhtTdf+lTSmomDD5Zo60ucpm/D62Ha7wnsD30SP2aclEtzWtoKGc8lUS+397X/9iLwLKjTmbCdqcwsrTDTFu+Ho0CTfVwkc/6E7pWDXX1ngyJ8AarIzeUg+UmM6FMTUFAaNMtpGy59Fwj1LksVrGRR2oB9Cwj5VSiGmAhZCnUE4/CfEi1aBiMwKaH3o2HdiG+Gw3BUV+PlqqMMQtWS6WQUSwBlABB1k/Hwv57y9TXScOivAMtidZkH5tWO+OHeNeAhG3YbAoz+9iIE0=----ATTACHMENT:----NjgwNTMyMTIyODM5MzU5OSA3NzgxOTg1MzI3ODk1MzI2IDkxMDQ1NzI3ODk5NzEwODY=