40 const string& name = cfg->stringValue();
52 for (
auto const& entry : cfg->mapValue()) {
53 if (entry.first ==
"comment") {
60 if (entry.first ==
"not") {
62 }
else if (entry.first ==
"and") {
64 }
else if (entry.first ==
"or") {
66 }
else if (entry.first ==
"commands") {
71 std::set<std::string> commands;
72 for (
auto const& elem : entry.second->listValue()) {
77 const string& command = elem->stringValue();
81 static_cast<void>(commands.insert(command));
84 }
else if (entry.first ==
"access") {
89 const string& access = entry.second->stringValue();
97 }
else if (entry.first ==
"hook") {
102 const string& hook = entry.second->stringValue();
103 if (!hook.empty() && (
apiHooks.count(hook) == 0)) {
109 << entry.first <<
"'");
127 for (
auto const& elem : cfg->listValue()) {
141 if (def->size() != 1) {
145 for (
auto const& entry : def->mapValue()) {
146 const string& name = entry.first;
150 if (
aclTable.count(entry.first) != 0) {
152 <<
"' is already defined");
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Read or write access control list.
static AclPtr parse(data::ConstElementPtr cfg)
Parse an access control list.
static void initTable()
Initialize the access control list table.
static AclList parseList(data::ConstElementPtr cfg)
Parse a list of access control lists.
static void parse(data::ConstElementPtr def)
Parse an access control list definition.
Conjunction of access control lists.
static ApiPtr getApiByName(const std::string &name)
Lookup in the table.
Explicit access control list.
Hook access control list.
None access control list.
Disjunction of access control lists.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< const Element > ConstElementPtr
set< string > apiHooks
The API hook list.
boost::shared_ptr< Acl > AclPtr
Type of shared pointers to Acl.
std::map< std::string, AclPtr > AclTable
Type of the access control list table.
std::list< AclPtr > AclList
Type of list of shared pointers to Acl.
set< string > apiAccesses
The API access list (should be "read" and "write").
AclTable aclTable
The access control list table.
Defines the logger used by the top-level component of kea-lfc.