![]() |
Kea 3.3.4
|
Command from the API class. More...
#include <rbac_api.h>
Public Member Functions | |
| Api (const std::string &name, const std::string &access, const std::string &hook) | |
| Constructor. | |
| virtual | ~Api ()=default |
| Destructor. | |
| std::string | getAccess () const |
| Returns the command access. | |
| std::string | getHook () const |
| Returns the command hook name. | |
| std::string | getName () const |
| Returns the command name. | |
| void | setAccess (const std::string &access) |
| Set the command access. | |
| void | setHook (const std::string &hook) |
| Set the command hook name. | |
Static Public Member Functions | |
| static void | fillApiTable (const std::string &dirname) |
| Fill the API command table. | |
| static ApiPtr | getApiByName (const std::string &name) |
| Lookup in the table. | |
| static void | parse (data::ConstElementPtr cfg, bool others=false) |
| Parse a command config. | |
Protected Attributes | |
| std::string | access_ |
| The command access (read or write). | |
| std::string | hook_ |
| The name of the hook which registers the command (may not be set). | |
| std::string | name_ |
| The command name. | |
Command from the API class.
Definition at line 29 of file rbac_api.h.
|
inline |
|
virtualdefault |
Destructor.
|
static |
Fill the API command table.
| dirname | The API directory name. |
Definition at line 44 of file rbac_api.cc.
References isc::rbac::apiAccesses, isc::rbac::apiHooks, isc::rbac::apiTable, Element::fromJSONFile(), isc_throw, LOG_INFO, parse(), isc::rbac::rbac_logger, and RBAC_READ_API_FILES.
Referenced by isc::rbac::Config::parse().
|
inline |
Returns the command access.
Definition at line 54 of file rbac_api.h.
References access_.
|
static |
Lookup in the table.
| name | The command name. |
Definition at line 35 of file rbac_api.cc.
References isc::rbac::apiTable.
Referenced by isc::rbac::AccessAcl::match(), isc::rbac::HookAcl::match(), isc::rbac::Acl::parse(), and parse().
|
inline |
Returns the command hook name.
Definition at line 68 of file rbac_api.h.
References hook_.
|
inline |
Returns the command name.
Definition at line 47 of file rbac_api.h.
References name_.
|
static |
Parse a command config.
| cfg | Configuration of a command. |
| others | Accept other keywords. |
Definition at line 96 of file rbac_api.cc.
References Api(), isc::rbac::apiAccesses, isc::rbac::apiHooks, isc::rbac::apiTable, getApiByName(), isc_throw, Element::map, and Element::string.
Referenced by fillApiTable(), and isc::rbac::Config::parse().
|
inline |
Set the command access.
| access | The command access. |
Definition at line 61 of file rbac_api.h.
References access_.
|
inline |
Set the command hook name.
| hook | The command hook name. |
Definition at line 75 of file rbac_api.h.
References hook_.
|
protected |
The command access (read or write).
Definition at line 101 of file rbac_api.h.
Referenced by Api(), getAccess(), and setAccess().
|
protected |
The name of the hook which registers the command (may not be set).
Definition at line 104 of file rbac_api.h.
|
protected |