Kea 3.3.4
isc::rbac::Api Class Reference

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.

Detailed Description

Command from the API class.

Definition at line 29 of file rbac_api.h.

Constructor & Destructor Documentation

◆ Api()

isc::rbac::Api::Api ( const std::string & name,
const std::string & access,
const std::string & hook )
inline

Constructor.

Parameters
nameThe command name.
accessThe access (read or write).
hookThe hook name (can be empty).

Definition at line 37 of file rbac_api.h.

References access_, hook_, and name_.

Referenced by parse().

◆ ~Api()

virtual isc::rbac::Api::~Api ( )
virtualdefault

Destructor.

Member Function Documentation

◆ fillApiTable()

void isc::rbac::Api::fillApiTable ( const std::string & dirname)
static

Fill the API command table.

Parameters
dirnameThe 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().

Here is the call graph for this function:

◆ getAccess()

std::string isc::rbac::Api::getAccess ( ) const
inline

Returns the command access.

Returns
the command access.

Definition at line 54 of file rbac_api.h.

References access_.

◆ getApiByName()

ApiPtr isc::rbac::Api::getApiByName ( const std::string & name)
static

Lookup in the table.

Parameters
nameThe command name.
Returns
the pointer to the Api object with the specified name or null.

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().

◆ getHook()

std::string isc::rbac::Api::getHook ( ) const
inline

Returns the command hook name.

Returns
the command hook name.

Definition at line 68 of file rbac_api.h.

References hook_.

◆ getName()

std::string isc::rbac::Api::getName ( ) const
inline

Returns the command name.

Returns
the command name.

Definition at line 47 of file rbac_api.h.

References name_.

◆ parse()

void isc::rbac::Api::parse ( data::ConstElementPtr cfg,
bool others = false )
static

Parse a command config.

Parameters
cfgConfiguration of a command.
othersAccept 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().

Here is the call graph for this function:

◆ setAccess()

void isc::rbac::Api::setAccess ( const std::string & access)
inline

Set the command access.

Parameters
accessThe command access.

Definition at line 61 of file rbac_api.h.

References access_.

◆ setHook()

void isc::rbac::Api::setHook ( const std::string & hook)
inline

Set the command hook name.

Parameters
hookThe command hook name.

Definition at line 75 of file rbac_api.h.

References hook_.

Member Data Documentation

◆ access_

std::string isc::rbac::Api::access_
protected

The command access (read or write).

Definition at line 101 of file rbac_api.h.

Referenced by Api(), getAccess(), and setAccess().

◆ hook_

std::string isc::rbac::Api::hook_
protected

The name of the hook which registers the command (may not be set).

Definition at line 104 of file rbac_api.h.

Referenced by Api(), getHook(), and setHook().

◆ name_

std::string isc::rbac::Api::name_
protected

The command name.

Definition at line 98 of file rbac_api.h.

Referenced by Api(), and getName().


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