roar
Loading...
Searching...
No Matches
authorization.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <variant>
4#include <string>
5#include <string_view>
6
7#include <boost/describe/enum.hpp>
8
9namespace Roar
10{
12 AuthorizationScheme,
13 Basic,
14 Bearer,
15 Digest,
16 Hoba,
17 Mutual,
18 Ntlm,
19 Vapid,
20 Scram,
21 Aws4_Hmac_Sha256,
22 Other);
23
24 AuthorizationScheme authorizationSchemeFromString(std::string_view);
25 std::string to_string(AuthorizationScheme scheme);
26
28 {
29 public:
30 Authorization(std::string_view scheme);
31
35 AuthorizationScheme scheme() const;
36
40 std::string unknownSchemeAsString() const;
41
42 private:
43 std::variant<AuthorizationScheme, std::string> scheme_;
44 };
45}
Definition authorization.hpp:28
std::variant< AuthorizationScheme, std::string > scheme_
Definition authorization.hpp:43
std::string unknownSchemeAsString() const
Use this function if scheme is "Other", this will then return the scheme instead as a string.
Definition authorization.cpp:45
AuthorizationScheme scheme() const
Returns the authorization scheme. If the value is "Other", use unknownSchemeAsString instead.
Definition authorization.cpp:38
Definition authorization.hpp:10
BOOST_DEFINE_ENUM(AuthorizationScheme, Basic, Bearer, Digest, Hoba, Mutual, Ntlm, Vapid, Scram, Aws4_Hmac_Sha256, Other)
std::string to_string(AuthorizationScheme scheme)
Definition authorization.cpp:28
AuthorizationScheme authorizationSchemeFromString(std::string_view)
Definition authorization.cpp:9