Boost beast
This commit is the beginings of attempting to transition away from
crow, and toward boost::beast. Unit tests are passing, and
implementation appears to be slightly faster than crow.
Change-Id: Ic8d946dc7a04f514c67b1098f181eee1ced69171
diff --git a/redfish-core/include/privileges.hpp b/redfish-core/include/privileges.hpp
index 1341f36..e98debb 100644
--- a/redfish-core/include/privileges.hpp
+++ b/redfish-core/include/privileges.hpp
@@ -157,8 +157,8 @@
std::bitset<MAX_PRIVILEGE_COUNT> privilegeBitset = 0;
};
-using OperationMap =
- boost::container::flat_map<crow::HTTPMethod, std::vector<Privileges>>;
+using OperationMap = boost::container::flat_map<boost::beast::http::verb,
+ std::vector<Privileges>>;
/**
* @brief Checks if given privileges allow to call an HTTP method
@@ -169,7 +169,7 @@
* @return True if method allowed, false otherwise
*
*/
-inline bool isMethodAllowedWithPrivileges(const crow::HTTPMethod method,
+inline bool isMethodAllowedWithPrivileges(const boost::beast::http::verb method,
const OperationMap& operationMap,
const Privileges& userPrivileges) {
const auto& it = operationMap.find(method);
@@ -199,7 +199,7 @@
* @return True if method allowed, false otherwise
*
*/
-inline bool isMethodAllowedForUser(const crow::HTTPMethod method,
+inline bool isMethodAllowedForUser(const boost::beast::http::verb method,
const OperationMap& operationMap,
const std::string& user) {
// TODO: load user privileges from configuration as soon as its available