Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
oauth_revocation.h
1#ifndef SOURCEMETA_CORE_OAUTH_REVOCATION_H_
2#define SOURCEMETA_CORE_OAUTH_REVOCATION_H_
3
4#ifndef SOURCEMETA_CORE_OAUTH_EXPORT
5#include <sourcemeta/core/oauth_export.h>
6#endif
7
8#include <sourcemeta/core/crypto.h>
9#include <sourcemeta/core/http.h>
10
11#include <cstdint> // std::uint8_t
12#include <functional> // std::function
13#include <string_view> // std::string_view
14
15namespace sourcemeta::core {
16
20inline constexpr std::string_view OAUTH_TOKEN_TYPE_HINT_ACCESS_TOKEN{
21 "access_token"};
22
25inline constexpr std::string_view OAUTH_TOKEN_TYPE_HINT_REFRESH_TOKEN{
26 "refresh_token"};
27
34 std::string_view token;
37 std::string_view token_type_hint;
38};
39
56SOURCEMETA_CORE_OAUTH_EXPORT
57auto oauth_build_revocation_request(const std::string_view token,
58 const std::string_view token_type_hint,
59 SecureString &sink) -> void;
60
80SOURCEMETA_CORE_OAUTH_EXPORT
82 const std::string_view body, SecureString &storage,
84 const std::function<void(std::string_view, std::string_view)> &on_other)
85 -> bool;
86
90enum class OAuthRevocationOutcome : std::uint8_t {
100};
101
114SOURCEMETA_CORE_OAUTH_EXPORT
115auto oauth_revocation_outcome(const HTTPStatus status) noexcept
117
118} // namespace sourcemeta::core
119
120#endif
Definition crypto_secure.h:162
Definition http_status.h:20
std::string_view token
The token to act on (RFC 7009 Section 2.1).
Definition oauth_revocation.h:34
std::string_view token_type_hint
Definition oauth_revocation.h:37
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_revocation_outcome(const HTTPStatus status) noexcept -> OAuthRevocationOutcome
constexpr std::string_view OAUTH_TOKEN_TYPE_HINT_REFRESH_TOKEN
Definition oauth_revocation.h:25
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_build_revocation_request(const std::string_view token, const std::string_view token_type_hint, SecureString &sink) -> void
OAuthRevocationOutcome
Definition oauth_revocation.h:90
constexpr std::string_view OAUTH_TOKEN_TYPE_HINT_ACCESS_TOKEN
Definition oauth_revocation.h:20
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_parse_revocation_request(const std::string_view body, SecureString &storage, OAuthTokenLookupRequest &result, const std::function< void(std::string_view, std::string_view)> &on_other) -> bool
@ Error
Definition oauth_device.h:136
@ Success
Definition oauth_revocation.h:93
@ Retry
Definition oauth_revocation.h:96
Definition oauth_revocation.h:32