summaryrefslogtreecommitdiff
path: root/include/authentication.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-08-03 03:07:54 +0300
committerEd Tanous <ed@tanous.net>2022-10-07 21:06:08 +0300
commitbb759e3aeaadfec9f3aac4485f253bcc8a523e4c (patch)
tree52e48fbdd2a77c2c6ba583a2d41750e265336a77 /include/authentication.hpp
parent40e4f380d645c6bbe6bd8050e501203798a0c488 (diff)
downloadbmcweb-bb759e3aeaadfec9f3aac4485f253bcc8a523e4c.tar.xz
Move ClientID parameter out of OEM
In 2022.2, Redfish added support for the Context parameter on the Session Resource. This parameter has the same function that the OemSession.ClientId field served. This commit moves all the existing ClientId code to produce Context as well. Functionally, this has one important difference, in that Context in Redfish is optionally provided by the user, which means we need to omit it if not given by the user. The old implementation left it set to empty string (""). Because of this, a few minor interfaces need to change to use std::optional. Existing uses of clientId are moved to using value_or("") to keep the same behavior as before. Tested: curl --insecure -X POST -d "{\"UserName\": \"root\", \"Password\": \"0penBmc\"}" https://192.168.7.2/redfish/v1/SessionService/Sessions Returns a Session object with no Context key present curl --insecure -X POST -d "{\"UserName\": \"root\", \"Password\": \"0penBmc\", \"Context\": \"Foobar\"}" https://192.168.7.2/redfish/v1/SessionService/Sessions Returns a Session object with: "Context": "Foobar" Subsequent Gets of /redfish/v1/SessionService/Sessions/<sid> return the same session objects, both with and without Context. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4df358623f93f3e6cb659e99970ad909cefebc62
Diffstat (limited to 'include/authentication.hpp')
-rw-r--r--include/authentication.hpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/authentication.hpp b/include/authentication.hpp
index 6a9e6ad69b..84875a9a1d 100644
--- a/include/authentication.hpp
+++ b/include/authentication.hpp
@@ -84,9 +84,8 @@ static std::shared_ptr<persistent_data::UserSession>
// needed.
// This whole flow needs to be revisited anyway, as we can't be
// calling directly into pam for every request
- std::string unsupportedClientId;
return persistent_data::SessionStore::getInstance().generateUserSession(
- user, clientIp, unsupportedClientId,
+ user, clientIp, std::nullopt,
persistent_data::PersistenceType::SINGLE_REQUEST, isConfigureSelfOnly);
}
#endif