diff options
author | Nan Zhou <nanzhoumails@gmail.com> | 2022-05-25 04:15:34 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-05-26 23:26:04 +0300 |
commit | d055a34aeb4072c34d012517ffb5014a1301313a (patch) | |
tree | 2f16ef4af923704bb5173e61053fd8ddac445c43 | |
parent | dfababfc65fb9f07050070910be0cc015df4fd2c (diff) | |
download | bmcweb-d055a34aeb4072c34d012517ffb5014a1301313a.tar.xz |
auth: change authorization.hpp to authentication.hpp
The existing authorization header is actually doing "authentication"
work. The authorization is happening in routing.hpp where we fetch the
role of the authenticated user and get their privilege set.
This commits changes the name of the file, as well as the namespace, to
be more precise on what the file actually does.
Tested:
1. Trivial change, it builds
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ib91ed70507a7308522c7e5363ed2f4dc279a19d9
-rw-r--r-- | http/http_connection.hpp | 8 | ||||
-rw-r--r-- | include/authentication.hpp (renamed from include/authorization.hpp) | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/http/http_connection.hpp b/http/http_connection.hpp index 339294ce55..564593c081 100644 --- a/http/http_connection.hpp +++ b/http/http_connection.hpp @@ -1,7 +1,7 @@ #pragma once #include "bmcweb_config.h" -#include "authorization.hpp" +#include "authentication.hpp" #include "http_response.hpp" #include "http_utility.hpp" #include "logging.hpp" @@ -356,7 +356,7 @@ class Connection : return; } #ifndef BMCWEB_INSECURE_DISABLE_AUTHENTICATION - if (!crow::authorization::isOnAllowlist(req->url, req->method()) && + if (!crow::authentication::isOnAllowlist(req->url, req->method()) && thisReq.session == nullptr) { BMCWEB_LOG_WARNING << "Authentication failed"; @@ -435,7 +435,7 @@ class Connection : addSecurityHeaders(*req, res); - crow::authorization::cleanupTempSession(*req); + crow::authentication::cleanupTempSession(*req); if (!isAlive()) { @@ -577,7 +577,7 @@ class Connection : sessionIsFromTransport = false; #ifndef BMCWEB_INSECURE_DISABLE_AUTHENTICATION boost::beast::http::verb method = parser->get().method(); - userSession = crow::authorization::authenticate( + userSession = crow::authentication::authenticate( ip, res, method, parser->get().base(), userSession); bool loggedIn = userSession != nullptr; diff --git a/include/authorization.hpp b/include/authentication.hpp index d50695b1a8..3c1ca484d9 100644 --- a/include/authorization.hpp +++ b/include/authentication.hpp @@ -18,7 +18,7 @@ namespace crow { -namespace authorization +namespace authentication { static void cleanupTempSession(Request& req) @@ -311,5 +311,5 @@ static std::shared_ptr<persistent_data::UserSession> return nullptr; } -} // namespace authorization +} // namespace authentication } // namespace crow |