Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
oauth_pkce.h
1#ifndef SOURCEMETA_CORE_OAUTH_PKCE_H_
2#define SOURCEMETA_CORE_OAUTH_PKCE_H_
3
4#ifndef SOURCEMETA_CORE_OAUTH_EXPORT
5#include <sourcemeta/core/oauth_export.h>
6#endif
7
8#include <sourcemeta/core/oauth_profile.h>
9
10#include <array> // std::array
11#include <cstdint> // std::uint8_t
12#include <optional> // std::optional
13#include <string_view> // std::string_view
14
15namespace sourcemeta::core {
16
19enum class OAuthPKCEMethod : std::uint8_t {
26};
27
61
73SOURCEMETA_CORE_OAUTH_EXPORT
74auto oauth_pkce_method_code(const OAuthPKCEMethod method) noexcept
75 -> std::string_view;
76
88SOURCEMETA_CORE_OAUTH_EXPORT
89auto to_oauth_pkce_method(const std::string_view value) noexcept
90 -> std::optional<OAuthPKCEMethod>;
91
108SOURCEMETA_CORE_OAUTH_EXPORT
109auto oauth_pkce_verifier() -> std::array<char, 43>;
110
125SOURCEMETA_CORE_OAUTH_EXPORT
126auto oauth_pkce_challenge(const std::string_view verifier)
127 -> std::array<char, 43>;
128
147SOURCEMETA_CORE_OAUTH_EXPORT
148auto oauth_pkce_verify(const std::string_view verifier,
149 const std::string_view challenge,
150 const OAuthPKCEMethod method, const OAuthProfile profile)
152
153} // namespace sourcemeta::core
154
155#endif
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_pkce_method_code(const OAuthPKCEMethod method) noexcept -> std::string_view
SOURCEMETA_CORE_OAUTH_EXPORT auto to_oauth_pkce_method(const std::string_view value) noexcept -> std::optional< OAuthPKCEMethod >
OAuthPKCEOutcome
Definition oauth_pkce.h:34
OAuthProfile
Definition oauth_profile.h:23
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_pkce_verifier() -> std::array< char, 43 >
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_pkce_challenge(const std::string_view verifier) -> std::array< char, 43 >
OAuthPKCEMethod
Definition oauth_pkce.h:19
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_pkce_verify(const std::string_view verifier, const std::string_view challenge, const OAuthPKCEMethod method, const OAuthProfile profile) -> OAuthPKCEOutcome
@ MissingVerifier
Definition oauth_pkce.h:42
@ Mismatch
Definition oauth_pkce.h:48
@ Match
The verifier corresponds to the challenge.
Definition oauth_pkce.h:36
@ MalformedVerifier
Definition oauth_pkce.h:54
@ MethodNotAllowed
Definition oauth_pkce.h:51
@ NotUsed
Definition oauth_pkce.h:39
@ MissingChallenge
Definition oauth_pkce.h:45
@ MalformedChallenge
Definition oauth_pkce.h:59
@ Plain
Definition oauth_pkce.h:25
@ S256
Definition oauth_pkce.h:22