7 #ifndef HTTP_BASIC_AUTH_CONFIG_H
8 #define HTTP_BASIC_AUTH_CONFIG_H
13 #include <unordered_map>
36 const std::string& password,
49 const std::string& user_file,
50 const std::string& password,
51 const std::string& password_file,
52 bool password_file_only,
80 return (password_file_);
87 return (password_file_only_);
101 std::string user_file_;
104 std::string password_;
107 std::string password_file_;
110 bool password_file_only_;
132 void add(
const std::string& user,
133 const std::string& user_file,
134 const std::string& password,
135 const std::string& password_file,
136 bool password_file_only =
false,
143 virtual bool empty()
const;
146 virtual void clear();
Basic HTTP authentication client configuration.
bool getPasswordFileOnly() const
Returns the password file only flag.
BasicHttpAuthClient(const std::string &user, const std::string &password, const isc::data::ConstElementPtr &user_context)
Constructor (legacy).
const std::string & getPasswordFile() const
Returns the password file.
const std::string & getUserFile() const
Returns the user id file.
const std::string & getUser() const
Returns the user id.
const std::string & getPassword() const
Returns the password.
virtual isc::data::ElementPtr toElement() const
Unparses basic HTTP authentication client configuration.
Basic HTTP authentication configuration.
std::string getFileContent(const std::string &file_name) const
Get the content of {directory}/{file-name} regular file.
virtual isc::data::ElementPtr toElement() const
Unparses basic HTTP authentication configuration.
const BasicHttpAuthMap & getCredentialMap() const
Returns the credential and user id map.
void add(const std::string &user, const std::string &user_file, const std::string &password, const std::string &password_file, bool password_file_only=false, const isc::data::ConstElementPtr &user_context=isc::data::ConstElementPtr())
Add a client configuration.
void parse(const isc::data::ConstElementPtr &config)
Parses basic HTTP authentication configuration.
virtual isc::http::HttpResponseJsonPtr checkAuth(const isc::http::HttpResponseCreator &creator, const isc::http::HttpRequestPtr &request) const
Validate HTTP request.
virtual void clear()
Clear configuration.
virtual ~BasicHttpAuthConfig()
Destructor.
const BasicHttpAuthClientList & getClientList() const
Returns the list of client configuration.
virtual bool empty() const
Empty predicate.
Base type of HTTP authentication configuration.
Specifies an interface for classes creating HTTP responses from HTTP requests.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
std::unordered_map< std::string, std::string > BasicHttpAuthMap
Type of basic HTTP authentication credential and user id map, e.g.
boost::shared_ptr< HttpResponseJson > HttpResponseJsonPtr
Pointer to the HttpResponseJson object.
std::list< BasicHttpAuthClient > BasicHttpAuthClientList
Type of basic HTTP authentication client configuration list.
boost::shared_ptr< BasicHttpAuthConfig > BasicHttpAuthConfigPtr
Type of shared pointers to basic HTTP authentication configuration.
boost::shared_ptr< HttpRequest > HttpRequestPtr
Pointer to the HttpRequest object.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.
Base class for user context.