summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy1
-rw-r--r--http/routing.hpp43
-rw-r--r--include/cors_preflight.hpp4
-rw-r--r--include/ibm/locks.hpp30
-rw-r--r--redfish-core/include/privileges.hpp21
-rw-r--r--redfish-core/include/utils/json_utils.hpp9
-rw-r--r--redfish-core/lib/bios.hpp4
-rw-r--r--redfish-core/lib/message_registries.hpp9
-rw-r--r--redfish-core/lib/service_root.hpp2
-rw-r--r--redfish-core/lib/telemetry_service.hpp3
10 files changed, 58 insertions, 68 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 516ffefadf..ffb6b06fe2 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -273,6 +273,7 @@ readability-container-size-empty,
readability-delete-null-pointer,
readability-deleted-default,
readability-else-after-return,
+readability-named-parameter,
readability-identifier-naming'
WarningsAsErrors: '*'
diff --git a/http/routing.hpp b/http/routing.hpp
index a7c0ced992..9cd3d7b3f6 100644
--- a/http/routing.hpp
+++ b/http/routing.hpp
@@ -49,19 +49,19 @@ class BaseRule
return {};
}
- virtual void handle(const Request&,
+ virtual void handle(const Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>&,
const RoutingParams&) = 0;
- virtual void handleUpgrade(const Request&, Response& res,
- boost::asio::ip::tcp::socket&&)
+ virtual void handleUpgrade(const Request& /*req*/, Response& res,
+ boost::asio::ip::tcp::socket&& /*adaptor*/)
{
res.result(boost::beast::http::status::not_found);
res.end();
}
#ifdef BMCWEB_ENABLE_SSL
- virtual void
- handleUpgrade(const Request&, Response& res,
- boost::beast::ssl_stream<boost::asio::ip::tcp::socket>&&)
+ virtual void handleUpgrade(
+ const Request& /*req*/, Response& res,
+ boost::beast::ssl_stream<boost::asio::ip::tcp::socket>&& /*adaptor*/)
{
res.result(boost::beast::http::status::not_found);
res.end();
@@ -211,7 +211,8 @@ struct Wrapped
!std::is_same<
typename std::tuple_element<0, std::tuple<Args..., void>>::type,
const Request&>::value,
- int>::type = 0)
+ int>::type /*enable*/
+ = 0)
{
handler = [f = std::forward<Func>(f)](
const Request&,
@@ -245,7 +246,8 @@ struct Wrapped
!std::is_same<typename std::tuple_element<
1, std::tuple<Args..., void, void>>::type,
const std::shared_ptr<bmcweb::AsyncResp>&>::value,
- int>::type = 0)
+ int>::type /*enable*/
+ = 0)
{
handler = ReqHandlerWrapper<Args...>(std::move(f));
/*handler = (
@@ -266,7 +268,8 @@ struct Wrapped
std::is_same<typename std::tuple_element<
1, std::tuple<Args..., void, void>>::type,
const std::shared_ptr<bmcweb::AsyncResp>&>::value,
- int>::type = 0)
+ int>::type /*enable*/
+ = 0)
{
handler = std::move(f);
}
@@ -275,8 +278,8 @@ struct Wrapped
struct HandlerTypeHelper
{
using type = std::function<void(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>&,
- Args...)>;
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>&, Args...)>;
using args_type =
black_magic::S<typename black_magic::PromoteT<Args>...>;
};
@@ -285,8 +288,8 @@ struct Wrapped
struct HandlerTypeHelper<const Request&, Args...>
{
using type = std::function<void(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>&,
- Args...)>;
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>&, Args...)>;
using args_type =
black_magic::S<typename black_magic::PromoteT<Args>...>;
};
@@ -296,8 +299,8 @@ struct Wrapped
const std::shared_ptr<bmcweb::AsyncResp>&, Args...>
{
using type = std::function<void(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>&,
- Args...)>;
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>&, Args...)>;
using args_type =
black_magic::S<typename black_magic::PromoteT<Args>...>;
};
@@ -330,14 +333,14 @@ class WebSocketRule : public BaseRule
void validate() override
{}
- void handle(const Request&,
+ void handle(const Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const RoutingParams&) override
+ const RoutingParams& /*params*/) override
{
asyncResp->res.result(boost::beast::http::status::not_found);
}
- void handleUpgrade(const Request& req, Response&,
+ void handleUpgrade(const Request& req, Response& /*res*/,
boost::asio::ip::tcp::socket&& adaptor) override
{
std::shared_ptr<
@@ -349,7 +352,7 @@ class WebSocketRule : public BaseRule
myConnection->start();
}
#ifdef BMCWEB_ENABLE_SSL
- void handleUpgrade(const Request& req, Response&,
+ void handleUpgrade(const Request& req, Response& /*res*/,
boost::beast::ssl_stream<boost::asio::ip::tcp::socket>&&
adaptor) override
{
@@ -499,7 +502,7 @@ class DynamicRule : public BaseRule, public RuleParameterTraits<DynamicRule>
std::function<void(const Request&,
const std::shared_ptr<bmcweb::AsyncResp>&,
const RoutingParams&)>
- wrap(Func f, std::integer_sequence<unsigned, Indices...>)
+ wrap(Func f, std::integer_sequence<unsigned, Indices...> /*is*/)
{
using function_t = crow::utility::function_traits<Func>;
diff --git a/include/cors_preflight.hpp b/include/cors_preflight.hpp
index 1cd8564704..29d7475cae 100644
--- a/include/cors_preflight.hpp
+++ b/include/cors_preflight.hpp
@@ -10,8 +10,8 @@ inline void requestRoutes(App& app)
{
BMCWEB_ROUTE(app, "<str>")
.methods(boost::beast::http::verb::options)(
- [](const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>&,
- const std::string&) {
+ [](const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>&, const std::string&) {
// An empty body handler that simply returns the headers bmcweb
// uses This allows browsers to do their CORS preflight checks
});
diff --git a/include/ibm/locks.hpp b/include/ibm/locks.hpp
index 45525bffa2..4434e1f117 100644
--- a/include/ibm/locks.hpp
+++ b/include/ibm/locks.hpp
@@ -51,7 +51,7 @@ class Lock
* Returns : False (if not a Valid lock request)
*/
- virtual bool isValidLockRequest(const LockRequest&);
+ virtual bool isValidLockRequest(const LockRequest& refLockRecord);
/*
* This function implements the logic of checking if the incoming
@@ -61,7 +61,7 @@ class Lock
* Returns : False (if not conflicting)
*/
- virtual bool isConflictRequest(const LockRequests&);
+ virtual bool isConflictRequest(const LockRequests& refLockRequestStructure);
/*
* Implements the core algorithm to find the conflicting
* lock requests.
@@ -72,7 +72,8 @@ class Lock
* Returns : True (if conflicting)
* Returns : False (if not conflicting)
*/
- virtual bool isConflictRecord(const LockRequest&, const LockRequest&);
+ virtual bool isConflictRecord(const LockRequest& refLockRecord1,
+ const LockRequest& refLockRecord2);
/*
* This function implements the logic of checking the conflicting
@@ -81,7 +82,7 @@ class Lock
*
*/
- virtual Rc isConflictWithTable(const LockRequests&);
+ virtual Rc isConflictWithTable(const LockRequests& refLockRequestStructure);
/*
* This function implements the logic of checking the ownership of the
* lock from the releaselock request.
@@ -90,22 +91,22 @@ class Lock
* Returns : False (if the request HMC or Session does not own the lock(s))
*/
- virtual RcRelaseLock isItMyLock(const ListOfTransactionIds&,
- const SessionFlags&);
+ virtual RcRelaseLock isItMyLock(const ListOfTransactionIds& refRids,
+ const SessionFlags& ids);
/*
* This function validates the the list of transactionID's and returns false
* if the transaction ID is not valid & not present in the lock table
*/
- virtual bool validateRids(const ListOfTransactionIds&);
+ virtual bool validateRids(const ListOfTransactionIds& refRids);
/*
* This function releases the locks that are already obtained by the
* requesting Management console.
*/
- void releaseLock(const ListOfTransactionIds&);
+ void releaseLock(const ListOfTransactionIds& refRids);
Lock()
{
@@ -117,7 +118,8 @@ class Lock
* bytes of the resource id based on the lock management algorithm.
*/
- bool checkByte(uint64_t, uint64_t, uint32_t);
+ static bool checkByte(uint64_t resourceId1, uint64_t resourceId2,
+ uint32_t position);
/*
* This functions implements a counter that generates a unique 32 bit
@@ -143,7 +145,7 @@ class Lock
*
*/
- RcAcquireLock acquireLock(const LockRequests&);
+ RcAcquireLock acquireLock(const LockRequests& lockRequestStructure);
/*
* This function implements the logic for releasing the lock that are
@@ -156,21 +158,21 @@ class Lock
* Client can choose either of the ways by using `Type` JSON key.
*
*/
- RcReleaseLockApi releaseLock(const ListOfTransactionIds&,
- const SessionFlags&);
+ RcReleaseLockApi releaseLock(const ListOfTransactionIds& p,
+ const SessionFlags& ids);
/*
* This function implements the logic for getting the list of locks obtained
* by a particular management console.
*/
- RcGetLockList getLockList(const ListOfSessionIds&);
+ RcGetLockList getLockList(const ListOfSessionIds& listSessionId);
/*
* This function is releases all the locks obtained by a particular
* session.
*/
- void releaseLock(const std::string&);
+ void releaseLock(const std::string& sessionId);
static Lock& getInstance()
{
diff --git a/redfish-core/include/privileges.hpp b/redfish-core/include/privileges.hpp
index 23eada632b..f5bc8b68c2 100644
--- a/redfish-core/include/privileges.hpp
+++ b/redfish-core/include/privileges.hpp
@@ -294,25 +294,4 @@ inline bool isMethodAllowedWithPrivileges(const boost::beast::http::verb method,
return isOperationAllowedWithPrivileges(it->second, userPrivileges);
}
-/**
- * @brief Checks if a user is allowed to call an HTTP method
- *
- * @param[in] method HTTP method
- * @param[in] user Username
- *
- * @return True if method allowed, false otherwise
- *
- */
-inline bool isMethodAllowedForUser(const boost::beast::http::verb method,
- const OperationMap& operationMap,
- const std::string&)
-{
- // TODO: load user privileges from configuration as soon as its available
- // now we are granting all privileges to everyone.
- Privileges userPrivileges{"Login", "ConfigureManager", "ConfigureSelf",
- "ConfigureUsers", "ConfigureComponents"};
-
- return isMethodAllowedWithPrivileges(method, operationMap, userPrivileges);
-}
-
} // namespace redfish
diff --git a/redfish-core/include/utils/json_utils.hpp b/redfish-core/include/utils/json_utils.hpp
index 0291fc9851..22577ea228 100644
--- a/redfish-core/include/utils/json_utils.hpp
+++ b/redfish-core/include/utils/json_utils.hpp
@@ -335,8 +335,8 @@ bool unpackValue(nlohmann::json& jsonValue, const std::string& key, Type& value)
}
template <size_t Count, size_t Index>
-bool readJsonValues(const std::string& key, nlohmann::json&,
- crow::Response& res, std::bitset<Count>&)
+bool readJsonValues(const std::string& key, nlohmann::json& /*jsonValue*/,
+ crow::Response& res, std::bitset<Count>& /*handled*/)
{
BMCWEB_LOG_DEBUG << "Unable to find variable for key" << key;
messages::propertyUnknown(res, key);
@@ -368,7 +368,7 @@ bool readJsonValues(const std::string& key, nlohmann::json& jsonValue,
}
template <size_t Index = 0, size_t Count>
-bool handleMissing(std::bitset<Count>&, crow::Response&)
+bool handleMissing(std::bitset<Count>& /*handled*/, crow::Response& /*res*/)
{
return true;
}
@@ -376,7 +376,8 @@ bool handleMissing(std::bitset<Count>&, crow::Response&)
template <size_t Index = 0, size_t Count, typename ValueType,
typename... UnpackTypes>
bool handleMissing(std::bitset<Count>& handled, crow::Response& res,
- const char* key, ValueType&, UnpackTypes&... in)
+ const char* key, ValueType& /*unusedValue*/,
+ UnpackTypes&... in)
{
bool ret = true;
if (!handled.test(Index) && !IsOptional<ValueType>::value)
diff --git a/redfish-core/lib/bios.hpp b/redfish-core/lib/bios.hpp
index c2fb2844f1..d8475aec1f 100644
--- a/redfish-core/lib/bios.hpp
+++ b/redfish-core/lib/bios.hpp
@@ -9,7 +9,7 @@ namespace redfish
* BiosService class supports handle get method for bios.
*/
inline void
- handleBiosServiceGet(const crow::Request&,
+ handleBiosServiceGet(const crow::Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Systems/system/Bios";
@@ -39,7 +39,7 @@ inline void requestRoutesBiosService(App& app)
* Analyzes POST body message before sends Reset request data to D-Bus.
*/
inline void
- handleBiosResetPost(const crow::Request&,
+ handleBiosResetPost(const crow::Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
crow::connections::systemBus->async_method_call(
diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp
index cfa2bf574f..c2848c398b 100644
--- a/redfish-core/lib/message_registries.hpp
+++ b/redfish-core/lib/message_registries.hpp
@@ -28,7 +28,8 @@ namespace redfish
{
inline void handleMessageRegistryFileCollectionGet(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
// Collections don't include the static data added by SubRoute
// because it has a duplicate entry for members
@@ -59,7 +60,8 @@ inline void requestRoutesMessageRegistryFileCollection(App& app)
}
inline void handleMessageRoutesMessageRegistryFileGet(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& registry)
{
const message_registries::Header* header = nullptr;
@@ -123,7 +125,8 @@ inline void requestRoutesMessageRegistryFile(App& app)
}
inline void handleMessageRegistryGet(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& registry, const std::string& registryMatch)
{
diff --git a/redfish-core/lib/service_root.hpp b/redfish-core/lib/service_root.hpp
index 62be63ff76..2a1803d84b 100644
--- a/redfish-core/lib/service_root.hpp
+++ b/redfish-core/lib/service_root.hpp
@@ -24,7 +24,7 @@ namespace redfish
{
inline void
- handleServiceRootGet(const crow::Request&,
+ handleServiceRootGet(const crow::Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp
index c3082d7a01..5457530fbd 100644
--- a/redfish-core/lib/telemetry_service.hpp
+++ b/redfish-core/lib/telemetry_service.hpp
@@ -10,7 +10,8 @@ namespace redfish
{
inline void handleTelemetryServiceGet(
- const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
+ const crow::Request& /*req*/,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
asyncResp->res.jsonValue["@odata.type"] =
"#TelemetryService.v1_2_1.TelemetryService";