1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-12 07:47:12 +01:00

33 lines
843 B
C
Raw Normal View History

2021-03-27 00:18:51 +02:00
#ifndef CPR_AUTH_H
#define CPR_AUTH_H
#include <string>
#include <utility>
namespace cpr {
enum class AuthMode { BASIC, DIGEST, NTLM };
2021-03-27 00:18:51 +02:00
class Authentication {
public:
Authentication(std::string username, std::string password, AuthMode auth_mode) : auth_string_{std::move(username) + ":" + std::move(password)}, auth_mode_{std::move(auth_mode)} {}
2021-03-27 00:18:51 +02:00
Authentication(const Authentication& other) = default;
Authentication(Authentication&& old) noexcept = default;
~Authentication() noexcept;
2021-03-27 00:18:51 +02:00
Authentication& operator=(Authentication&& old) noexcept = default;
Authentication& operator=(const Authentication& other) = default;
const char* GetAuthString() const noexcept;
AuthMode GetAuthMode() const noexcept;
2021-03-27 00:18:51 +02:00
private:
2021-03-27 00:18:51 +02:00
std::string auth_string_;
AuthMode auth_mode_;
2021-03-27 00:18:51 +02:00
};
} // namespace cpr
#endif