Kea 2.7.5
isc::config::HttpCommandConfig Class Reference

HTTP command config aka HTTP control socket info class. More...

#include <http_command_config.h>

+ Inheritance diagram for isc::config::HttpCommandConfig:

Public Member Functions

 HttpCommandConfig (isc::data::ConstElementPtr config)
 Constructor.
 
 ~HttpCommandConfig ()=default
 Virtual destructor.
 
const isc::http::HttpAuthConfigPtrgetAuthConfig () const
 Returns HTTP authentication configuration.
 
std::string getCertFile () const
 Returns cert-file TLS parameter.
 
bool getCertRequired () const
 Returns cert-required TLS parameter.
 
bool getEmulateAgentResponse () const
 Returns emulate agent response flag.
 
const isc::http::CfgHttpHeadersgetHttpHeaders () const
 Returns http-headers configuration.
 
std::string getKeyFile () const
 Returns key-file TLS parameter.
 
isc::asiolink::IOAddress getSocketAddress () const
 Returns socket address.
 
uint16_t getSocketPort () const
 Returns socket port.
 
std::string getSocketType () const
 Returns socket type.
 
std::string getTrustAnchor () const
 Returns trust-anchor TLS parameter.
 
void setAuthConfig (const isc::http::HttpAuthConfigPtr &auth_config)
 Sets HTTP authentication configuration.
 
void setCertFile (const std::string &cert)
 Sets cert-file TLS parameter.
 
void setCertRequired (bool required)
 Sets cert-required TLS parameter.
 
void setEmulateAgentResponse (const bool emulate_agent_response)
 Sets emulate agent response flag.
 
void setHttpHeaders (const isc::http::CfgHttpHeaders &headers)
 Sets http-headers configuration.
 
void setKeyFile (const std::string &key)
 Sets key-file TLS parameter.
 
void setSocketAddress (const isc::asiolink::IOAddress &socket_address)
 Sets socket address.
 
void setSocketPort (const uint16_t socket_port)
 Sets socket port.
 
void setSocketType (const std::string &socket_type)
 Sets socket type.
 
void setTrustAnchor (const std::string &ca)
 Sets trust-anchor TLS parameter.
 
virtual isc::data::ElementPtr toElement () const
 Unparse a configuration object.
 
- 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.
 

Static Public Attributes

static std::string DEFAULT_AUTHENTICATION_REALM = ""
 Default HTTP authentication realm.
 
static isc::asiolink::IOAddress DEFAULT_SOCKET_ADDRESS = IOAddress("127.0.0.1")
 Default socket address (127.0.0.1).
 
static uint16_t DEFAULT_SOCKET_PORT = 8000
 Default socket port.
 

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

HTTP command config aka HTTP control socket info class.

Definition at line 20 of file http_command_config.h.

Constructor & Destructor Documentation

◆ HttpCommandConfig()

isc::config::HttpCommandConfig::HttpCommandConfig ( isc::data::ConstElementPtr config)

Constructor.

Parameters
configPointer to the configuration to parse.

Definition at line 31 of file http_command_config.cc.

References isc::data::Element::boolean, isc::data::Element::create(), DEFAULT_AUTHENTICATION_REALM, isc::data::Element::integer, isc_throw, isc::data::Element::map, isc::http::parseCfgHttpHeaders(), isc::data::UserContext::setContext(), isc::data::Element::string, and isc::Exception::what().

+ Here is the call graph for this function:

◆ ~HttpCommandConfig()

isc::config::HttpCommandConfig::~HttpCommandConfig ( )
default

Virtual destructor.

Member Function Documentation

◆ getAuthConfig()

const isc::http::HttpAuthConfigPtr & isc::config::HttpCommandConfig::getAuthConfig ( ) const
inline

Returns HTTP authentication configuration.

Note
Only the basic HTTP authentication is supported.
Returns
HTTP authentication configuration.

Definition at line 92 of file http_command_config.h.

◆ getCertFile()

std::string isc::config::HttpCommandConfig::getCertFile ( ) const
inline

Returns cert-file TLS parameter.

Returns
Server certificate file name.

Definition at line 123 of file http_command_config.h.

◆ getCertRequired()

bool isc::config::HttpCommandConfig::getCertRequired ( ) const
inline

Returns cert-required TLS parameter.

Returns
True when client certificates are required, false when they are optional, the default is to require them (true).

Definition at line 152 of file http_command_config.h.

◆ getEmulateAgentResponse()

bool isc::config::HttpCommandConfig::getEmulateAgentResponse ( ) const
inline

Returns emulate agent response flag.

Returns
True when responses for normal command outcomes are guaranteed to be wrapped in an Element::list. This emulates how kea-ctrl-agent forms responses. Defaults to true.

Definition at line 169 of file http_command_config.h.

◆ getHttpHeaders()

const isc::http::CfgHttpHeaders & isc::config::HttpCommandConfig::getHttpHeaders ( ) const
inline

Returns http-headers configuration.

Returns
Collection of config HTTP headers.

Definition at line 76 of file http_command_config.h.

◆ getKeyFile()

std::string isc::config::HttpCommandConfig::getKeyFile ( ) const
inline

