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 NLOHMANN_JSON_SERIALIZE_ENUM(MFABypassType, {
68     {MFABypassType::Invalid, "Invalid"},
69     {MFABypassType::All, "All"},
70     {MFABypassType::SecurID, "SecurID"},
71     {MFABypassType::GoogleAuthenticator, "GoogleAuthenticator"},
72     {MFABypassType::MicrosoftAuthenticator, "MicrosoftAuthenticator"},
73     {MFABypassType::ClientCertificate, "ClientCertificate"},
74     {MFABypassType::OneTimePasscode, "OneTimePasscode"},
75     {MFABypassType::OEM, "OEM"},
76 });
77 
78 NLOHMANN_JSON_SERIALIZE_ENUM(LocalAccountAuth, {
79     {LocalAccountAuth::Invalid, "Invalid"},
80     {LocalAccountAuth::Enabled, "Enabled"},
81     {LocalAccountAuth::Disabled, "Disabled"},
82     {LocalAccountAuth::Fallback, "Fallback"},
83     {LocalAccountAuth::LocalFirst, "LocalFirst"},
84 });
85 
86 NLOHMANN_JSON_SERIALIZE_ENUM(AccountProviderTypes, {
87     {AccountProviderTypes::Invalid, "Invalid"},
88     {AccountProviderTypes::RedfishService, "RedfishService"},
89     {AccountProviderTypes::ActiveDirectoryService, "ActiveDirectoryService"},
90     {AccountProviderTypes::LDAPService, "LDAPService"},
91     {AccountProviderTypes::OEM, "OEM"},
92     {AccountProviderTypes::TACACSplus, "TACACSplus"},
93     {AccountProviderTypes::OAuth2, "OAuth2"},
94 });
95 
96 NLOHMANN_JSON_SERIALIZE_ENUM(AuthenticationTypes, {
97     {AuthenticationTypes::Invalid, "Invalid"},
98     {AuthenticationTypes::Token, "Token"},
99     {AuthenticationTypes::KerberosKeytab, "KerberosKeytab"},
100     {AuthenticationTypes::UsernameAndPassword, "UsernameAndPassword"},
101     {AuthenticationTypes::OEM, "OEM"},
102 });
103 
104 NLOHMANN_JSON_SERIALIZE_ENUM(TACACSplusPasswordExchangeProtocol, {
105     {TACACSplusPasswordExchangeProtocol::Invalid, "Invalid"},
106     {TACACSplusPasswordExchangeProtocol::ASCII, "ASCII"},
107     {TACACSplusPasswordExchangeProtocol::PAP, "PAP"},
108     {TACACSplusPasswordExchangeProtocol::CHAP, "CHAP"},
109     {TACACSplusPasswordExchangeProtocol::MSCHAPv1, "MSCHAPv1"},
110     {TACACSplusPasswordExchangeProtocol::MSCHAPv2, "MSCHAPv2"},
111 });
112 
113 NLOHMANN_JSON_SERIALIZE_ENUM(OAuth2Mode, {
114     {OAuth2Mode::Invalid, "Invalid"},
115     {OAuth2Mode::Discovery, "Discovery"},
116     {OAuth2Mode::Offline, "Offline"},
117 });
118 
119 NLOHMANN_JSON_SERIALIZE_ENUM(CertificateMappingAttribute, {
120     {CertificateMappingAttribute::Invalid, "Invalid"},
121     {CertificateMappingAttribute::Whole, "Whole"},
122     {CertificateMappingAttribute::CommonName, "CommonName"},
123     {CertificateMappingAttribute::UserPrincipalName, "UserPrincipalName"},
124 });
125 
126 }
127 // clang-format on
128