Kea  2.3.5-git
isc::http::HttpAuthConfig Class Referenceabstract

Base type of HTTP authentication configuration. More...

#include <auth_config.h>

+ Inheritance diagram for isc::http::HttpAuthConfig:

Public Member Functions

virtual ~HttpAuthConfig ()
 Destructor. More...
 
virtual isc::http::HttpResponseJsonPtr checkAuth (const isc::http::HttpResponseCreator &creator, const isc::http::HttpRequestPtr &request) const =0
 Validate HTTP request. More...
 
virtual void clear ()=0
 Clear configuration. More...
 
virtual bool empty () const =0
 Empty predicate. More...
 
const std::string & getDirectory () const
 Returns the common part for file paths (usually a directory). More...
 
const std::string & getRealm () const
 Returns the realm. More...
 
virtual void parse (const isc::data::ConstElementPtr &config)=0
 Parses HTTP authentication configuration. More...
 
void setDirectory (const std::string &directory)
 Set the common part for file paths (usually a directory). More...
 
void setRealm (const std::string &realm)
 Set the realm. More...
 
virtual isc::data::ElementPtr toElement () const =0
 Unparses HTTP authentication configuration. More...
 
- Public Member Functions inherited from isc::data::UserContext
void contextToElement (data::ElementPtr map) const
 Merge unparse a user_context object. More...
 
data::ConstElementPtr getContext () const
 Returns const pointer to the user context. More...
 
void setContext (const data::ConstElementPtr &ctx)
 Sets user context. More...
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from isc::data::UserContext
static data::ElementPtr toElement (data::ConstElementPtr map)
 Copy an Element map. More...
 
- Protected Attributes inherited from isc::data::UserContext
data::ConstElementPtr user_context_
 Pointer to the user context (may be NULL) More...
 

Detailed Description

Base type of HTTP authentication configuration.

Definition at line 22 of file auth_config.h.

Constructor & Destructor Documentation

◆ ~HttpAuthConfig()

virtual isc::http::HttpAuthConfig::~HttpAuthConfig ( )
inlinevirtual

Destructor.

Definition at line 27 of file auth_config.h.

Member Function Documentation

◆ checkAuth()

virtual isc::http::HttpResponseJsonPtr isc::http::HttpAuthConfig::checkAuth ( const isc::http::HttpResponseCreator creator,
const isc::http::HttpRequestPtr request 
) const
pure virtual

Validate HTTP request.

Parameters
creatorThe HTTP response creator.
requestThe HTTP request to validate.
Returns
Error HTTP response if validation failed, null otherwise.

Implemented in isc::http::BasicHttpAuthConfig.

Referenced by getDirectory().

◆ clear()

virtual void isc::http::HttpAuthConfig::clear ( )
pure virtual

Clear configuration.

Implemented in isc::http::BasicHttpAuthConfig.

Referenced by getDirectory().

◆ empty()

virtual bool isc::http::HttpAuthConfig::empty ( ) const
pure virtual

Empty predicate.

Returns
true if the configuration is empty so authentication is not required.

Implemented in isc::http::BasicHttpAuthConfig.

Referenced by getDirectory().

◆ getDirectory()

const std::string& isc::http::HttpAuthConfig::getDirectory ( ) const
inline

Returns the common part for file paths (usually a directory).

Returns
The common part for file paths (usually a directory).

Definition at line 53 of file auth_config.h.

References checkAuth(), clear(), empty(), parse(), and toElement().

+ Here is the call graph for this function:

◆ getRealm()

const std::string& isc::http::HttpAuthConfig::getRealm ( ) const
inline

Returns the realm.

Returns
The HTTP authentication realm.

Definition at line 39 of file auth_config.h.

◆ parse()

virtual void isc::http::HttpAuthConfig::parse ( const isc::data::ConstElementPtr config)
pure virtual

Parses HTTP authentication configuration.

Parameters
configElement holding the basic HTTP authentication configuration to be parsed.
Exceptions
DhcpConfigErrorwhen the configuration is invalid.

Implemented in isc::http::BasicHttpAuthConfig.

Referenced by getDirectory().

◆ setDirectory()

void isc::http::HttpAuthConfig::setDirectory ( const std::string &  directory)
inline

Set the common part for file paths (usually a directory).

Parameters
directoryNew directory.

Definition at line 46 of file auth_config.h.

◆ setRealm()

void isc::http::HttpAuthConfig::setRealm ( const std::string &  realm)
inline

Set the realm.

Parameters
realmNew realm.

Definition at line 32 of file auth_config.h.

◆ toElement()

virtual isc::data::ElementPtr isc::http::HttpAuthConfig::toElement ( ) const
pure virtual

Unparses HTTP authentication configuration.

Returns
A pointer to unparsed HTTP authentication configuration.

Implements isc::data::CfgToElement.

Implemented in isc::http::BasicHttpAuthConfig.

Referenced by getDirectory().


The documentation for this class was generated from the following file: