userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
implicit_options.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <
userver/engine/mutex.hpp
>
7
#include <
userver/server/handlers/http_handler_base.hpp
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
server {
12
class
Server
;
13
}
// namespace server
14
15
namespace
server::http
{
16
class
HandlerInfoIndex;
17
}
// namespace server::http
18
19
namespace
server::handlers::auth {
20
class
AuthCheckerBase;
21
using
AuthCheckerBasePtr = std::shared_ptr<AuthCheckerBase>;
22
}
// namespace server::handlers::auth
23
24
namespace
server::handlers
{
25
68
class
ImplicitOptions
/*non-final*/
:
public
HttpHandlerBase {
69
public
:
72
static
constexpr
std::string_view
kName
=
"handler-implicit-http-options"
;
73
74
ImplicitOptions(
75
const
components::ComponentConfig
& config,
76
const
components::ComponentContext
& component_context,
77
bool
is_monitor =
false
78
);
79
80
~ImplicitOptions()
override
;
81
82
std::string
HandleRequestThrow
(
const
server::http::HttpRequest
&
request
,
server::request::RequestContext
& context)
83
const override
;
84
85
static
yaml_config::Schema
GetStaticConfigSchema
();
86
87
private
:
88
using
AuthCheckers = std::unordered_map<std::string, auth::AuthCheckerBasePtr>;
89
90
std::string ExtractAllowedMethods(
const
std::string& path)
const
;
91
92
const
http::HandlerInfoIndex& GetHandlerInfoIndex()
const
;
93
94
const
Server
& server_;
95
const
AuthCheckers auth_checkers_;
96
97
mutable
engine::Mutex
handler_info_index_mutex_;
98
mutable
const
http::HandlerInfoIndex* handler_info_index_ =
nullptr
;
99
};
100
101
}
// namespace server::handlers
102
103
template
<>
104
inline
constexpr
bool
components::kHasValidate<server::handlers::ImplicitOptions>
=
true
;
105
106
USERVER_NAMESPACE_END
userver
server
handlers
implicit_options.hpp
Generated on
for userver by
Doxygen
1.17.0