diff --git a/repertory/librepertory/include/rpc/common.hpp b/repertory/librepertory/include/rpc/common.hpp index 85e40a5a..bb9a27fc 100644 --- a/repertory/librepertory/include/rpc/common.hpp +++ b/repertory/librepertory/include/rpc/common.hpp @@ -23,20 +23,16 @@ #define REPERTORY_INCLUDE_RPC_COMMON_HPP_ #include "utils/base64.hpp" -#include "utils/collection.hpp" #include "utils/error_utils.hpp" -#include "utils/hash.hpp" #include "utils/string.hpp" namespace repertory::rpc { [[nodiscard]] auto create_password_hash(std::string_view password) - -> std::string { - return utils::collection::to_hex_string( - utils::encryption::create_hash_blake2b_384(password)); -} + -> std::string; -[[nodiscard]] auto check_authorization(const auto &cfg, - const httplib::Request &req) -> bool { +[[nodiscard]] inline auto check_authorization(const auto &cfg, + const httplib::Request &req) + -> bool { REPERTORY_USES_FUNCTION_NAME(); if (cfg.get_api_password().empty() || cfg.get_api_user().empty()) { diff --git a/repertory/librepertory/src/rpc/common.cpp b/repertory/librepertory/src/rpc/common.cpp new file mode 100644 index 00000000..f6140fd2 --- /dev/null +++ b/repertory/librepertory/src/rpc/common.cpp @@ -0,0 +1,11 @@ +#include "rpc/common.hpp" + +#include "utils/collection.hpp" +#include "utils/hash.hpp" + +namespace repertory::rpc { +auto create_password_hash(std::string_view password) -> std::string { + return utils::collection::to_hex_string( + utils::encryption::create_hash_blake2b_384(password)); +} +} // namespace repertory::rpc