mirror of
https://github.com/XRPLF/clio.git
synced 2026-04-29 15:37:53 +00:00
feat: Proxy support (#2490)
Add client IP resolving support in case when there is a proxy in front of Clio.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "web/AdminVerificationStrategy.hpp"
|
||||
|
||||
#include "util/JsonUtils.hpp"
|
||||
#include "util/Shasum.hpp"
|
||||
#include "util/config/ConfigDefinition.hpp"
|
||||
|
||||
#include <boost/beast/http/field.hpp>
|
||||
@@ -42,15 +43,8 @@ IPAdminVerificationStrategy::isAdmin(RequestHeader const&, std::string_view ip)
|
||||
}
|
||||
|
||||
PasswordAdminVerificationStrategy::PasswordAdminVerificationStrategy(std::string const& password)
|
||||
: passwordSha256_(util::toUpper(util::sha256sumString(password)))
|
||||
{
|
||||
ripple::sha256_hasher hasher;
|
||||
hasher(password.data(), password.size());
|
||||
auto const d = static_cast<ripple::sha256_hasher::result_type>(hasher);
|
||||
ripple::uint256 sha256;
|
||||
std::memcpy(sha256.data(), d.data(), d.size());
|
||||
passwordSha256_ = ripple::to_string(sha256);
|
||||
// make sure it's uppercase
|
||||
passwordSha256_ = util::toUpper(std::move(passwordSha256_));
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user