2021-07-02 16:44:48 +02:00
|
|
|
#include "cpr/proxyauth.h"
|
2023-08-05 20:31:33 +02:00
|
|
|
#include "cpr/util.h"
|
2021-07-02 16:44:48 +02:00
|
|
|
|
|
|
|
namespace cpr {
|
2023-08-05 20:31:33 +02:00
|
|
|
EncodedAuthentication::~EncodedAuthentication() noexcept {
|
|
|
|
util::secureStringClear(username);
|
|
|
|
util::secureStringClear(password);
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& EncodedAuthentication::GetUsername() const {
|
|
|
|
return username;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& EncodedAuthentication::GetPassword() const {
|
|
|
|
return password;
|
2021-07-02 16:44:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ProxyAuthentication::has(const std::string& protocol) const {
|
|
|
|
return proxyAuth_.count(protocol) > 0;
|
|
|
|
}
|
|
|
|
|
2023-08-05 20:31:33 +02:00
|
|
|
const char* ProxyAuthentication::GetUsername(const std::string& protocol) {
|
|
|
|
return proxyAuth_[protocol].username.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* ProxyAuthentication::GetPassword(const std::string& protocol) {
|
|
|
|
return proxyAuth_[protocol].password.c_str();
|
2021-07-02 16:44:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace cpr
|