using System.Text.Json.Serialization; namespace ModelContextProtocol.TestOAuthServer; /// /// Represents the authorization server metadata for OAuth discovery. /// internal sealed class AuthorizationServerMetadata { /// /// Gets or sets the issuer URL. /// [JsonPropertyName("issuer")] public required Uri Issuer { get; init; } /// /// Gets or sets the authorization endpoint URL. /// [JsonPropertyName("authorization_endpoint")] public required Uri AuthorizationEndpoint { get; init; } /// /// Gets or sets the token endpoint URL. /// [JsonPropertyName("token_endpoint")] public required Uri TokenEndpoint { get; init; } /// /// Gets the introspection endpoint URL. /// [JsonPropertyName("introspection_endpoint")] public Uri? IntrospectionEndpoint => new($"{Issuer}/introspect"); /// /// Gets or sets the response types supported by this server. /// [JsonPropertyName("response_types_supported")] public required List ResponseTypesSupported { get; init; } /// /// Gets or sets the grant types supported by this server. /// [JsonPropertyName("grant_types_supported")] public required List GrantTypesSupported { get; init; } /// /// Gets or sets the token endpoint authentication methods supported by this server. /// [JsonPropertyName("token_endpoint_auth_methods_supported")] public required List TokenEndpointAuthMethodsSupported { get; init; } /// /// Gets or sets the code challenge methods supported by this server. /// [JsonPropertyName("code_challenge_methods_supported")] public required List CodeChallengeMethodsSupported { get; init; } /// /// Gets or sets the scopes supported by this server. /// [JsonPropertyName("scopes_supported")] public List? ScopesSupported { get; init; } /// /// Gets or sets a value indicating whether CIMD client IDs are supported. /// [JsonPropertyName("client_id_metadata_document_supported")] public bool ClientIdMetadataDocumentSupported { get; init; } }