Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
oidc_claims.h
1#ifndef SOURCEMETA_CORE_OIDC_CLAIMS_H_
2#define SOURCEMETA_CORE_OIDC_CLAIMS_H_
3
4#ifndef SOURCEMETA_CORE_OIDC_EXPORT
5#include <sourcemeta/core/oidc_export.h>
6#endif
7
8#include <sourcemeta/core/json.h>
9
10#include <functional> // std::function
11#include <optional> // std::optional
12#include <span> // std::span
13#include <string_view> // std::string_view
14
15namespace sourcemeta::core {
16
28SOURCEMETA_CORE_OIDC_EXPORT
29auto oidc_is_standard_claim(const std::string_view name) noexcept -> bool;
30
49SOURCEMETA_CORE_OIDC_EXPORT
50auto oidc_scope_to_claims(const std::string_view scopes,
51 const std::function<void(std::string_view)> &on_claim)
52 -> void;
53
67SOURCEMETA_CORE_OIDC_EXPORT
68auto oidc_claim_to_scope(const std::string_view claim) noexcept
69 -> std::optional<std::string_view>;
70
76 std::string_view name;
78 bool essential{false};
81 const JSON *value{nullptr};
84 std::span<const JSON> values{};
85};
86
105SOURCEMETA_CORE_OIDC_EXPORT
107 const std::span<const OIDCClaimRequest> userinfo_claims,
108 const std::span<const OIDCClaimRequest> id_token_claims) -> JSON;
109
124SOURCEMETA_CORE_OIDC_EXPORT
126 const std::string_view target,
127 const std::string_view claim) -> bool;
128
143SOURCEMETA_CORE_OIDC_EXPORT
145 const std::string_view target,
146 const std::string_view claim) -> bool;
147
163SOURCEMETA_CORE_OIDC_EXPORT
165 const std::string_view target,
166 const std::string_view claim) -> const JSON *;
167
183SOURCEMETA_CORE_OIDC_EXPORT
185 const std::string_view target,
186 const std::string_view claim,
187 const JSON &value) -> bool;
188
206SOURCEMETA_CORE_OIDC_EXPORT
207auto oidc_claim_request_accepts(const JSON &request, const JSON &value) -> bool;
208
209} // namespace sourcemeta::core
210
211#endif
Definition json_value.h:39
std::span< const JSON > values
Definition oidc_claims.h:84
std::string_view name
The requested claim name.
Definition oidc_claims.h:76
bool essential
Whether the claim is essential (OpenID Connect Core 1.0 Section 5.5.1).
Definition oidc_claims.h:78
const JSON * value
Definition oidc_claims.h:81
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_claims_parameter_requests(const JSON &claims, const std::string_view target, const std::string_view claim) -> bool
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_scope_to_claims(const std::string_view scopes, const std::function< void(std::string_view)> &on_claim) -> void
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_build_claims_parameter(const std::span< const OIDCClaimRequest > userinfo_claims, const std::span< const OIDCClaimRequest > id_token_claims) -> JSON
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_claim_request_accepts(const JSON &request, const JSON &value) -> bool
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_claims_parameter_is_essential(const JSON &claims, const std::string_view target, const std::string_view claim) -> bool
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_is_standard_claim(const std::string_view name) noexcept -> bool
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_claims_parameter_value(const JSON &claims, const std::string_view target, const std::string_view claim) -> const JSON *
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_claims_parameter_accepts(const JSON &claims, const std::string_view target, const std::string_view claim, const JSON &value) -> bool
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_claim_to_scope(const std::string_view claim) noexcept -> std::optional< std::string_view >
Definition oidc_claims.h:74