1#ifndef SOURCEMETA_CORE_OAUTH_METADATA_H_
2#define SOURCEMETA_CORE_OAUTH_METADATA_H_
4#ifndef SOURCEMETA_CORE_OAUTH_EXPORT
5#include <sourcemeta/core/oauth_export.h>
8#include <sourcemeta/core/json.h>
16namespace sourcemeta::core {
58SOURCEMETA_CORE_OAUTH_EXPORT
79SOURCEMETA_CORE_OAUTH_EXPORT
98SOURCEMETA_CORE_OAUTH_EXPORT
117SOURCEMETA_CORE_OAUTH_EXPORT
121#pragma warning(disable : 4251)
161 -> std::optional<OAuthServerMetadata>;
164 [[nodiscard]]
auto issuer() const -> std::string_view;
168 -> std::optional<std::string_view>;
175 -> std::optional<std::string_view>;
179 -> std::optional<std::string_view>;
183 -> std::optional<std::string_view>;
187 -> std::optional<std::string_view>;
190 [[nodiscard]] auto
jwks_uri() const -> std::optional<std::string_view>;
194 -> std::optional<std::string_view>;
277 -> std::optional<OAuthResourceMetadata>;
280 [[nodiscard]]
auto resource() const -> std::string_view;
286 -> std::optional<std::string_view>;
294 [[nodiscard]] auto
jwks_uri() const -> std::optional<std::string_view>;
312 [[nodiscard]] auto
resource_name() const -> std::optional<std::string_view>;
316 -> std::optional<std::string_view>;
320 -> std::optional<std::string_view>;
324 -> std::optional<std::string_view>;
355#pragma warning(default : 4251)
386 std::span<const std::string_view>
430SOURCEMETA_CORE_OAUTH_EXPORT
432 -> std::optional<JSON>;
511SOURCEMETA_CORE_OAUTH_EXPORT
513 -> std::optional<JSON>;
auto supports_authorization_server(const std::string_view value) const -> bool
Whether an authorization server issuer is listed (RFC 9728 Section 2).
auto require_pushed_authorization_requests() const -> bool
auto resource_name() const -> std::optional< std::string_view >
std::span< const std::string_view > authorization_details_types_supported
The supported authorization details types (RFC 9728 Section 2).
Definition oauth_metadata.h:476
auto supports_protected_resource(const std::string_view value) const -> bool
auto resource_documentation() const -> std::optional< std::string_view >
The developer documentation page location (RFC 9728 Section 2).
std::span< const std::string_view > token_endpoint_auth_methods_supported
The supported token endpoint authentication methods (RFC 8414 Section 2).
Definition oauth_metadata.h:381
auto revocation_endpoint() const -> std::optional< std::string_view >
The token revocation endpoint (RFC 8414 Section 2).
auto dpop_bound_access_tokens_required() const -> bool
bool require_pushed_authorization_requests
Definition oauth_metadata.h:397
std::span< const std::string_view > token_endpoint_auth_signing_alg_values_supported
Definition oauth_metadata.h:387
std::string_view resource_policy_uri
The data usage policy page location (RFC 9728 Section 2).
Definition oauth_metadata.h:468
auto data() const -> const JSON &
std::span< const std::string_view > grant_types_supported
The supported grant types (RFC 8414 Section 2).
Definition oauth_metadata.h:377
std::string_view resource_documentation
The developer documentation page location (RFC 9728 Section 2).
Definition oauth_metadata.h:466
auto data() const -> const JSON &
The underlying document, for reaching members without a typed accessor.
auto tls_client_certificate_bound_access_tokens() const -> bool
std::string_view authorization_endpoint
The authorization endpoint (RFC 8414 Section 2).
Definition oauth_metadata.h:367
auto token_endpoint() const -> std::optional< std::string_view >
The token endpoint (RFC 8414 Section 2).
auto registration_endpoint() const -> std::optional< std::string_view >
The dynamic client registration endpoint (RFC 8414 Section 2).
bool tls_client_certificate_bound_access_tokens
Definition oauth_metadata.h:474
auto issuer() const -> std::string_view
The issuer identifier (RFC 8414 Section 2).
auto jwks_uri() const -> std::optional< std::string_view >
auto supports_grant_type(const std::string_view value) const -> bool
auto supports_scope(const std::string_view value) const -> bool
Whether a scope is listed for the resource (RFC 9728 Section 2).
auto introspection_endpoint() const -> std::optional< std::string_view >
The token introspection endpoint (RFC 8414 Section 2).
auto supports_bearer_method(const std::string_view value) const -> bool
auto jwks_uri() const -> std::optional< std::string_view >
The JWK Set document location (RFC 8414 Section 2).
auto resource() const -> std::string_view
The resource identifier (RFC 9728 Section 2).
auto resource_tos_uri() const -> std::optional< std::string_view >
The terms of service page location (RFC 9728 Section 2).
std::span< const std::string_view > response_types_supported
The supported response types (RFC 8414 Section 2), REQUIRED and non-empty.
Definition oauth_metadata.h:375
bool dpop_bound_access_tokens_required
Definition oauth_metadata.h:483
std::string_view jwks_uri
Definition oauth_metadata.h:450
std::span< const std::string_view > authorization_servers
Definition oauth_metadata.h:447
auto supports_code_challenge_method(const std::string_view value) const -> bool
std::string_view resource
The resource identifier (RFC 9728 Section 2), REQUIRED.
Definition oauth_metadata.h:444
auto authorization_endpoint() const -> std::optional< std::string_view >
The authorization endpoint (RFC 8414 Section 2).
std::span< const std::string_view > scopes_supported
Definition oauth_metadata.h:453
std::string_view issuer
The issuer identifier (RFC 8414 Section 2), REQUIRED.
Definition oauth_metadata.h:365
std::string_view jwks_uri
The JWK Set document location (RFC 8414 Section 2).
Definition oauth_metadata.h:373
auto supports_response_type(const std::string_view value) const -> bool
Whether a response type is supported (RFC 8414 Section 2).
OAuthServerMetadata(JSON &&data, const std::string_view issuer)
auto first_authorization_server() const -> std::optional< std::string_view >
static auto from(JSON &&data, const std::string_view issuer) -> std::optional< OAuthServerMetadata >
std::string_view resource_name
Definition oauth_metadata.h:464
std::span< const std::string_view > resource_signing_alg_values_supported
Definition oauth_metadata.h:460
std::string_view registration_endpoint
The dynamic client registration endpoint (RFC 8414 Section 2).
Definition oauth_metadata.h:371
std::string_view pushed_authorization_request_endpoint
Definition oauth_metadata.h:393
auto resource_policy_uri() const -> std::optional< std::string_view >
The data usage policy page location (RFC 9728 Section 2).
auto pushed_authorization_request_endpoint() const -> std::optional< std::string_view >
The pushed authorization request endpoint (RFC 9126 Section 5).
auto authorization_response_iss_parameter_supported() const -> bool
std::string_view token_endpoint
The token endpoint (RFC 8414 Section 2).
Definition oauth_metadata.h:369
auto device_authorization_endpoint() const -> std::optional< std::string_view >
The device authorization endpoint (RFC 8628 Section 4).
auto supports_dpop_signing_alg(const std::string_view value) const -> bool
OAuthResourceMetadata(JSON &&data, const std::string_view resource)
std::string_view resource_tos_uri
The terms of service page location (RFC 9728 Section 2).
Definition oauth_metadata.h:470
std::span< const std::string_view > protected_resources
Definition oauth_metadata.h:400
std::optional< std::span< const std::string_view > > bearer_methods_supported
Definition oauth_metadata.h:457
std::span< const std::string_view > code_challenge_methods_supported
The supported PKCE code challenge methods (RFC 8414 Section 2, RFC 7636).
Definition oauth_metadata.h:379
auto supports_authorization_details_type(const std::string_view value) const -> bool
static auto from(JSON &&data, const std::string_view resource) -> std::optional< OAuthResourceMetadata >
auto supports_token_endpoint_auth_method(const std::string_view value) const -> bool
std::span< const std::string_view > dpop_signing_alg_values_supported
Definition oauth_metadata.h:480
auto supports_resource_signing_alg(const std::string_view value) const -> bool
std::span< const std::string_view > scopes_supported
The supported scopes (RFC 8414 Section 2).
Definition oauth_metadata.h:389
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_make_server_metadata(const OAuthServerMetadataConfig &config) -> std::optional< JSON >
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_is_resource_identifier(const std::string_view value) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_make_resource_metadata(const OAuthResourceMetadataConfig &config) -> std::optional< JSON >
OAuthWellKnownKind
Definition oauth_metadata.h:21
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_is_endpoint_url(const std::string_view value) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_is_issuer_identifier(const std::string_view value) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_well_known_url(const std::string_view identifier, const OAuthWellKnownKind kind, std::string &sink) -> bool
@ OpenIDConfigurationAppended
Definition oauth_metadata.h:33
@ AuthorizationServer
Definition oauth_metadata.h:24
@ OpenIDConfigurationInserted
Definition oauth_metadata.h:30
@ ProtectedResource
Definition oauth_metadata.h:27