66 if (!name.empty() && name_elem) {
69 }
else if (name.empty() && !name_elem) {
73 name = name_elem->stringValue();
97 const string& action = others_elem->stringValue();
98 if ((action!=
"accept") && (action !=
"reject")) {
100 <<
"' is not 'accept' or 'reject'");
102 others = (action ==
"accept");
106 bool preference =
true;
109 const string& pref = pref_elem->stringValue();
110 if ((pref !=
"accept") && (pref !=
"reject")) {
112 <<
"' is not 'accept' or 'reject'");
114 preference = (pref ==
"accept");
125 preference, response_filters)));
136 HttpVersion http_version(request->context()->http_version_major_,
137 request->context()->http_version_minor_);
150 response->setBodyAsJson(body);
151 response->finalize();
static ElementPtr create(const Position &pos=ZERO_POSITION())
Create a NullElement.
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
A generic exception that is thrown when an unexpected error condition occurs.
static void checkKeywords(const SimpleKeywords &keywords, isc::data::ConstElementPtr scope)
Checks acceptable keywords with their expected type.
Represents HTTP response with JSON content.
static uint16_t statusCodeToNumber(const HttpStatusCode &status_code)
Convenience method converting status code to numeric value.
static std::string statusCodeToString(const HttpStatusCode &status_code)
Converts status code to string.
static AclPtr parse(data::ConstElementPtr cfg)
Parse an access control list.
static ResponseFilterList parse(data::ConstElementPtr cfg)
Parse a response filter list.
RoleConfig(const std::string &name, const AclPtr &accept, const AclPtr &reject, bool others, bool preference, const ResponseFilterList &response_filters)
Constructor.
static http::HttpResponseJsonPtr createReject(const http::HttpRequestPtr &request, const http::HttpStatusCode &status_code)
Create a reject response.
static const data::SimpleKeywords ROLE_PARAMETERS
Role configuration parameters.
static RoleConfigPtr parse(data::ConstElementPtr cfg, std::string name="")
Parse a role config.
static RoleConfigPtr getConfig(const std::string &role)
Return the role config.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
std::map< std::string, isc::data::Element::types > SimpleKeywords
This specifies all accepted keywords with their types.
HttpStatusCode
HTTP status codes (cf RFC 2068).
boost::shared_ptr< HttpResponseJson > HttpResponseJsonPtr
Pointer to the HttpResponseJson object.
boost::shared_ptr< HttpRequest > HttpRequestPtr
Pointer to the HttpRequest object.
boost::shared_ptr< RoleConfig > RoleConfigPtr
Type of shared pointers to role configurations.
RolePtr roleAssign
The role assignment.
boost::shared_ptr< Acl > AclPtr
Type of shared pointers to Acl.
std::list< ResponseFilterPtr > ResponseFilterList
The type of list of shared pointers to response filters.
boost::shared_ptr< Role > RolePtr
Type of shared pointers to Role.
std::map< std::string, RoleConfigPtr > RoleConfigTable
Type of the role configurations table.
RoleConfigPtr defaultRoleConfig
The default (role is "") role configuration.
RoleConfigPtr unknownRoleConfig
The unknown (role is not in the table) role configuration.
RoleConfigTable roleConfigTable
The role configurations table.
Defines the logger used by the top-level component of kea-lfc.
unsigned minor_
Minor HTTP version.
unsigned major_
Major HTTP version.