summaryrefslogtreecommitdiff
path: root/http/app.hpp
diff options
context:
space:
mode:
authorP Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>2021-09-17 22:49:04 +0300
committerEd Tanous <ed@tanous.net>2023-03-15 00:23:02 +0300
commit7e9093e625961f533250a6c193c1a474e98007c4 (patch)
treedef70a389a02ff981fd81958652f45204e1e5be1 /http/app.hpp
parent4f10f7e3f7c8b3d67803f691d3a0b394b9bccfc1 (diff)
downloadbmcweb-7e9093e625961f533250a6c193c1a474e98007c4.tar.xz
Add Support for privilege check in handleUpgrade
This commit enables privilege check for user(s) in case of upgraded connections. Currently users with no privileges will also be able to access Websockets connections (Ex: KVM). The privilege check was already in place for normal connections (i.e. router->handle()). This commit lifts off the privilege check code and moves it into a common function (validatePrivilege()), which can be used both by handle() and handleUpgrade() and register required callback to be called. Also, the const qualifier for Request in the handleUpgrade() function's signature is removed to enable setting "isConfigureSelf" field of request. The signature of handleUpgrade() is made identical to handle() Tested: - websocket_test.py Passed - Admin and Operator users are able to access KVM on WebUI - Readonly User was unable to access KVM on WebUI Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> Change-Id: I6f743c27e7e6077f1c6c56e6958922027e4404e8
Diffstat (limited to 'http/app.hpp')
-rw-r--r--http/app.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/http/app.hpp b/http/app.hpp
index a2892ced94..60c2215a29 100644
--- a/http/app.hpp
+++ b/http/app.hpp
@@ -58,7 +58,7 @@ class App
App& operator=(const App&&) = delete;
template <typename Adaptor>
- void handleUpgrade(const Request& req,
+ void handleUpgrade(Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
Adaptor&& adaptor)
{