fix link error
This commit is contained in:
@@ -23,20 +23,16 @@
|
|||||||
#define REPERTORY_INCLUDE_RPC_COMMON_HPP_
|
#define REPERTORY_INCLUDE_RPC_COMMON_HPP_
|
||||||
|
|
||||||
#include "utils/base64.hpp"
|
#include "utils/base64.hpp"
|
||||||
#include "utils/collection.hpp"
|
|
||||||
#include "utils/error_utils.hpp"
|
#include "utils/error_utils.hpp"
|
||||||
#include "utils/hash.hpp"
|
|
||||||
#include "utils/string.hpp"
|
#include "utils/string.hpp"
|
||||||
|
|
||||||
namespace repertory::rpc {
|
namespace repertory::rpc {
|
||||||
[[nodiscard]] auto create_password_hash(std::string_view password)
|
[[nodiscard]] auto create_password_hash(std::string_view password)
|
||||||
-> std::string {
|
-> std::string;
|
||||||
return utils::collection::to_hex_string(
|
|
||||||
utils::encryption::create_hash_blake2b_384(password));
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] auto check_authorization(const auto &cfg,
|
[[nodiscard]] inline auto check_authorization(const auto &cfg,
|
||||||
const httplib::Request &req) -> bool {
|
const httplib::Request &req)
|
||||||
|
-> bool {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
if (cfg.get_api_password().empty() || cfg.get_api_user().empty()) {
|
if (cfg.get_api_password().empty() || cfg.get_api_user().empty()) {
|
||||||
|
11
repertory/librepertory/src/rpc/common.cpp
Normal file
11
repertory/librepertory/src/rpc/common.cpp
Normal file
@@ -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
|
Reference in New Issue
Block a user