⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
userver
C++ Async Framework v2.0
Documentation
API Groups
Namespaces
Reference
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
w
y
Variables
k
n
r
u
w
Typedefs
c
d
h
m
n
o
p
s
t
u
v
Enumerations
a
b
c
d
f
h
i
l
o
p
r
s
t
u
v
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Related Symbols
File List
File Members
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
Toggle main menu visibility
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
user_env.hpp
1
#
pragma
once
2
3
#
include
<
stdexcept
>
4
#
include
<
string
>
5
6
#
include
<
userver
/
formats
/
parse
/
to
.
hpp
>
7
#
include
<
userver
/
utils
/
assert
.
hpp
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
server::handlers::
auth
{
12
class
AuthCheckerBase
;
13
}
14
15
namespace
server::auth {
16
17
/// @brief Authorization environments for users
18
enum
class
UserEnv :
int
{
19
kProd,
20
kTest,
21
kProdYateam,
22
kTestYateam,
23
kStress,
24
};
25
26
template
<
class
Value>
27
UserEnv Parse(
const
Value& v, formats::
parse
::
To
<UserEnv>) {
28
const
std::string env_name = v.
template
As<std::string>();
29
if
(env_name ==
"Prod"
|| env_name ==
"Mimino"
) {
30
return
UserEnv::kProd;
31
}
else
if
(env_name ==
"Test"
) {
32
return
UserEnv::kTest;
33
}
else
if
(env_name ==
"ProdYateam"
) {
34
return
UserEnv::kProdYateam;
35
}
else
if
(env_name ==
"TestYateam"
) {
36
return
UserEnv::kTestYateam;
37
}
else
if
(env_name ==
"Stress"
) {
38
return
UserEnv::kStress;
39
}
40
41
UASSERT_MSG
(
false
,
"Unknown user env"
);
42
throw
std::runtime_error(
"Unknown user env "
+ env_name);
43
}
44
45
std::string ToString(UserEnv env);
46
47
}
// namespace server::auth
48
49
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
server
auth
user_env.hpp
Generated on Wed May 15 2024 22:20:15 for userver by
Doxygen
1.10.0