userver: userver/server/handlers/implicit_options.hpp Source File
Loading...
Searching...
No Matches
implicit_options.hpp
Go to the documentation of this file.
1#pragma once
2
5
8
9USERVER_NAMESPACE_BEGIN
10
11namespace server {
12class Server;
13} // namespace server
14
15namespace server::http {
16class HandlerInfoIndex;
17} // namespace server::http
18
19namespace server::handlers::auth {
20class AuthCheckerBase;
21using AuthCheckerBasePtr = std::shared_ptr<AuthCheckerBase>;
22} // namespace server::handlers::auth
23
24namespace server::handlers {
25
68class ImplicitOptions /*non-final*/ : public HttpHandlerBase {
69public:
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
83 const override;
84
86
87private:
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
103template <>
105
106USERVER_NAMESPACE_END