Kea  1.9.9-git
auth_config.h
Go to the documentation of this file.
1 // Copyright (C) 2020 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef HTTP_AUTH_CONFIG_H
8 #define HTTP_AUTH_CONFIG_H
9 
10 #include <cc/cfg_to_element.h>
11 #include <cc/data.h>
12 #include <cc/simple_parser.h>
13 #include <cc/user_context.h>
14 #include <http/request.h>
15 #include <http/response_creator.h>
16 #include <http/response_json.h>
17 
18 namespace isc {
19 namespace http {
20 
24 public:
25 
27  virtual ~HttpAuthConfig() { }
28 
32  void setRealm(const std::string& realm) {
33  realm_ = realm;
34  }
35 
39  const std::string& getRealm() const {
40  return (realm_);
41  }
42 
46  virtual bool empty() const = 0;
47 
49  virtual void clear() = 0;
50 
56  virtual void parse(const isc::data::ConstElementPtr& config) = 0;
57 
61  virtual isc::data::ElementPtr toElement() const = 0;
62 
70  const isc::http::HttpRequestPtr& request) const = 0;
71 
72 private:
73 
75  std::string realm_;
76 };
77 
79 typedef boost::shared_ptr<HttpAuthConfig> HttpAuthConfigPtr;
80 
81 } // end of namespace isc::http
82 } // end of namespace isc
83 
84 #endif // endif HTTP_AUTH_CONFIG_H
virtual bool empty() const =0
Empty predicate.
boost::shared_ptr< HttpResponseJson > HttpResponseJsonPtr
Pointer to the HttpResponseJson object.
Definition: response_json.h:24
void setRealm(const std::string &realm)
Set the realm.
Definition: auth_config.h:32
Base class for user context.
Definition: user_context.h:22
virtual void clear()=0
Clear configuration.
Specifies an interface for classes creating HTTP responses from HTTP requests.
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
Base type of HTTP authentication configuration.
Definition: auth_config.h:22
const std::string & getRealm() const
Returns the realm.
Definition: auth_config.h:39
virtual ~HttpAuthConfig()
Destructor.
Definition: auth_config.h:27
Abstract class for configuration Cfg_* classes.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
Defines the logger used by the top-level component of kea-dhcp-ddns.
boost::shared_ptr< HttpRequest > HttpRequestPtr
Pointer to the HttpRequest object.
Definition: request.h:27
virtual isc::http::HttpResponseJsonPtr checkAuth(const isc::http::HttpResponseCreator &creator, const isc::http::HttpRequestPtr &request) const =0
Validate HTTP request.
virtual void parse(const isc::data::ConstElementPtr &config)=0
Parses HTTP authentication configuration.
virtual isc::data::ElementPtr toElement() const =0
Unparses HTTP authentication configuration.
boost::shared_ptr< HttpAuthConfig > HttpAuthConfigPtr
Type of shared pointers to HTTP authentication configuration.
Definition: auth_config.h:79