28 const boost::property_tree::ptree &cfg,
36 reactor_.add(authenticator->bus_sub(),
47 boost::property_tree::ptree module_config =
config_.get_child(
"module_config");
49 for (
auto &node : module_config.get_child(
"instances"))
51 boost::property_tree::ptree auth_instance_cfg = node.second;
52 std::string auth_ctx_name = auth_instance_cfg.get_child(
"name").data();
53 std::string config_file = auth_instance_cfg.get_child(
"config_file").data();
54 std::string auth_target_name =
55 auth_instance_cfg.get<std::string>(
"target",
"");
56 std::list<std::string> auth_sources_names;
58 for (
const auto &subnode : auth_instance_cfg)
60 if (subnode.first ==
"auth_source")
61 auth_sources_names.push_back(subnode.second.data());
64 if (!auth_target_name.empty())
65 auth_target_name =
utils_->kernel().config_manager().instance_name() +
66 '.' + auth_target_name;
68 INFO(
"Creating AuthFile instance " 69 << auth_ctx_name <<
". Target door = " << auth_target_name);
72 auth_target_name, config_file,
utils_)));
82 *out << ptr->auth_file_name();
83 *out << ptr->auth_file_content();
This is the header file for a generated source file, GitSHA1.cpp.
An instance of an authentication handler that use files to check whether or not access is granted or ...
void process_config()
Processing the configuration tree, spawning AuthFileInstance object as described in the configuration...
CoreUtilsPtr utils_
Pointer to the core utils, which gives access to scheduler and others.
virtual void dump_additional_config(zmqpp::message *out) const override
We have one config file per authenticator object.
Base class for module implementation.
zmqpp::context & ctx_
A reference to the ZeroMQ context in case you need it to create additional socket.
std::shared_ptr< AuthFileInstance > AuthFileInstancePtr
Authentication backend modules live here.
zmqpp::reactor reactor_
The reactor object we poll() on in the main loop.
std::shared_ptr< CoreUtils > CoreUtilsPtr
boost::property_tree::ptree config_
The configuration tree passed to the start_module function.
void handle_bus_msg()
Something happened on the bus that we have interest into.
std::vector< AuthFileInstancePtr > authenticators_
Authenticator instance.
AuthFileModule(zmqpp::context &ctx, zmqpp::socket *pipe, const boost::property_tree::ptree &cfg, CoreUtilsPtr utils)