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