blob: 4561f52c3ed324bb248acaa36823be92febb2ed6 [file] [log] [blame]
Ed Tanous40e9b922024-09-10 13:50:16 -07001// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright OpenBMC Authors
3// SPDX-FileCopyrightText: Copyright 2018 Intel Corporation
Kowalski, Kamil2b7981f2018-01-31 13:24:59 +01004#pragma once
Borawski.Lukasz43a095a2018-02-19 15:39:01 +01005
Paul Fertserce22f602024-06-03 20:53:16 +00006#include "account_service.hpp"
Ed Tanous3ccb3ad2023-01-13 17:40:03 -08007#include "app.hpp"
Paul Fertser29aab242024-06-12 19:28:47 +00008#include "cookies.hpp"
Kowalski, Kamilf4c4dcf2018-01-29 14:55:35 +01009#include "error_messages.hpp"
Ed Tanous3ccb3ad2023-01-13 17:40:03 -080010#include "http/utility.hpp"
Ed Tanous52cc1122020-07-18 13:51:21 -070011#include "persistent_data.hpp"
Ed Tanous3ccb3ad2023-01-13 17:40:03 -080012#include "query.hpp"
13#include "registries/privilege_registry.hpp"
14#include "utils/json_utils.hpp"
John Edward Broadbent7e860f12021-04-08 15:57:16 -070015
Ed Tanousef4c65b2023-04-24 15:28:50 -070016#include <boost/url/format.hpp>
17
Ed Tanous89cda632024-04-16 08:45:54 -070018#include <string>
19#include <vector>
20
Ed Tanous1abe55e2018-09-05 08:30:59 -070021namespace redfish
22{
Kowalski, Kamil2b7981f2018-01-31 13:24:59 +010023
Ed Tanous4f48d5f2021-06-21 08:27:45 -070024inline void fillSessionObject(crow::Response& res,
25 const persistent_data::UserSession& session)
Ed Tanous1abe55e2018-09-05 08:30:59 -070026{
Ed Tanousfaa34cc2021-06-03 13:27:02 -070027 res.jsonValue["Id"] = session.uniqueId;
28 res.jsonValue["UserName"] = session.username;
Paul Fertserce22f602024-06-03 20:53:16 +000029 nlohmann::json::array_t roles;
30 roles.emplace_back(redfish::getRoleIdFromPrivilege(session.userRole));
31 res.jsonValue["Roles"] = std::move(roles);
Ed Tanousef4c65b2023-04-24 15:28:50 -070032 res.jsonValue["@odata.id"] = boost::urls::format(
33 "/redfish/v1/SessionService/Sessions/{}", session.uniqueId);
Paul Fertserce22f602024-06-03 20:53:16 +000034 res.jsonValue["@odata.type"] = "#Session.v1_7_0.Session";
Ed Tanousfaa34cc2021-06-03 13:27:02 -070035 res.jsonValue["Name"] = "User Session";
36 res.jsonValue["Description"] = "Manager User Session";
37 res.jsonValue["ClientOriginIPAddress"] = session.clientIp;
Ed Tanousbb759e32022-08-02 17:07:54 -070038 if (session.clientId)
39 {
40 res.jsonValue["Context"] = *session.clientId;
41 }
Ed Tanousfaa34cc2021-06-03 13:27:02 -070042}
Kowalski, Kamil2b7981f2018-01-31 13:24:59 +010043
Ed Tanous724340d2022-03-14 09:10:07 -070044inline void
Ed Tanousa1e08712022-07-07 16:10:39 -070045 handleSessionHead(crow::App& app, const crow::Request& req,
46 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
47 const std::string& /*sessionId*/)
Ed Tanous724340d2022-03-14 09:10:07 -070048{
Carson Labrado3ba00072022-06-06 19:40:56 +000049 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous45ca1b82022-03-25 13:07:27 -070050 {
51 return;
52 }
Ed Tanousa1e08712022-07-07 16:10:39 -070053 asyncResp->res.addHeader(
54 boost::beast::http::field::link,
55 "</redfish/v1/JsonSchemas/Session/Session.json>; rel=describedby");
56}
57
58inline void
59 handleSessionGet(crow::App& app, const crow::Request& req,
60 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
61 const std::string& sessionId)
62{
Ed Tanous65ffbcb2023-05-16 08:54:11 -070063 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
64 {
65 return;
66 }
67 asyncResp->res.addHeader(
68 boost::beast::http::field::link,
69 "</redfish/v1/JsonSchemas/Session/Session.json>; rel=describedby");
Ed Tanousa1e08712022-07-07 16:10:39 -070070
Ed Tanous724340d2022-03-14 09:10:07 -070071 // Note that control also reaches here via doPost and doDelete.
72 auto session =
73 persistent_data::SessionStore::getInstance().getSessionByUid(sessionId);
74
75 if (session == nullptr)
76 {
77 messages::resourceNotFound(asyncResp->res, "Session", sessionId);
78 return;
79 }
80
81 fillSessionObject(asyncResp->res, *session);
82}
83
84inline void
Ed Tanous45ca1b82022-03-25 13:07:27 -070085 handleSessionDelete(crow::App& app, const crow::Request& req,
Ed Tanous724340d2022-03-14 09:10:07 -070086 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
87 const std::string& sessionId)
88{
Carson Labrado3ba00072022-06-06 19:40:56 +000089 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous45ca1b82022-03-25 13:07:27 -070090 {
91 return;
92 }
Ed Tanous724340d2022-03-14 09:10:07 -070093 auto session =
94 persistent_data::SessionStore::getInstance().getSessionByUid(sessionId);
95
96 if (session == nullptr)
97 {
98 messages::resourceNotFound(asyncResp->res, "Session", sessionId);
99 return;
100 }
101
102 // Perform a proper ConfigureSelf authority check. If a
103 // session is being used to DELETE some other user's session,
104 // then the ConfigureSelf privilege does not apply. In that
105 // case, perform the authority check again without the user's
106 // ConfigureSelf privilege.
wukaihua-fii-na0fd29862022-05-18 09:19:16 +0800107 if (req.session != nullptr && !session->username.empty() &&
108 session->username != req.session->username)
Ed Tanous724340d2022-03-14 09:10:07 -0700109 {
110 Privileges effectiveUserPrivileges =
Ninad Palsule3e72c202023-03-27 17:19:55 -0500111 redfish::getUserPrivileges(*req.session);
Ed Tanous724340d2022-03-14 09:10:07 -0700112
113 if (!effectiveUserPrivileges.isSupersetOf({"ConfigureUsers"}))
114 {
115 messages::insufficientPrivilege(asyncResp->res);
116 return;
117 }
118 }
119
Paul Fertser8812e8b2024-09-18 12:16:37 +0000120 if (req.session != nullptr && req.session->uniqueId == sessionId &&
121 session->cookieAuth)
Paul Fertser29aab242024-06-12 19:28:47 +0000122 {
123 bmcweb::clearSessionCookies(asyncResp->res);
124 }
125
Ed Tanous724340d2022-03-14 09:10:07 -0700126 persistent_data::SessionStore::getInstance().removeSession(session);
127 messages::success(asyncResp->res);
128}
129
130inline nlohmann::json getSessionCollectionMembers()
131{
Ed Tanous89cda632024-04-16 08:45:54 -0700132 std::vector<std::string> sessionIds =
133 persistent_data::SessionStore::getInstance().getAllUniqueIds();
Ed Tanous724340d2022-03-14 09:10:07 -0700134 nlohmann::json ret = nlohmann::json::array();
Ed Tanous89cda632024-04-16 08:45:54 -0700135 for (const std::string& uid : sessionIds)
Ed Tanous724340d2022-03-14 09:10:07 -0700136 {
Ed Tanous14766872022-03-15 10:44:42 -0700137 nlohmann::json::object_t session;
Ed Tanousef4c65b2023-04-24 15:28:50 -0700138 session["@odata.id"] =
Ed Tanous89cda632024-04-16 08:45:54 -0700139 boost::urls::format("/redfish/v1/SessionService/Sessions/{}", uid);
Patrick Williamsb2ba3072023-05-12 10:27:39 -0500140 ret.emplace_back(std::move(session));
Ed Tanous724340d2022-03-14 09:10:07 -0700141 }
142 return ret;
143}
144
Ed Tanousa1e08712022-07-07 16:10:39 -0700145inline void handleSessionCollectionHead(
Ed Tanous45ca1b82022-03-25 13:07:27 -0700146 crow::App& app, const crow::Request& req,
Ed Tanous724340d2022-03-14 09:10:07 -0700147 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
148{
Carson Labrado3ba00072022-06-06 19:40:56 +0000149 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous45ca1b82022-03-25 13:07:27 -0700150 {
151 return;
152 }
Ed Tanousa1e08712022-07-07 16:10:39 -0700153 asyncResp->res.addHeader(
154 boost::beast::http::field::link,
155 "</redfish/v1/JsonSchemas/SessionCollection.json>; rel=describedby");
156}
157
158inline void handleSessionCollectionGet(
159 crow::App& app, const crow::Request& req,
160 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
161{
Ed Tanous01a89a12022-08-05 09:18:54 -0700162 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
163 {
164 return;
165 }
166 asyncResp->res.addHeader(
167 boost::beast::http::field::link,
168 "</redfish/v1/JsonSchemas/SessionCollection.json>; rel=describedby");
169
Ed Tanous724340d2022-03-14 09:10:07 -0700170 asyncResp->res.jsonValue["Members"] = getSessionCollectionMembers();
171 asyncResp->res.jsonValue["Members@odata.count"] =
172 asyncResp->res.jsonValue["Members"].size();
173 asyncResp->res.jsonValue["@odata.type"] =
174 "#SessionCollection.SessionCollection";
175 asyncResp->res.jsonValue["@odata.id"] =
Gunnar Mills7a859ff2024-03-04 23:04:45 -0700176 "/redfish/v1/SessionService/Sessions";
Ed Tanous724340d2022-03-14 09:10:07 -0700177 asyncResp->res.jsonValue["Name"] = "Session Collection";
178 asyncResp->res.jsonValue["Description"] = "Session Collection";
179}
180
181inline void handleSessionCollectionMembersGet(
Ed Tanous45ca1b82022-03-25 13:07:27 -0700182 crow::App& app, const crow::Request& req,
Ed Tanous724340d2022-03-14 09:10:07 -0700183 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
184{
Carson Labrado3ba00072022-06-06 19:40:56 +0000185 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous45ca1b82022-03-25 13:07:27 -0700186 {
187 return;
188 }
Ed Tanous724340d2022-03-14 09:10:07 -0700189 asyncResp->res.jsonValue = getSessionCollectionMembers();
190}
191
Jishnu CMbe2f1242024-12-03 00:45:20 -0600192inline void processAfterSessionCreation(
193 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
194 const crow::Request& req, const std::string& username,
195 std::shared_ptr<persistent_data::UserSession>& session)
196{
197 // When session is created by webui-vue give it session cookies as a
198 // non-standard Redfish extension. This is needed for authentication for
199 // WebSockets-based functionality.
200 if (!req.getHeaderValue("X-Requested-With").empty())
201 {
202 bmcweb::setSessionCookies(asyncResp->res, *session);
203 }
204 else
205 {
206 asyncResp->res.addHeader("X-Auth-Token", session->sessionToken);
207 }
208
209 asyncResp->res.addHeader(
210 "Location", "/redfish/v1/SessionService/Sessions/" + session->uniqueId);
211 asyncResp->res.result(boost::beast::http::status::created);
212 if (session->isConfigureSelfOnly)
213 {
214 messages::passwordChangeRequired(
215 asyncResp->res,
216 boost::urls::format("/redfish/v1/AccountService/Accounts/{}",
217 session->username));
218 }
219
220 crow::getUserInfo(asyncResp, username, session, [asyncResp, session]() {
221 fillSessionObject(asyncResp->res, *session);
222 });
223}
224
Ed Tanous4ee8e212022-05-28 09:42:51 -0700225inline void handleSessionCollectionPost(
Ed Tanous45ca1b82022-03-25 13:07:27 -0700226 crow::App& app, const crow::Request& req,
Ed Tanous724340d2022-03-14 09:10:07 -0700227 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
228{
Carson Labrado3ba00072022-06-06 19:40:56 +0000229 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous45ca1b82022-03-25 13:07:27 -0700230 {
231 return;
232 }
Ed Tanous724340d2022-03-14 09:10:07 -0700233 std::string username;
234 std::string password;
Ed Tanousbb759e32022-08-02 17:07:54 -0700235 std::optional<std::string> clientId;
Ravi Teja2ccce1f2024-08-10 04:05:36 -0500236 std::optional<std::string> token;
Myung Baeafc474a2024-10-09 00:53:29 -0700237 if (!json_util::readJsonPatch( //
238 req, asyncResp->res, //
239 "Context", clientId, //
240 "Password", password, //
241 "Token", token, //
242 "UserName", username //
243 ))
Ed Tanous724340d2022-03-14 09:10:07 -0700244 {
245 return;
246 }
Ed Tanous724340d2022-03-14 09:10:07 -0700247 if (password.empty() || username.empty() ||
248 asyncResp->res.result() != boost::beast::http::status::ok)
249 {
250 if (username.empty())
251 {
252 messages::propertyMissing(asyncResp->res, "UserName");
253 }
254
255 if (password.empty())
256 {
257 messages::propertyMissing(asyncResp->res, "Password");
258 }
259
260 return;
261 }
262
Ravi Teja2ccce1f2024-08-10 04:05:36 -0500263 int pamrc = pamAuthenticateUser(username, password, token);
Ed Tanous724340d2022-03-14 09:10:07 -0700264 bool isConfigureSelfOnly = pamrc == PAM_NEW_AUTHTOK_REQD;
265 if ((pamrc != PAM_SUCCESS) && !isConfigureSelfOnly)
266 {
Ed Tanous39662a32023-02-06 15:09:46 -0800267 messages::resourceAtUriUnauthorized(asyncResp->res, req.url(),
Ed Tanous724340d2022-03-14 09:10:07 -0700268 "Invalid username or password");
269 return;
270 }
Ed Tanous724340d2022-03-14 09:10:07 -0700271
272 // User is authenticated - create session
273 std::shared_ptr<persistent_data::UserSession> session =
274 persistent_data::SessionStore::getInstance().generateUserSession(
275 username, req.ipAddress, clientId,
Ed Tanous89cda632024-04-16 08:45:54 -0700276 persistent_data::SessionType::Session, isConfigureSelfOnly);
Brad Bishop02e53ae2022-07-29 14:38:40 -0400277 if (session == nullptr)
278 {
279 messages::internalError(asyncResp->res);
280 return;
281 }
Jishnu CMbe2f1242024-12-03 00:45:20 -0600282 processAfterSessionCreation(asyncResp, req, username, session);
Ed Tanous724340d2022-03-14 09:10:07 -0700283}
Jishnu CMbe2f1242024-12-03 00:45:20 -0600284
Ed Tanousa1e08712022-07-07 16:10:39 -0700285inline void handleSessionServiceHead(
286 crow::App& app, const crow::Request& req,
287 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
288{
Ed Tanousa1e08712022-07-07 16:10:39 -0700289 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
290 {
291 return;
292 }
293 asyncResp->res.addHeader(
294 boost::beast::http::field::link,
295 "</redfish/v1/JsonSchemas/SessionService/SessionService.json>; rel=describedby");
296}
Ed Tanous724340d2022-03-14 09:10:07 -0700297inline void
Ed Tanous45ca1b82022-03-25 13:07:27 -0700298 handleSessionServiceGet(crow::App& app, const crow::Request& req,
Ed Tanous724340d2022-03-14 09:10:07 -0700299 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
300
301{
Gunnar Mills78e39002023-05-17 11:52:44 -0500302 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
303 {
304 return;
305 }
306 asyncResp->res.addHeader(
307 boost::beast::http::field::link,
308 "</redfish/v1/JsonSchemas/SessionService/SessionService.json>; rel=describedby");
309
Ed Tanous724340d2022-03-14 09:10:07 -0700310 asyncResp->res.jsonValue["@odata.type"] =
311 "#SessionService.v1_0_2.SessionService";
Gunnar Mills7a859ff2024-03-04 23:04:45 -0700312 asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/SessionService";
Ed Tanous724340d2022-03-14 09:10:07 -0700313 asyncResp->res.jsonValue["Name"] = "Session Service";
314 asyncResp->res.jsonValue["Id"] = "SessionService";
315 asyncResp->res.jsonValue["Description"] = "Session Service";
316 asyncResp->res.jsonValue["SessionTimeout"] =
317 persistent_data::SessionStore::getInstance().getTimeoutInSeconds();
318 asyncResp->res.jsonValue["ServiceEnabled"] = true;
319
Ed Tanous14766872022-03-15 10:44:42 -0700320 asyncResp->res.jsonValue["Sessions"]["@odata.id"] =
321 "/redfish/v1/SessionService/Sessions";
Ed Tanous724340d2022-03-14 09:10:07 -0700322}
323
324inline void handleSessionServicePatch(
Ed Tanous45ca1b82022-03-25 13:07:27 -0700325 crow::App& app, const crow::Request& req,
Ed Tanous724340d2022-03-14 09:10:07 -0700326 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
327{
Carson Labrado3ba00072022-06-06 19:40:56 +0000328 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanous45ca1b82022-03-25 13:07:27 -0700329 {
330 return;
331 }
Ed Tanous724340d2022-03-14 09:10:07 -0700332 std::optional<int64_t> sessionTimeout;
Myung Baeafc474a2024-10-09 00:53:29 -0700333 if (!json_util::readJsonPatch( //
334 req, asyncResp->res, //
335 "SessionTimeout", sessionTimeout //
336 ))
Ed Tanous724340d2022-03-14 09:10:07 -0700337 {
338 return;
339 }
340
341 if (sessionTimeout)
342 {
Ed Tanous8ece0e42024-01-02 13:16:50 -0800343 // The minimum & maximum allowed values for session timeout
Ed Tanous724340d2022-03-14 09:10:07 -0700344 // are 30 seconds and 86400 seconds respectively as per the
345 // session service schema mentioned at
346 // https://redfish.dmtf.org/schemas/v1/SessionService.v1_1_7.json
347
348 if (*sessionTimeout <= 86400 && *sessionTimeout >= 30)
349 {
350 std::chrono::seconds sessionTimeoutInseconds(*sessionTimeout);
351 persistent_data::SessionStore::getInstance().updateSessionTimeout(
352 sessionTimeoutInseconds);
353 messages::propertyValueModified(asyncResp->res, "SessionTimeOut",
354 std::to_string(*sessionTimeout));
355 }
356 else
357 {
Ed Tanouse2616cc2022-06-27 12:45:55 -0700358 messages::propertyValueNotInList(asyncResp->res, *sessionTimeout,
Ed Tanous724340d2022-03-14 09:10:07 -0700359 "SessionTimeOut");
360 }
361 }
362}
363
Ed Tanousfaa34cc2021-06-03 13:27:02 -0700364inline void requestRoutesSession(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -0700365{
Ed Tanousfaa34cc2021-06-03 13:27:02 -0700366 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/<str>/")
Ed Tanousa1e08712022-07-07 16:10:39 -0700367 .privileges(redfish::privileges::headSession)
368 .methods(boost::beast::http::verb::head)(
369 std::bind_front(handleSessionHead, std::ref(app)));
370
371 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/<str>/")
Ed Tanoused398212021-06-09 17:05:54 -0700372 .privileges(redfish::privileges::getSession)
Ed Tanous45ca1b82022-03-25 13:07:27 -0700373 .methods(boost::beast::http::verb::get)(
374 std::bind_front(handleSessionGet, std::ref(app)));
Kowalski, Kamil2b7981f2018-01-31 13:24:59 +0100375
Ed Tanousfaa34cc2021-06-03 13:27:02 -0700376 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/<str>/")
Ed Tanoused398212021-06-09 17:05:54 -0700377 .privileges(redfish::privileges::deleteSession)
Ed Tanous45ca1b82022-03-25 13:07:27 -0700378 .methods(boost::beast::http::verb::delete_)(
379 std::bind_front(handleSessionDelete, std::ref(app)));
Ed Tanousfaa34cc2021-06-03 13:27:02 -0700380
381 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/")
Ed Tanousa1e08712022-07-07 16:10:39 -0700382 .privileges(redfish::privileges::headSessionCollection)
383 .methods(boost::beast::http::verb::head)(
384 std::bind_front(handleSessionCollectionHead, std::ref(app)));
385
386 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/")
Ed Tanoused398212021-06-09 17:05:54 -0700387 .privileges(redfish::privileges::getSessionCollection)
Ed Tanous45ca1b82022-03-25 13:07:27 -0700388 .methods(boost::beast::http::verb::get)(
389 std::bind_front(handleSessionCollectionGet, std::ref(app)));
Ed Tanousfaa34cc2021-06-03 13:27:02 -0700390
Ed Tanouse76cd862022-03-14 09:12:00 -0700391 // Note, the next two routes technically don't match the privilege
Ed Tanous724340d2022-03-14 09:10:07 -0700392 // registry given the way login mechanisms work. The base privilege
393 // registry lists this endpoint as requiring login privilege, but because
394 // this is the endpoint responsible for giving the login privilege, and it
395 // is itself its own route, it needs to not require Login
Ed Tanousfaa34cc2021-06-03 13:27:02 -0700396 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/")
397 .privileges({})
Ed Tanous45ca1b82022-03-25 13:07:27 -0700398 .methods(boost::beast::http::verb::post)(
399 std::bind_front(handleSessionCollectionPost, std::ref(app)));
Kowalski, Kamil2b7981f2018-01-31 13:24:59 +0100400
Ed Tanouse76cd862022-03-14 09:12:00 -0700401 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/Members/")
402 .privileges({})
Ed Tanous45ca1b82022-03-25 13:07:27 -0700403 .methods(boost::beast::http::verb::post)(
404 std::bind_front(handleSessionCollectionPost, std::ref(app)));
Ed Tanouse76cd862022-03-14 09:12:00 -0700405
Ed Tanousfaa34cc2021-06-03 13:27:02 -0700406 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/")
Ed Tanousa1e08712022-07-07 16:10:39 -0700407 .privileges(redfish::privileges::headSessionService)
408 .methods(boost::beast::http::verb::head)(
409 std::bind_front(handleSessionServiceHead, std::ref(app)));
410
411 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/")
Ed Tanoused398212021-06-09 17:05:54 -0700412 .privileges(redfish::privileges::getSessionService)
Ed Tanous45ca1b82022-03-25 13:07:27 -0700413 .methods(boost::beast::http::verb::get)(
414 std::bind_front(handleSessionServiceGet, std::ref(app)));
Borawski.Lukasz5d27b852018-02-08 13:24:24 +0100415
Ed Tanousfaa34cc2021-06-03 13:27:02 -0700416 BMCWEB_ROUTE(app, "/redfish/v1/SessionService/")
Ed Tanoused398212021-06-09 17:05:54 -0700417 .privileges(redfish::privileges::patchSessionService)
Ed Tanous45ca1b82022-03-25 13:07:27 -0700418 .methods(boost::beast::http::verb::patch)(
419 std::bind_front(handleSessionServicePatch, std::ref(app)));
Ed Tanousfaa34cc2021-06-03 13:27:02 -0700420}
Borawski.Lukasz5d27b852018-02-08 13:24:24 +0100421
Ed Tanous1abe55e2018-09-05 08:30:59 -0700422} // namespace redfish