summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNan Zhou <nanzhoumails@gmail.com>2022-07-13 02:21:02 +0300
committerEd Tanous <ed@tanous.net>2022-07-26 05:40:24 +0300
commit3acced2ce93ab735f147ba8204afcc18bdc0c3ea (patch)
tree580d435127a6714f7eebebdee695945a65524e90
parent45248ba327bcf330fd2e49f90a59159fdf8ebecc (diff)
downloadbmcweb-3acced2ce93ab735f147ba8204afcc18bdc0c3ea.tar.xz
authn: correct meson behaviors
Today `basic-auth` (and other options) can be enabled even if `insecure-disable-auth` is enabled, which doesn't make sense. With this block this commit added in meson, If we disable authx with `insecure-disable-auth`, then all these auth options will be ignored. Tested: 1. code compiles with and without 'insecure-disable-auth'. 2. No new service validator errors when 'insecure-disable-auth' is turned on. 3. No new service validator errors when 'insecure-disable-auth' is turned off. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I2c634851f7aa7b9e57158770c5d40c12954c93a7
-rw-r--r--include/authentication.hpp3
-rw-r--r--meson.build5
2 files changed, 7 insertions, 1 deletions
diff --git a/include/authentication.hpp b/include/authentication.hpp
index ac2a7d14a7..6a9e6ad69b 100644
--- a/include/authentication.hpp
+++ b/include/authentication.hpp
@@ -260,7 +260,8 @@ static std::shared_ptr<persistent_data::UserSession>
[[maybe_unused]] static std::shared_ptr<persistent_data::UserSession>
authenticate(
const boost::asio::ip::address& ipAddress [[maybe_unused]],
- Response& res [[maybe_unused]], boost::beast::http::verb method,
+ Response& res [[maybe_unused]],
+ boost::beast::http::verb method [[maybe_unused]],
const boost::beast::http::header<true>& reqHeader,
[[maybe_unused]] const std::shared_ptr<persistent_data::UserSession>&
session)
diff --git a/meson.build b/meson.build
index 7be259b44f..ec7051053e 100644
--- a/meson.build
+++ b/meson.build
@@ -101,6 +101,11 @@ foreach option_key,option_value : feature_map
add_project_arguments(option_value,language:'cpp')
summary(option_key,option_value, section : 'Enabled Features')
endif
+ elif (option_key in ['basic-auth', 'cookie-auth', 'session-auth', 'xtoken-auth', 'mutual-tls-auth'])
+ if (get_option('insecure-disable-auth').disabled())
+ add_project_arguments(option_value, language:'cpp')
+ summary(option_key,option_value, section : 'Enabled Features')
+ endif
else
summary(option_key,option_value, section : 'Enabled Features')
add_project_arguments(option_value,language:'cpp')