Returns key-file TLS parameter.

Returns
Server private key file name.

Definition at line 137 of file http_command_config.h.

◆ getSocketAddress()

isc::asiolink::IOAddress isc::config::HttpCommandConfig::getSocketAddress ( ) const
inline

Returns socket address.

Returns
IP address where the HTTP service is available.

Definition at line 48 of file http_command_config.h.

◆ getSocketPort()

uint16_t isc::config::HttpCommandConfig::getSocketPort ( ) const
inline

Returns socket port.

Returns
TCP port where the HTTP service is available.

Definition at line 62 of file http_command_config.h.

◆ getSocketType()

std::string isc::config::HttpCommandConfig::getSocketType ( ) const
inline

Returns socket type.

Returns
The socket type ("http" or "https").

Definition at line 34 of file http_command_config.h.

◆ getTrustAnchor()

std::string isc::config::HttpCommandConfig::getTrustAnchor ( ) const
inline

Returns trust-anchor TLS parameter.

Returns
Trust anchor aka Certificate Authority.

Definition at line 108 of file http_command_config.h.

◆ setAuthConfig()

void isc::config::HttpCommandConfig::setAuthConfig ( const isc::http::HttpAuthConfigPtr & auth_config)
inline

Sets HTTP authentication configuration.

Note
Only the basic HTTP authentication is supported.
Parameters
auth_configHTTP authentication configuration.

Definition at line 101 of file http_command_config.h.

◆ setCertFile()

void isc::config::HttpCommandConfig::setCertFile ( const std::string & cert)
inline

Sets cert-file TLS parameter.

Parameters
certServer certificate file name.

Definition at line 130 of file http_command_config.h.

◆ setCertRequired()

void isc::config::HttpCommandConfig::setCertRequired ( bool required)
inline

Sets cert-required TLS parameter.

Parameters
requiredClient certificates are required when true (the default) or optional when false.

Definition at line 160 of file http_command_config.h.

◆ setEmulateAgentResponse()

void isc::config::HttpCommandConfig::setEmulateAgentResponse ( const bool emulate_agent_response)
inline

Sets emulate agent response flag.

Parameters
emulate_agent_responseThe new value of the emulation flag.

Definition at line 176 of file http_command_config.h.

◆ setHttpHeaders()

void isc::config::HttpCommandConfig::setHttpHeaders ( const isc::http::CfgHttpHeaders & headers)
inline

Sets http-headers configuration.

Parameters
headersCollection of config HTTP headers.

Definition at line 83 of file http_command_config.h.

◆ setKeyFile()

void isc::config::HttpCommandConfig::setKeyFile ( const std::string & key)
inline

Sets key-file TLS parameter.

Parameters
keyServer private key file name.

Definition at line 144 of file http_command_config.h.

◆ setSocketAddress()

void isc::config::HttpCommandConfig::setSocketAddress ( const isc::asiolink::IOAddress & socket_address)
inline

Sets socket address.

Parameters
socket_addressThe new socket address.

Definition at line 55 of file http_command_config.h.

◆ setSocketPort()

void isc::config::HttpCommandConfig::setSocketPort ( const uint16_t socket_port)
inline

Sets socket port.

Parameters
socket_portThe new socket port.

Definition at line 69 of file http_command_config.h.

◆ setSocketType()

void isc::config::HttpCommandConfig::setSocketType ( const std::string & socket_type)
inline

Sets socket type.

Parameters
socket_typeThe new socket type (should be "http" or "https").

Definition at line 41 of file http_command_config.h.

◆ setTrustAnchor()

void isc::config::HttpCommandConfig::setTrustAnchor ( const std::string & ca)
inline

Sets trust-anchor TLS parameter.

Parameters
caTrust anchor aka Certificate Authority (can be a file name or a directory path).

Definition at line 116 of file http_command_config.h.

◆ toElement()

ElementPtr isc::config::HttpCommandConfig::toElement ( ) const
virtual

Unparse a configuration object.

Returns
A pointer to configuration.

Set authentication.

Implements isc::data::CfgToElement.

Definition at line 213 of file http_command_config.cc.

References isc::http::CfgHttpHeaderstoElement(), isc::data::UserContext::contextToElement(), isc::data::Element::create(), isc::data::Element::createMap(), and isc::asiolink::IOAddress::toText().

+ Here is the call graph for this function:

Member Data Documentation

◆ DEFAULT_AUTHENTICATION_REALM

string isc::config::HttpCommandConfig::DEFAULT_AUTHENTICATION_REALM = ""
static

◆ DEFAULT_SOCKET_ADDRESS

IOAddress isc::config::HttpCommandConfig::DEFAULT_SOCKET_ADDRESS = IOAddress("127.0.0.1")
static

Default socket address (127.0.0.1).

Definition at line 186 of file http_command_config.h.

Referenced by isc::dhcp::ControlledDhcpv6Srv::ControlledDhcpv6Srv().

◆ DEFAULT_SOCKET_PORT

uint16_t isc::config::HttpCommandConfig::DEFAULT_SOCKET_PORT = 8000
static

Default socket port.

Definition at line 189 of file http_command_config.h.


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