1 | #include "cpr/proxyauth.h" |
---|---|
2 | #include "cpr/util.h" |
3 | |
4 | namespace cpr { |
5 | EncodedAuthentication::~EncodedAuthentication() noexcept { |
6 | util::secureStringClear(s&: auth_string_); |
7 | } |
8 | |
9 | const char* EncodedAuthentication::GetAuthString() const noexcept { |
10 | return auth_string_.c_str(); |
11 | } |
12 | |
13 | bool ProxyAuthentication::has(const std::string& protocol) const { |
14 | return proxyAuth_.count(x: protocol) > 0; |
15 | } |
16 | |
17 | const char* ProxyAuthentication::operator[](const std::string& protocol) { |
18 | return proxyAuth_[protocol].GetAuthString(); |
19 | } |
20 | |
21 | } // namespace cpr |
22 |