HttpCommandMgr::instance().setIOService(getIOService());
// Set the HTTP authentication default realm.
- HttpCommandConfig::DefaultAuthenticationRealm = "kea-dhcp-ddns-server";
+ HttpCommandConfig::DEFAULT_AUTHENTICATION_REALM = "kea-dhcp-ddns-server";
};
void
HttpCommandMgr::instance().setIOService(getIOService());
// Set the HTTP authentication default realm.
- HttpCommandConfig::DefaultAuthenticationRealm = "kea-dhcpv4-server";
+ HttpCommandConfig::DEFAULT_AUTHENTICATION_REALM = "kea-dhcpv4-server";
// DatabaseConnection uses IO service to run asynchronous timers.
DatabaseConnection::setIOService(getIOService());
HttpCommandMgr::instance().setIOService(getIOService());
// Set the HTTP authentication default realm.
- HttpCommandConfig::DefaultAuthenticationRealm = "kea-dhcpv6-server";
+ HttpCommandConfig::DEFAULT_AUTHENTICATION_REALM = "kea-dhcpv6-server";
// DatabaseConnection uses IO service to run asynchronous timers.
DatabaseConnection::setIOService(getIOService());
namespace isc {
namespace config {
-IOAddress HttpCommandConfig::DefaultSocketAddress = IOAddress("127.0.0.1");
+IOAddress HttpCommandConfig::DEFAULT_SOCKET_ADDRESS = IOAddress("127.0.0.1");
-uint16_t HttpCommandConfig::DefaultSocketPort = 8000;
+uint16_t HttpCommandConfig::DEFAULT_SOCKET_PORT = 8000;
-string HttpCommandConfig::DefaultAuthenticationRealm = "";
+string HttpCommandConfig::DEFAULT_AUTHENTICATION_REALM = "";
HttpCommandConfig::HttpCommandConfig(ConstElementPtr config)
- : socket_type_("http"), socket_address_(DefaultSocketAddress),
- socket_port_(DefaultSocketPort), auth_config_(),
+ : socket_type_("http"), socket_address_(DEFAULT_SOCKET_ADDRESS),
+ socket_port_(DEFAULT_SOCKET_PORT), auth_config_(),
trust_anchor_(""), cert_file_(""), key_file_(""), cert_required_(true),
emulate_agent_response_(true) {
if (config->getType() != Element::map) {
ConstElementPtr realm = auth_config->get("realm");
if (!realm) {
mutable_auth_config->set("realm",
- Element::create(DefaultAuthenticationRealm));
+ Element::create(DEFAULT_AUTHENTICATION_REALM));
}
BasicHttpAuthConfigPtr auth(new BasicHttpAuthConfig());
virtual isc::data::ElementPtr toElement() const;
/// @brief Default socket address (127.0.0.1).
- static isc::asiolink::IOAddress DefaultSocketAddress;
+ static isc::asiolink::IOAddress DEFAULT_SOCKET_ADDRESS;
/// @brief Default socket port.
- static uint16_t DefaultSocketPort;
+ static uint16_t DEFAULT_SOCKET_PORT;
/// @brief Default HTTP authentication realm.
- static std::string DefaultAuthenticationRealm;
+ static std::string DEFAULT_AUTHENTICATION_REALM;
private:
/// @brief Check TLS configuration.
if (config && current_config_ &&
(config->getSocketAddress() == current_config_->getSocketAddress()) &&
(config->getSocketPort() == current_config_->getSocketPort())) {
- // Overwrite the authentication setup in the response creator config.
- current_config_->setAuthConfig(config->getAuthConfig());
- // Overwrite the emulation flag in the response creator config.
- current_config_->setEmulateAgentResponse(config->getEmulateAgentResponse());
// Check if TLS setup changed.
if ((config->getTrustAnchor() != current_config_->getTrustAnchor()) ||
(config->getCertFile() != current_config_->getCertFile()) ||
(config->getKeyFile() != current_config_->getKeyFile()) ||
(config->getCertRequired() != current_config_->getCertRequired())) {
LOG_WARN(command_logger, HTTP_COMMAND_MGR_IGNORED_TLS_SETUP_CHANGES);
+ // Overwrite the authentication setup and the emulation flag
+ //in the response creator config.
+ current_config_->setAuthConfig(config->getAuthConfig());
+ current_config_->setEmulateAgentResponse(config->getEmulateAgentResponse());
} else {
current_config_ = config;
}
public:
/// @brief Constructor.
HttpCommandConfigTest() : http_config_() {
- HttpCommandConfig::DefaultSocketAddress = IOAddress("127.0.0.1");
- HttpCommandConfig::DefaultSocketPort = 8000;
- HttpCommandConfig::DefaultAuthenticationRealm = "";
+ HttpCommandConfig::DEFAULT_SOCKET_ADDRESS = IOAddress("127.0.0.1");
+ HttpCommandConfig::DEFAULT_SOCKET_PORT = 8000;
+ HttpCommandConfig::DEFAULT_AUTHENTICATION_REALM = "";
}
/// @brief Destructor.
~HttpCommandConfigTest() {
- HttpCommandConfig::DefaultSocketAddress = IOAddress("127.0.0.1");
- HttpCommandConfig::DefaultSocketPort = 8000;
- HttpCommandConfig::DefaultAuthenticationRealm = "";
+ HttpCommandConfig::DEFAULT_SOCKET_ADDRESS = IOAddress("127.0.0.1");
+ HttpCommandConfig::DEFAULT_SOCKET_PORT = 8000;
+ HttpCommandConfig::DEFAULT_AUTHENTICATION_REALM = "";
}
/// @brief HTTP control socket configuration.
runToElementTest(expected, *http_config_);
// Change class defaults.
- HttpCommandConfig::DefaultSocketAddress = IOAddress("::1");
- HttpCommandConfig::DefaultSocketPort = 8080;
+ HttpCommandConfig::DEFAULT_SOCKET_ADDRESS = IOAddress("::1");
+ HttpCommandConfig::DEFAULT_SOCKET_PORT = 8080;
ASSERT_NO_THROW_LOG(http_config_.reset(new HttpCommandConfig(json)));
EXPECT_EQ("::1", http_config_->getSocketAddress().toText());
EXPECT_EQ(8080, http_config_->getSocketPort());
ASSERT_TRUE(auth);
// Verify that default realm is applied.
- HttpCommandConfig::DefaultAuthenticationRealm = "FOO";
+ HttpCommandConfig::DEFAULT_AUTHENTICATION_REALM = "FOO";
ASSERT_NO_THROW(json = Element::fromJSON(config));
ASSERT_NO_THROW(http_config_.reset(new HttpCommandConfig(json)));
auth_config = http_config_->getAuthConfig();