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