CCF
Loading...
Searching...
No Matches
src
ds
actors.h
Go to the documentation of this file.
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
// Licensed under the Apache 2.0 License.
3
#pragma once
4
5
#include <cstdint>
6
#include <string>
7
8
namespace
ccf
9
{
10
enum class
ActorsType
: uint64_t
11
{
12
members
= 0,
13
users
,
14
nodes
,
15
acme_challenge
,
16
// not to be used
17
unknown
18
};
19
20
inline
bool
is_valid_actor
(
const
std::string& actor)
21
{
22
if
(
23
actor !=
"gov"
&& actor !=
"app"
&& actor !=
"node"
&&
24
actor !=
".well-known/acme-challenge"
)
25
{
26
return
false
;
27
}
28
return
true
;
29
}
30
31
constexpr
auto
get_actor_prefix
(
ActorsType
at)
32
{
33
switch
(at)
34
{
35
case
ActorsType::members
:
36
{
37
return
"gov"
;
38
}
39
case
ActorsType::users
:
40
{
41
return
"app"
;
42
}
43
case
ActorsType::nodes
:
44
{
45
return
"node"
;
46
}
47
case
ActorsType::acme_challenge
:
48
{
49
return
".well-known/acme-challenge"
;
50
}
51
default
:
52
{
53
return
""
;
54
}
55
}
56
}
57
}
ccf
Definition
app_interface.h:14
ccf::get_actor_prefix
constexpr auto get_actor_prefix(ActorsType at)
Definition
actors.h:31
ccf::is_valid_actor
bool is_valid_actor(const std::string &actor)
Definition
actors.h:20
ccf::ActorsType
ActorsType
Definition
actors.h:11
ccf::ActorsType::users
@ users
ccf::ActorsType::unknown
@ unknown
ccf::ActorsType::acme_challenge
@ acme_challenge
ccf::ActorsType::nodes
@ nodes
ccf::ActorsType::members
@ members
Generated by
1.9.8