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