1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright OpenBMC Authors
#pragma once
#include <nlohmann/json.hpp>
namespace account_service
{
// clang-format off
enum class MFABypassType{
Invalid,
All,
SecurID,
GoogleAuthenticator,
MicrosoftAuthenticator,
ClientCertificate,
OneTimePasscode,
TimeBasedOneTimePassword,
OEM,
};
enum class LocalAccountAuth{
Invalid,
Enabled,
Disabled,
Fallback,
LocalFirst,
};
enum class AccountProviderTypes{
Invalid,
RedfishService,
ActiveDirectoryService,
LDAPService,
OEM,
TACACSplus,
OAuth2,
};
enum class AuthenticationTypes{
Invalid,
Token,
KerberosKeytab,
UsernameAndPassword,
OEM,
};
enum class TACACSplusPasswordExchangeProtocol{
Invalid,
ASCII,
PAP,
CHAP,
MSCHAPv1,
MSCHAPv2,
};
enum class OAuth2Mode{
Invalid,
Discovery,
Offline,
};
enum class CertificateMappingAttribute{
Invalid,
Whole,
CommonName,
UserPrincipalName,
};
enum class BasicAuthState{
Invalid,
Enabled,
Unadvertised,
Disabled,
};
NLOHMANN_JSON_SERIALIZE_ENUM(MFABypassType, {
{MFABypassType::Invalid, "Invalid"},
{MFABypassType::All, "All"},
{MFABypassType::SecurID, "SecurID"},
{MFABypassType::GoogleAuthenticator, "GoogleAuthenticator"},
{MFABypassType::MicrosoftAuthenticator, "MicrosoftAuthenticator"},
{MFABypassType::ClientCertificate, "ClientCertificate"},
{MFABypassType::OneTimePasscode, "OneTimePasscode"},
{MFABypassType::TimeBasedOneTimePassword, "TimeBasedOneTimePassword"},
{MFABypassType::OEM, "OEM"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(LocalAccountAuth, {
{LocalAccountAuth::Invalid, "Invalid"},
{LocalAccountAuth::Enabled, "Enabled"},
{LocalAccountAuth::Disabled, "Disabled"},
{LocalAccountAuth::Fallback, "Fallback"},
{LocalAccountAuth::LocalFirst, "LocalFirst"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(AccountProviderTypes, {
{AccountProviderTypes::Invalid, "Invalid"},
{AccountProviderTypes::RedfishService, "RedfishService"},
{AccountProviderTypes::ActiveDirectoryService, "ActiveDirectoryService"},
{AccountProviderTypes::LDAPService, "LDAPService"},
{AccountProviderTypes::OEM, "OEM"},
{AccountProviderTypes::TACACSplus, "TACACSplus"},
{AccountProviderTypes::OAuth2, "OAuth2"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(AuthenticationTypes, {
{AuthenticationTypes::Invalid, "Invalid"},
{AuthenticationTypes::Token, "Token"},
{AuthenticationTypes::KerberosKeytab, "KerberosKeytab"},
{AuthenticationTypes::UsernameAndPassword, "UsernameAndPassword"},
{AuthenticationTypes::OEM, "OEM"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(TACACSplusPasswordExchangeProtocol, {
{TACACSplusPasswordExchangeProtocol::Invalid, "Invalid"},
{TACACSplusPasswordExchangeProtocol::ASCII, "ASCII"},
{TACACSplusPasswordExchangeProtocol::PAP, "PAP"},
{TACACSplusPasswordExchangeProtocol::CHAP, "CHAP"},
{TACACSplusPasswordExchangeProtocol::MSCHAPv1, "MSCHAPv1"},
{TACACSplusPasswordExchangeProtocol::MSCHAPv2, "MSCHAPv2"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(OAuth2Mode, {
{OAuth2Mode::Invalid, "Invalid"},
{OAuth2Mode::Discovery, "Discovery"},
{OAuth2Mode::Offline, "Offline"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(CertificateMappingAttribute, {
{CertificateMappingAttribute::Invalid, "Invalid"},
{CertificateMappingAttribute::Whole, "Whole"},
{CertificateMappingAttribute::CommonName, "CommonName"},
{CertificateMappingAttribute::UserPrincipalName, "UserPrincipalName"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(BasicAuthState, {
{BasicAuthState::Invalid, "Invalid"},
{BasicAuthState::Enabled, "Enabled"},
{BasicAuthState::Unadvertised, "Unadvertised"},
{BasicAuthState::Disabled, "Disabled"},
});
// clang-format on
} // namespace account_service
|