Kea 3.1.9
cmd_response_creator.h
Go to the documentation of this file.
1// Copyright (C) 2021-2026 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef CMD__RESPONSE_CREATOR_H
8#define CMD__RESPONSE_CREATOR_H
9
12#include <boost/shared_ptr.hpp>
13#include <unordered_set>
14
15namespace isc {
16namespace config {
17
33public:
34
43
52 const http::HttpStatusCode& status_code) const;
53
64 const data::ConstElementPtr& body,
65 const std::unordered_set<std::string>& accept);
66
75
79 static std::unordered_set<std::string> command_accept_list_;
80
83
84private:
85
97 createStockHttpResponseInternal(const http::HttpRequestPtr& request,
98 const http::HttpStatusCode& status_code) const;
99
105 createDynamicHttpResponse(http::HttpRequestPtr request);
106};
107
109typedef boost::shared_ptr<CmdResponseCreator> CmdResponseCreatorPtr;
110
111} // end of namespace isc::config
112} // end of namespace isc
113
114#endif
Concrete implementation of the HTTP response creator used for processing API commands.
http::HttpResponseJsonPtr filterCommand(const http::HttpRequestPtr &request, const data::ConstElementPtr &body, const std::unordered_set< std::string > &accept)
Filter commands.
static http::HttpAuthConfigPtr http_auth_config_
The server current authentication configuration.
virtual http::HttpResponsePtr createStockHttpResponse(const http::HttpRequestPtr &request, const http::HttpStatusCode &status_code) const
Creates stock HTTP response.
static bool EMULATE_AGENT_RESPONSE
The emulate agent response flag.
virtual http::HttpRequestPtr createNewHttpRequest() const
Create a new request.
static std::unordered_set< std::string > command_accept_list_
The server command accept list.
Specifies an interface for classes creating HTTP responses from HTTP requests.
boost::shared_ptr< CmdResponseCreator > CmdResponseCreatorPtr
Pointer to the CmdResponseCreator.
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:30
HttpStatusCode
HTTP status codes (cf RFC 2068)
Definition response.h:30
boost::shared_ptr< HttpAuthConfig > HttpAuthConfigPtr
Type of shared pointers to HTTP authentication configuration.
Definition auth_config.h:97
boost::shared_ptr< HttpResponseJson > HttpResponseJsonPtr
Pointer to the HttpResponseJson object.
boost::shared_ptr< HttpResponse > HttpResponsePtr
Pointer to the HttpResponse object.
Definition response.h:81
boost::shared_ptr< HttpRequest > HttpRequestPtr
Pointer to the HttpRequest object.
Definition request.h:30
Defines the logger used by the top-level component of kea-lfc.