Kea: isc::http::HttpAuthConfig Class Reference

| Kea 3.2.0-git

isc::http::HttpAuthConfig Class Referenceabstract

Base type of HTTP authentication configuration. More...

`#include <auth_config.h>`

Inheritance diagram for isc::http::HttpAuthConfig:
[legend]

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

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

## 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

  creator | The HTTP response creator.
  request | The HTTP request to validate.

Returns
  Error HTTP response if validation failed, null otherwise.

Implemented in isc::http::BasicHttpAuthConfig.

## ◆ clear()

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

Clear configuration.

Implemented in isc::http::BasicHttpAuthConfig.

## ◆ 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.

## ◆ 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.

Referenced by isc::http::BasicHttpAuthConfig::getFileContent(), and isc::http::BasicHttpAuthConfig::toElement().

## ◆ 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.

Referenced by isc::http::BasicHttpAuthConfig::checkAuth(), and isc::http::BasicHttpAuthConfig::toElement().

## ◆ parse()

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

Parses HTTP authentication configuration.

Parameters

  config | Element holding the basic HTTP authentication configuration to be parsed.

Exceptions

  DhcpConfigError | when the configuration is invalid.

Implemented in isc::http::BasicHttpAuthConfig.

## ◆ setDirectory()

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

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

Parameters

  directory | New directory.

Definition at line 46 of file auth_config.h.

Referenced by isc::http::BasicHttpAuthConfig::parse().

## ◆ setRealm()

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

Set the realm.

Parameters

  realm | New realm.

Definition at line 32 of file auth_config.h.

Referenced by isc::http::BasicHttpAuthConfig::parse().

## ◆ 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.

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

- auth_config.h