Kowalski, Kamil | 2b7981f | 2018-01-31 13:24:59 +0100 | [diff] [blame] | 1 | /* |
| 2 | // Copyright (c) 2018 Intel Corporation |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | */ |
| 16 | #pragma once |
Borawski.Lukasz | 43a095a | 2018-02-19 15:39:01 +0100 | [diff] [blame] | 17 | |
Kowalski, Kamil | f4c4dcf | 2018-01-29 14:55:35 +0100 | [diff] [blame] | 18 | #include "error_messages.hpp" |
Ed Tanous | 52cc112 | 2020-07-18 13:51:21 -0700 | [diff] [blame] | 19 | #include "persistent_data.hpp" |
Kowalski, Kamil | 2b7981f | 2018-01-31 13:24:59 +0100 | [diff] [blame] | 20 | |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 21 | #include <app.hpp> |
Ed Tanous | ace85d6 | 2021-10-26 12:45:59 -0700 | [diff] [blame] | 22 | #include <http/utility.hpp> |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 23 | #include <query.hpp> |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 24 | #include <registries/privilege_registry.hpp> |
Ed Tanous | 840098b | 2022-06-28 12:06:17 -0700 | [diff] [blame] | 25 | #include <utils/json_utils.hpp> |
John Edward Broadbent | 7e860f1 | 2021-04-08 15:57:16 -0700 | [diff] [blame] | 26 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 27 | namespace redfish |
| 28 | { |
Kowalski, Kamil | 2b7981f | 2018-01-31 13:24:59 +0100 | [diff] [blame] | 29 | |
Ed Tanous | 4f48d5f | 2021-06-21 08:27:45 -0700 | [diff] [blame] | 30 | inline void fillSessionObject(crow::Response& res, |
| 31 | const persistent_data::UserSession& session) |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 32 | { |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 33 | res.jsonValue["Id"] = session.uniqueId; |
| 34 | res.jsonValue["UserName"] = session.username; |
| 35 | res.jsonValue["@odata.id"] = |
| 36 | "/redfish/v1/SessionService/Sessions/" + session.uniqueId; |
| 37 | res.jsonValue["@odata.type"] = "#Session.v1_3_0.Session"; |
| 38 | res.jsonValue["Name"] = "User Session"; |
| 39 | res.jsonValue["Description"] = "Manager User Session"; |
| 40 | res.jsonValue["ClientOriginIPAddress"] = session.clientIp; |
Sunitha Harish | c0ea7ae | 2020-10-30 02:37:30 -0500 | [diff] [blame] | 41 | #ifdef BMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 42 | res.jsonValue["Oem"]["OpenBMC"]["@odata.type"] = |
| 43 | "#OemSession.v1_0_0.Session"; |
| 44 | res.jsonValue["Oem"]["OpenBMC"]["ClientID"] = session.clientId; |
Sunitha Harish | 08bdcc7 | 2020-05-12 05:17:57 -0500 | [diff] [blame] | 45 | #endif |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 46 | } |
Kowalski, Kamil | 2b7981f | 2018-01-31 13:24:59 +0100 | [diff] [blame] | 47 | |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 48 | inline void |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 49 | handleSessionGet(crow::App& app, const crow::Request& req, |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 50 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 51 | const std::string& sessionId) |
| 52 | { |
Carson Labrado | 3ba0007 | 2022-06-06 19:40:56 +0000 | [diff] [blame] | 53 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 54 | { |
| 55 | return; |
| 56 | } |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 57 | // Note that control also reaches here via doPost and doDelete. |
| 58 | auto session = |
| 59 | persistent_data::SessionStore::getInstance().getSessionByUid(sessionId); |
| 60 | |
| 61 | if (session == nullptr) |
| 62 | { |
| 63 | messages::resourceNotFound(asyncResp->res, "Session", sessionId); |
| 64 | return; |
| 65 | } |
| 66 | |
| 67 | fillSessionObject(asyncResp->res, *session); |
| 68 | } |
| 69 | |
| 70 | inline void |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 71 | handleSessionDelete(crow::App& app, const crow::Request& req, |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 72 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, |
| 73 | const std::string& sessionId) |
| 74 | { |
Carson Labrado | 3ba0007 | 2022-06-06 19:40:56 +0000 | [diff] [blame] | 75 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 76 | { |
| 77 | return; |
| 78 | } |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 79 | auto session = |
| 80 | persistent_data::SessionStore::getInstance().getSessionByUid(sessionId); |
| 81 | |
| 82 | if (session == nullptr) |
| 83 | { |
| 84 | messages::resourceNotFound(asyncResp->res, "Session", sessionId); |
| 85 | return; |
| 86 | } |
| 87 | |
| 88 | // Perform a proper ConfigureSelf authority check. If a |
| 89 | // session is being used to DELETE some other user's session, |
| 90 | // then the ConfigureSelf privilege does not apply. In that |
| 91 | // case, perform the authority check again without the user's |
| 92 | // ConfigureSelf privilege. |
wukaihua-fii-na | 0fd2986 | 2022-05-18 09:19:16 +0800 | [diff] [blame] | 93 | if (req.session != nullptr && !session->username.empty() && |
| 94 | session->username != req.session->username) |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 95 | { |
| 96 | Privileges effectiveUserPrivileges = |
| 97 | redfish::getUserPrivileges(req.userRole); |
| 98 | |
| 99 | if (!effectiveUserPrivileges.isSupersetOf({"ConfigureUsers"})) |
| 100 | { |
| 101 | messages::insufficientPrivilege(asyncResp->res); |
| 102 | return; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | persistent_data::SessionStore::getInstance().removeSession(session); |
| 107 | messages::success(asyncResp->res); |
| 108 | } |
| 109 | |
| 110 | inline nlohmann::json getSessionCollectionMembers() |
| 111 | { |
| 112 | std::vector<const std::string*> sessionIds = |
| 113 | persistent_data::SessionStore::getInstance().getUniqueIds( |
| 114 | false, persistent_data::PersistenceType::TIMEOUT); |
| 115 | nlohmann::json ret = nlohmann::json::array(); |
| 116 | for (const std::string* uid : sessionIds) |
| 117 | { |
Ed Tanous | 1476687 | 2022-03-15 10:44:42 -0700 | [diff] [blame] | 118 | nlohmann::json::object_t session; |
| 119 | session["@odata.id"] = "/redfish/v1/SessionService/Sessions/" + *uid; |
| 120 | ret.push_back(std::move(session)); |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 121 | } |
| 122 | return ret; |
| 123 | } |
| 124 | |
| 125 | inline void handleSessionCollectionGet( |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 126 | crow::App& app, const crow::Request& req, |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 127 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) |
| 128 | { |
Carson Labrado | 3ba0007 | 2022-06-06 19:40:56 +0000 | [diff] [blame] | 129 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 130 | { |
| 131 | return; |
| 132 | } |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 133 | asyncResp->res.jsonValue["Members"] = getSessionCollectionMembers(); |
| 134 | asyncResp->res.jsonValue["Members@odata.count"] = |
| 135 | asyncResp->res.jsonValue["Members"].size(); |
| 136 | asyncResp->res.jsonValue["@odata.type"] = |
| 137 | "#SessionCollection.SessionCollection"; |
| 138 | asyncResp->res.jsonValue["@odata.id"] = |
| 139 | "/redfish/v1/SessionService/Sessions/"; |
| 140 | asyncResp->res.jsonValue["Name"] = "Session Collection"; |
| 141 | asyncResp->res.jsonValue["Description"] = "Session Collection"; |
| 142 | } |
| 143 | |
| 144 | inline void handleSessionCollectionMembersGet( |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 145 | crow::App& app, const crow::Request& req, |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 146 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) |
| 147 | { |
Carson Labrado | 3ba0007 | 2022-06-06 19:40:56 +0000 | [diff] [blame] | 148 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 149 | { |
| 150 | return; |
| 151 | } |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 152 | asyncResp->res.jsonValue = getSessionCollectionMembers(); |
| 153 | } |
| 154 | |
Ed Tanous | 4ee8e21 | 2022-05-28 09:42:51 -0700 | [diff] [blame] | 155 | inline void handleSessionCollectionPost( |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 156 | crow::App& app, const crow::Request& req, |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 157 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) |
| 158 | { |
Carson Labrado | 3ba0007 | 2022-06-06 19:40:56 +0000 | [diff] [blame] | 159 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 160 | { |
| 161 | return; |
| 162 | } |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 163 | std::string username; |
| 164 | std::string password; |
| 165 | std::optional<nlohmann::json> oemObject; |
| 166 | std::string clientId; |
| 167 | if (!json_util::readJsonPatch(req, asyncResp->res, "UserName", username, |
| 168 | "Password", password, "Oem", oemObject)) |
| 169 | { |
| 170 | return; |
| 171 | } |
| 172 | |
| 173 | if (password.empty() || username.empty() || |
| 174 | asyncResp->res.result() != boost::beast::http::status::ok) |
| 175 | { |
| 176 | if (username.empty()) |
| 177 | { |
| 178 | messages::propertyMissing(asyncResp->res, "UserName"); |
| 179 | } |
| 180 | |
| 181 | if (password.empty()) |
| 182 | { |
| 183 | messages::propertyMissing(asyncResp->res, "Password"); |
| 184 | } |
| 185 | |
| 186 | return; |
| 187 | } |
| 188 | |
| 189 | int pamrc = pamAuthenticateUser(username, password); |
| 190 | bool isConfigureSelfOnly = pamrc == PAM_NEW_AUTHTOK_REQD; |
| 191 | if ((pamrc != PAM_SUCCESS) && !isConfigureSelfOnly) |
| 192 | { |
| 193 | messages::resourceAtUriUnauthorized(asyncResp->res, req.urlView, |
| 194 | "Invalid username or password"); |
| 195 | return; |
| 196 | } |
| 197 | #ifdef BMCWEB_ENABLE_IBM_MANAGEMENT_CONSOLE |
| 198 | if (oemObject) |
| 199 | { |
| 200 | std::optional<nlohmann::json> bmcOem; |
| 201 | if (!json_util::readJson(*oemObject, asyncResp->res, "OpenBMC", bmcOem)) |
| 202 | { |
| 203 | return; |
| 204 | } |
| 205 | if (!json_util::readJson(*bmcOem, asyncResp->res, "ClientID", clientId)) |
| 206 | { |
| 207 | BMCWEB_LOG_ERROR << "Could not read ClientId"; |
| 208 | return; |
| 209 | } |
| 210 | } |
| 211 | #endif |
| 212 | |
| 213 | // User is authenticated - create session |
| 214 | std::shared_ptr<persistent_data::UserSession> session = |
| 215 | persistent_data::SessionStore::getInstance().generateUserSession( |
| 216 | username, req.ipAddress, clientId, |
| 217 | persistent_data::PersistenceType::TIMEOUT, isConfigureSelfOnly); |
Brad Bishop | 02e53ae | 2022-07-29 14:38:40 -0400 | [diff] [blame^] | 218 | if (session == nullptr) |
| 219 | { |
| 220 | messages::internalError(asyncResp->res); |
| 221 | return; |
| 222 | } |
| 223 | |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 224 | asyncResp->res.addHeader("X-Auth-Token", session->sessionToken); |
| 225 | asyncResp->res.addHeader( |
| 226 | "Location", "/redfish/v1/SessionService/Sessions/" + session->uniqueId); |
| 227 | asyncResp->res.result(boost::beast::http::status::created); |
| 228 | if (session->isConfigureSelfOnly) |
| 229 | { |
| 230 | messages::passwordChangeRequired( |
| 231 | asyncResp->res, |
| 232 | crow::utility::urlFromPieces("redfish", "v1", "AccountService", |
| 233 | "Accounts", req.session->username)); |
| 234 | } |
| 235 | |
| 236 | fillSessionObject(asyncResp->res, *session); |
| 237 | } |
| 238 | inline void |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 239 | handleSessionServiceGet(crow::App& app, const crow::Request& req, |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 240 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) |
| 241 | |
| 242 | { |
Carson Labrado | 3ba0007 | 2022-06-06 19:40:56 +0000 | [diff] [blame] | 243 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 244 | { |
| 245 | return; |
| 246 | } |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 247 | asyncResp->res.jsonValue["@odata.type"] = |
| 248 | "#SessionService.v1_0_2.SessionService"; |
| 249 | asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/SessionService/"; |
| 250 | asyncResp->res.jsonValue["Name"] = "Session Service"; |
| 251 | asyncResp->res.jsonValue["Id"] = "SessionService"; |
| 252 | asyncResp->res.jsonValue["Description"] = "Session Service"; |
| 253 | asyncResp->res.jsonValue["SessionTimeout"] = |
| 254 | persistent_data::SessionStore::getInstance().getTimeoutInSeconds(); |
| 255 | asyncResp->res.jsonValue["ServiceEnabled"] = true; |
| 256 | |
Ed Tanous | 1476687 | 2022-03-15 10:44:42 -0700 | [diff] [blame] | 257 | asyncResp->res.jsonValue["Sessions"]["@odata.id"] = |
| 258 | "/redfish/v1/SessionService/Sessions"; |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | inline void handleSessionServicePatch( |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 262 | crow::App& app, const crow::Request& req, |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 263 | const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) |
| 264 | { |
Carson Labrado | 3ba0007 | 2022-06-06 19:40:56 +0000 | [diff] [blame] | 265 | if (!redfish::setUpRedfishRoute(app, req, asyncResp)) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 266 | { |
| 267 | return; |
| 268 | } |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 269 | std::optional<int64_t> sessionTimeout; |
| 270 | if (!json_util::readJsonPatch(req, asyncResp->res, "SessionTimeout", |
| 271 | sessionTimeout)) |
| 272 | { |
| 273 | return; |
| 274 | } |
| 275 | |
| 276 | if (sessionTimeout) |
| 277 | { |
| 278 | // The mininum & maximum allowed values for session timeout |
| 279 | // are 30 seconds and 86400 seconds respectively as per the |
| 280 | // session service schema mentioned at |
| 281 | // https://redfish.dmtf.org/schemas/v1/SessionService.v1_1_7.json |
| 282 | |
| 283 | if (*sessionTimeout <= 86400 && *sessionTimeout >= 30) |
| 284 | { |
| 285 | std::chrono::seconds sessionTimeoutInseconds(*sessionTimeout); |
| 286 | persistent_data::SessionStore::getInstance().updateSessionTimeout( |
| 287 | sessionTimeoutInseconds); |
| 288 | messages::propertyValueModified(asyncResp->res, "SessionTimeOut", |
| 289 | std::to_string(*sessionTimeout)); |
| 290 | } |
| 291 | else |
| 292 | { |
| 293 | messages::propertyValueNotInList(asyncResp->res, |
| 294 | std::to_string(*sessionTimeout), |
| 295 | "SessionTimeOut"); |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 300 | inline void requestRoutesSession(App& app) |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 301 | { |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 302 | BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/<str>/") |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 303 | .privileges(redfish::privileges::getSession) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 304 | .methods(boost::beast::http::verb::get)( |
| 305 | std::bind_front(handleSessionGet, std::ref(app))); |
Kowalski, Kamil | 2b7981f | 2018-01-31 13:24:59 +0100 | [diff] [blame] | 306 | |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 307 | BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/<str>/") |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 308 | .privileges(redfish::privileges::deleteSession) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 309 | .methods(boost::beast::http::verb::delete_)( |
| 310 | std::bind_front(handleSessionDelete, std::ref(app))); |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 311 | |
| 312 | BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/") |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 313 | .privileges(redfish::privileges::getSessionCollection) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 314 | .methods(boost::beast::http::verb::get)( |
| 315 | std::bind_front(handleSessionCollectionGet, std::ref(app))); |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 316 | |
Ed Tanous | e76cd86 | 2022-03-14 09:12:00 -0700 | [diff] [blame] | 317 | // Note, the next two routes technically don't match the privilege |
Ed Tanous | 724340d | 2022-03-14 09:10:07 -0700 | [diff] [blame] | 318 | // registry given the way login mechanisms work. The base privilege |
| 319 | // registry lists this endpoint as requiring login privilege, but because |
| 320 | // this is the endpoint responsible for giving the login privilege, and it |
| 321 | // is itself its own route, it needs to not require Login |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 322 | BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/") |
| 323 | .privileges({}) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 324 | .methods(boost::beast::http::verb::post)( |
| 325 | std::bind_front(handleSessionCollectionPost, std::ref(app))); |
Kowalski, Kamil | 2b7981f | 2018-01-31 13:24:59 +0100 | [diff] [blame] | 326 | |
Ed Tanous | e76cd86 | 2022-03-14 09:12:00 -0700 | [diff] [blame] | 327 | BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/Members/") |
| 328 | .privileges({}) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 329 | .methods(boost::beast::http::verb::post)( |
| 330 | std::bind_front(handleSessionCollectionPost, std::ref(app))); |
Ed Tanous | e76cd86 | 2022-03-14 09:12:00 -0700 | [diff] [blame] | 331 | |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 332 | BMCWEB_ROUTE(app, "/redfish/v1/SessionService/") |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 333 | .privileges(redfish::privileges::getSessionService) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 334 | .methods(boost::beast::http::verb::get)( |
| 335 | std::bind_front(handleSessionServiceGet, std::ref(app))); |
Borawski.Lukasz | 5d27b85 | 2018-02-08 13:24:24 +0100 | [diff] [blame] | 336 | |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 337 | BMCWEB_ROUTE(app, "/redfish/v1/SessionService/") |
Ed Tanous | ed39821 | 2021-06-09 17:05:54 -0700 | [diff] [blame] | 338 | .privileges(redfish::privileges::patchSessionService) |
Ed Tanous | 45ca1b8 | 2022-03-25 13:07:27 -0700 | [diff] [blame] | 339 | .methods(boost::beast::http::verb::patch)( |
| 340 | std::bind_front(handleSessionServicePatch, std::ref(app))); |
Ed Tanous | faa34cc | 2021-06-03 13:27:02 -0700 | [diff] [blame] | 341 | } |
Borawski.Lukasz | 5d27b85 | 2018-02-08 13:24:24 +0100 | [diff] [blame] | 342 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 343 | } // namespace redfish |