authentication.hpp (38221509e6cc06a6897e8b9b2aa049a70c033840) | authentication.hpp (8f5df132a70b47c2f299cb216812ec83d4fc1197) |
---|---|
1#pragma once 2 3#include "forward_unauthorized.hpp" 4#include "http_request.hpp" 5#include "http_response.hpp" 6#include "http_utility.hpp" 7#include "pam_authenticate.hpp" 8#include "webroutes.hpp" --- 204 unchanged lines hidden (view full) --- 213 return nullptr; 214} 215 216// checks if request can be forwarded without authentication 217inline bool isOnAllowlist(std::string_view url, boost::beast::http::verb method) 218{ 219 // Handle the case where the router registers routes as both ending with / 220 // and not. | 1#pragma once 2 3#include "forward_unauthorized.hpp" 4#include "http_request.hpp" 5#include "http_response.hpp" 6#include "http_utility.hpp" 7#include "pam_authenticate.hpp" 8#include "webroutes.hpp" --- 204 unchanged lines hidden (view full) --- 213 return nullptr; 214} 215 216// checks if request can be forwarded without authentication 217inline bool isOnAllowlist(std::string_view url, boost::beast::http::verb method) 218{ 219 // Handle the case where the router registers routes as both ending with / 220 // and not. |
221 if (url.ends_with('/')) | 221 if (url.ends_with('/') && url != "/") |
222 { 223 url.remove_suffix(1); 224 } 225 if (boost::beast::http::verb::get == method) 226 { 227 if ((url == "/redfish") || // 228 (url == "/redfish/v1") || // 229 (url == "/redfish/v1/odata") || // --- 85 unchanged lines hidden --- | 222 { 223 url.remove_suffix(1); 224 } 225 if (boost::beast::http::verb::get == method) 226 { 227 if ((url == "/redfish") || // 228 (url == "/redfish/v1") || // 229 (url == "/redfish/v1/odata") || // --- 85 unchanged lines hidden --- |