Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
oauth_bearer.h
1#ifndef SOURCEMETA_CORE_OAUTH_BEARER_H_
2#define SOURCEMETA_CORE_OAUTH_BEARER_H_
3
4#ifndef SOURCEMETA_CORE_OAUTH_EXPORT
5#include <sourcemeta/core/oauth_export.h>
6#endif
7
8#include <sourcemeta/core/json.h>
9
10#include <optional> // std::optional
11#include <string> // std::string
12#include <string_view> // std::string_view
13
14namespace sourcemeta::core {
15
31SOURCEMETA_CORE_OAUTH_EXPORT
32auto oauth_bearer_header(const std::string_view token, std::string &sink)
33 -> bool;
34
53SOURCEMETA_CORE_OAUTH_EXPORT
54auto oauth_challenge_parameter(const std::string_view header,
55 const std::string_view scheme,
56 const std::string_view name)
57 -> std::optional<std::string>;
58
66 std::string_view realm;
68 std::string_view scope;
70 std::string_view error;
72 std::string_view error_description;
74 std::string_view error_uri;
77 std::string_view resource_metadata;
80 std::string_view algs;
81};
82
111SOURCEMETA_CORE_OAUTH_EXPORT
112auto oauth_build_challenge(const std::string_view scheme,
113 const OAuthChallenge &challenge, std::string &sink)
114 -> bool;
115
135SOURCEMETA_CORE_OAUTH_EXPORT
136auto oauth_has_audience(const JSON &claims, const std::string_view audience)
137 -> bool;
138
157SOURCEMETA_CORE_OAUTH_EXPORT
158auto oauth_has_scope(const JSON &claims, const std::string_view value) -> bool;
159
179SOURCEMETA_CORE_OAUTH_EXPORT
180auto oauth_is_dpop_bound(const JSON &claims) -> bool;
181
182} // namespace sourcemeta::core
183
184#endif
Definition json_value.h:39
std::string_view error_description
The human-readable error description (RFC 6750 Section 3).
Definition oauth_bearer.h:72
std::string_view error_uri
The URI of a human-readable error page (RFC 6750 Section 3).
Definition oauth_bearer.h:74
std::string_view error
The error code (RFC 6750 Section 3.1).
Definition oauth_bearer.h:70
std::string_view algs
Definition oauth_bearer.h:80
std::string_view scope
The space-delimited scope the token must carry (RFC 6750 Section 3).
Definition oauth_bearer.h:68
std::string_view resource_metadata
Definition oauth_bearer.h:77
std::string_view realm
The protection space the credentials apply to (RFC 6750 Section 3).
Definition oauth_bearer.h:66
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_has_scope(const JSON &claims, const std::string_view value) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_build_challenge(const std::string_view scheme, const OAuthChallenge &challenge, std::string &sink) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_bearer_header(const std::string_view token, std::string &sink) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_is_dpop_bound(const JSON &claims) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_challenge_parameter(const std::string_view header, const std::string_view scheme, const std::string_view name) -> std::optional< std::string >
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_has_audience(const JSON &claims, const std::string_view audience) -> bool
Definition oauth_bearer.h:64