Kea 2.7.3
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.
 
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 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 19 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::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 75 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 106 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 135 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 152 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 120 of file http_command_config.h.

◆ getSocketAddress()

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

Returns socket address.

Returns
IP address where the server's HTTP service is available.

Definition at line 47 of file http_command_config.h.

◆ getSocketPort()

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

Returns socket port.

Definition at line 59 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 33 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 91 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 84 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 113 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 143 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 159 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 127 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 54 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 66 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 40 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 99 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 207 of file http_command_config.cc.

References 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 169 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 172 of file http_command_config.h.


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