![]() |
Kea 3.3.4
|
Per role configuration class. More...
#include <rbac.h>
Public Member Functions | |
| RoleConfig (const std::string &name, const AclPtr &accept, const AclPtr &reject, bool others, bool preference, const ResponseFilterList &response_filters) | |
| Constructor. | |
| virtual | ~RoleConfig ()=default |
| Destructor. | |
| bool | filter (const std::string &command, data::ConstElementPtr body) const |
| Filter a response. | |
| bool | match (const std::string &command) const |
| Match access control list. | |
Static Public Member Functions | |
| static http::HttpResponseJsonPtr | createReject (const http::HttpRequestPtr &request, const http::HttpStatusCode &status_code) |
| Create a reject response. | |
| static RoleConfigPtr | getConfig (const std::string &role) |
| Return the role config. | |
| static RoleConfigPtr | parse (data::ConstElementPtr cfg, std::string name="") |
| Parse a role config. | |
Public Attributes | |
| AclPtr | accept_ |
| Accept command access control list. | |
| std::string | name_ |
| Role name. | |
| bool | others_ |
| Action for other commands. | |
| bool | preference_ |
| Action for both matching. | |
| AclPtr | reject_ |
| Reject command access control list. | |
| ResponseFilterList | response_filters_ |
| Response filters. | |
Static Public Attributes | |
| static const data::SimpleKeywords | ROLE_PARAMETERS |
| Role configuration parameters. | |
Per role configuration class.
When a command does not match accept and reject ACLs it is an other commands: true is for the accept action, false for the reject one. When a command matches both accept and reject ACLs the preference true follows the accept ACL, false the deny ACL.
|
inline |
Constructor.
| name | Role name. |
| accept | Accept commands access. |
| reject | Reject commands filter. |
| others | Action for other commands. |
| preference | Action for matching both commands. |
| response_filters | Response filters. |
Definition at line 47 of file rbac.h.
References accept_, name_, others_, preference_, reject_, and response_filters_.
Referenced by parse().
|
virtualdefault |
Destructor.
|
static |
Create a reject response.
| request | The request. |
| status_code | The status code. |
Definition at line 129 of file rbac.cc.
References Element::create(), Element::createMap(), isc_throw, isc::http::HttpVersion::major_, isc::http::HttpVersion::minor_, isc::http::HttpResponse::statusCodeToNumber(), and isc::http::HttpResponse::statusCodeToString().
Referenced by http_auth().
|
inline |
Filter a response.
| command | The command. |
| body | The JSON response body. |
Definition at line 105 of file rbac.h.
References response_filters_.
|
static |
Return the role config.
| role | The role name. |
Definition at line 41 of file rbac.cc.
References isc::rbac::defaultRoleConfig, isc::rbac::roleConfigTable, and isc::rbac::unknownRoleConfig.
Referenced by http_auth().
|
inline |
Match access control list.
| command | The command. |
Definition at line 81 of file rbac.h.
References accept_, others_, preference_, and reject_.
Referenced by isc::rbac::ListCommandsResponseFilter::filter().
|
static |
Parse a role config.
| cfg | The role config. |
| name | The name (empty when to be get from the config). |
Definition at line 53 of file rbac.cc.
References RoleConfig(), isc::data::SimpleParser::checkKeywords(), isc_throw, Element::map, isc::rbac::Acl::parse(), isc::rbac::ResponseFilter::parse(), and ROLE_PARAMETERS.
Referenced by isc::rbac::Config::parse().
| AclPtr isc::rbac::RoleConfig::accept_ |
Accept command access control list.
Definition at line 63 of file rbac.h.
Referenced by RoleConfig(), and match().
| std::string isc::rbac::RoleConfig::name_ |
| bool isc::rbac::RoleConfig::others_ |
Action for other commands.
Definition at line 69 of file rbac.h.
Referenced by RoleConfig(), and match().
| bool isc::rbac::RoleConfig::preference_ |
Action for both matching.
Definition at line 72 of file rbac.h.
Referenced by RoleConfig(), and match().
| AclPtr isc::rbac::RoleConfig::reject_ |
Reject command access control list.
Definition at line 66 of file rbac.h.
Referenced by RoleConfig(), and match().
| ResponseFilterList isc::rbac::RoleConfig::response_filters_ |
|
static |
Role configuration parameters.
Definition at line 37 of file rbac.h.
Referenced by parse().