summaryrefslogtreecommitdiff
path: root/redfish-core
diff options
context:
space:
mode:
authorZbigniew Kurzynski <zbigniew.kurzynski@intel.com>2019-10-02 12:22:11 +0300
committerZbigniew Kurzynski <zbigniew.kurzynski@intel.com>2019-11-12 10:39:07 +0300
commit501f1e58ea6fdf97163ce4ea05fbaf1861a62b79 (patch)
tree6f617b9e3c29ae4cf7d1b505eefe1444a19ab54d /redfish-core
parente9e6d240ab85e515f8d264e39b47a75043b73374 (diff)
downloadbmcweb-501f1e58ea6fdf97163ce4ea05fbaf1861a62b79.tar.xz
TLS method configuration
User is now able to turn on and off the TLS authentication method. Tested: No regression found in manual testing. By default everything works as before, and disabling TLS method prevents user to authenticate by it. Tested with Redfish Service Validator, version 1.2.8 Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com> Change-Id: Ib7be1af659db568caa7e5b97e3844617586d7754
Diffstat (limited to 'redfish-core')
-rw-r--r--redfish-core/lib/account_service.hpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 8f28ea49f9..637be86c49 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -895,10 +895,11 @@ class AccountService : public Node
std::optional<bool> cookie;
std::optional<bool> sessionToken;
std::optional<bool> xToken;
+ std::optional<bool> tls;
if (!json_util::readJson(input, asyncResp->res, "BasicAuth", basicAuth,
"Cookie", cookie, "SessionToken", sessionToken,
- "XToken", xToken))
+ "XToken", xToken, "TLS", tls))
{
BMCWEB_LOG_ERROR << "Cannot read values from AuthMethod tag";
return;
@@ -929,8 +930,14 @@ class AccountService : public Node
authMethodsConfig.xtoken = *xToken;
}
+ if (tls)
+ {
+ authMethodsConfig.tls = *tls;
+ }
+
if (!authMethodsConfig.basic && !authMethodsConfig.cookie &&
- !authMethodsConfig.sessionToken && !authMethodsConfig.xtoken)
+ !authMethodsConfig.sessionToken && !authMethodsConfig.xtoken &&
+ !authMethodsConfig.tls)
{
// Do not allow user to disable everything
messages::actionNotSupported(asyncResp->res,
@@ -1151,6 +1158,7 @@ class AccountService : public Node
{"SessionToken", authMethodsConfig.sessionToken},
{"XToken", authMethodsConfig.xtoken},
{"Cookie", authMethodsConfig.cookie},
+ {"TLS", authMethodsConfig.tls},
}}}}}},
{"LDAP",
{{"Certificates",