Add meson options for all authentication methods.
Add meson options to enabled/disabled authentication methods:
- basic-auth : For enable basic authentication, default is enabled
- session-auth : For enable session token authentication, default is
enabled
- xtoken-auth : For enable x-token authentication, default is enabled
- cookie-auth : For enabled cookie authentication, default is enabled
Signed-off-by: Alan Kuo <Alan_Kuo@quantatw.com>
Change-Id: I52e636f2534a14897cb57d35e563ea8841cc68b9
diff --git a/include/sessions.hpp b/include/sessions.hpp
index 1eace0d..85d8ecc 100644
--- a/include/sessions.hpp
+++ b/include/sessions.hpp
@@ -142,11 +142,35 @@
struct AuthConfigMethods
{
- bool xtoken = true;
- bool cookie = true;
- bool sessionToken = true;
+#ifdef BMCWEB_ENABLE_BASIC_AUTHENTICATION
bool basic = true;
+#else
+ bool basic = false;
+#endif
+
+#ifdef BMCWEB_ENABLE_SESSION_AUTHENTICATION
+ bool sessionToken = true;
+#else
+ bool sessionToken = false;
+#endif
+
+#ifdef BMCWEB_ENABLE_XTOKEN_AUTHENTICATION
+ bool xtoken = true;
+#else
+ bool xtoken = false;
+#endif
+
+#ifdef BMCWEB_ENABLE_COOKIE_AUTHENTICATION
+ bool cookie = true;
+#else
+ bool cookie = false;
+#endif
+
+#ifdef BMCWEB_ENABLE_MUTUAL_TLS_AUTHENTICATION
+ bool tls = true;
+#else
bool tls = false;
+#endif
void fromJson(const nlohmann::json& j)
{