1#ifndef SOURCEMETA_CORE_OAUTH_REGISTRATION_H_
2#define SOURCEMETA_CORE_OAUTH_REGISTRATION_H_
4#ifndef SOURCEMETA_CORE_OAUTH_EXPORT
5#include <sourcemeta/core/oauth_export.h>
8#include <sourcemeta/core/json.h>
15namespace sourcemeta::core {
18#pragma warning(disable : 4251)
62 -> std::optional<OAuthClientMetadata>;
83 [[nodiscard]] auto
client_name() const -> std::optional<std::string_view>;
86 [[nodiscard]] auto
client_uri() const -> std::optional<std::string_view>;
89 [[nodiscard]] auto
logo_uri() const -> std::optional<std::string_view>;
92 [[nodiscard]] auto
scope() const -> std::optional<std::string_view>;
95 [[nodiscard]] auto
has_contact(const std::string_view value) const ->
bool;
98 [[nodiscard]] auto
tos_uri() const -> std::optional<std::string_view>;
101 [[nodiscard]] auto
policy_uri() const -> std::optional<std::string_view>;
104 [[nodiscard]] auto
jwks_uri() const -> std::optional<std::string_view>;
108 [[nodiscard]] auto
software_id() const -> std::optional<std::string_view>;
112 -> std::optional<std::string_view>;
117 -> std::optional<std::string_view>;
121 [[nodiscard]] auto
client_id() const -> std::optional<std::string_view>;
125 [[nodiscard]] auto
client_secret() const -> std::optional<std::string_view>;
130 -> std::optional<std::chrono::seconds>;
135 -> std::optional<std::chrono::seconds>;
140 -> std::optional<std::string_view>;
145 -> std::optional<std::string_view>;
155#pragma warning(default : 4251)
226[[nodiscard]] SOURCEMETA_CORE_OAUTH_EXPORT
auto
228 -> std::optional<JSON>;
246[[nodiscard]] SOURCEMETA_CORE_OAUTH_EXPORT
auto
248 const std::string_view error_description)
275[[nodiscard]] SOURCEMETA_CORE_OAUTH_EXPORT
auto
305[[nodiscard]] SOURCEMETA_CORE_OAUTH_EXPORT
auto
360[[nodiscard]] SOURCEMETA_CORE_OAUTH_EXPORT
auto
363 -> std::optional<JSON>;
392[[nodiscard]] SOURCEMETA_CORE_OAUTH_EXPORT
auto
395 const std::string_view client_id,
const std::string_view client_secret)
396 -> std::optional<JSON>;
std::string_view client_uri
The client information page (RFC 7591 Section 2).
Definition oauth_registration.h:176
std::string_view jwks_uri
Definition oauth_registration.h:189
auto supports_response_type(const std::string_view value) const -> bool
std::span< const std::string_view > contacts
The ways to contact those responsible for the client (RFC 7591 Section 2).
Definition oauth_registration.h:182
std::string_view policy_uri
The privacy policy page (RFC 7591 Section 2).
Definition oauth_registration.h:186
auto data() const -> const JSON &
The underlying document, for reaching members without a typed accessor.
auto logo_uri() const -> std::optional< std::string_view >
The client logo location (RFC 7591 Section 2).
auto has_redirect_uri(const std::string_view value) const -> bool
Whether a redirection URI is registered (RFC 7591 Section 2).
std::string_view registration_client_uri
Definition oauth_registration.h:332
std::string_view software_version
The client software version (RFC 7591 Section 2).
Definition oauth_registration.h:197
static auto from(JSON &&data) -> std::optional< OAuthClientMetadata >
auto client_secret() const -> std::optional< std::string_view >
auto client_secret_expires_at() const -> std::optional< std::chrono::seconds >
std::span< const std::string_view > redirect_uris
Definition oauth_registration.h:165
std::string_view software_id
The client software identifier (RFC 7591 Section 2).
Definition oauth_registration.h:195
std::string_view logo_uri
The client logo location (RFC 7591 Section 2).
Definition oauth_registration.h:178
std::optional< std::chrono::seconds > client_id_issued_at
The time the client identifier was issued (RFC 7591 Section 3.2.1).
Definition oauth_registration.h:322
std::span< const std::string_view > grant_types
The grant types the client will use (RFC 7591 Section 2).
Definition oauth_registration.h:170
auto client_id() const -> std::optional< std::string_view >
std::span< const std::string_view > response_types
The response types the client will use (RFC 7591 Section 2).
Definition oauth_registration.h:172
auto client_name() const -> std::optional< std::string_view >
The human-readable client name (RFC 7591 Section 2).
auto token_endpoint_auth_method() const -> std::string_view
auto client_uri() const -> std::optional< std::string_view >
The client information page (RFC 7591 Section 2).
std::string_view client_id
The issued client identifier (RFC 7591 Section 3.2.1), REQUIRED.
Definition oauth_registration.h:317
auto has_contact(const std::string_view value) const -> bool
Whether a contact is listed (RFC 7591 Section 2).
auto scope() const -> std::optional< std::string_view >
The space-separated scopes the client may request (RFC 7591 Section 2).
auto registration_access_token() const -> std::optional< std::string_view >
auto client_id_issued_at() const -> std::optional< std::chrono::seconds >
auto jwks_uri() const -> std::optional< std::string_view >
The JWK Set document location for the client's keys (RFC 7591 Section 2).
std::optional< std::chrono::seconds > client_secret_expires_at
Definition oauth_registration.h:325
std::string_view token_endpoint_auth_method
Definition oauth_registration.h:168
auto tos_uri() const -> std::optional< std::string_view >
The terms of service page (RFC 7591 Section 2).
std::string_view registration_access_token
Definition oauth_registration.h:329
auto supports_grant_type(const std::string_view value) const -> bool
OAuthClientMetadata(JSON &&data)
std::string_view scope
The space-separated scopes the client may request (RFC 7591 Section 2).
Definition oauth_registration.h:180
auto registration_client_uri() const -> std::optional< std::string_view >
std::string_view client_name
The human-readable client name (RFC 7591 Section 2).
Definition oauth_registration.h:174
std::string_view software_statement
The software statement asserting the metadata (RFC 7591 Section 2.3).
Definition oauth_registration.h:199
std::string_view tos_uri
The terms of service page (RFC 7591 Section 2).
Definition oauth_registration.h:184
std::string_view client_secret
Definition oauth_registration.h:320
auto software_statement() const -> std::optional< std::string_view >
auto software_id() const -> std::optional< std::string_view >
auto software_version() const -> std::optional< std::string_view >
The client software version (RFC 7591 Section 2).
auto policy_uri() const -> std::optional< std::string_view >
The privacy policy page (RFC 7591 Section 2).
const JSON * jwks
Definition oauth_registration.h:193
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_make_registration_update_request(const OAuthClientRegistrationConfig &config, const std::string_view client_id, const std::string_view client_secret) -> std::optional< JSON >
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_make_registration_request(const OAuthClientRegistrationConfig &config) -> std::optional< JSON >
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_make_registration_error_response(const std::string_view error, const std::string_view error_description) -> JSON
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_registration_grant_response_consistent(const OAuthClientMetadata &metadata) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_apply_software_statement_claims(JSON &metadata, const JSON &claims) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_make_registration_response(const JSON &metadata, const OAuthClientRegistrationResult &result) -> std::optional< JSON >