lintel 0.2.0
Loading...
Searching...
No Matches
ClientIpResolver.h
Go to the documentation of this file.
1#ifndef LINTEL_CLIENTIPRESOLVER_H
2#define LINTEL_CLIENTIPRESOLVER_H
3
4#include <string>
5#include <vector>
6
7namespace lintel {
17{
18public:
19 ClientIpResolver() = default;
20
22 explicit ClientIpResolver(std::vector<std::string> trustedProxies);
23
25 void setTrustedProxies(std::vector<std::string> trustedProxies);
26
34 std::string resolveClientIp(const std::string &remoteAddress, const std::string &forwardedFor) const;
35
36private:
38 [[nodiscard]] bool isTrustedPeer(const std::string &remoteAddress) const;
39
40 std::vector<std::string> m_trustedProxies;
41};
42
43}// namespace lintel
44#endif// LINTEL_CLIENTIPRESOLVER_H
Definition ClientIpResolver.h:17
std::string resolveClientIp(const std::string &remoteAddress, const std::string &forwardedFor) const
ClientIpResolver(std::vector< std::string > trustedProxies)
void setTrustedProxies(std::vector< std::string > trustedProxies)
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9