userver: userver/server/handlers/auth/auth_checker_settings_component.hpp Source File
Loading...
Searching...
No Matches
auth_checker_settings_component.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/server/handlers/auth/auth_checker_settings_component.hpp
4/// @brief @copybrief components::AuthCheckerSettings
5
6#include <userver/components/component_base.hpp>
7#include <userver/storages/secdist/component.hpp>
8
10
11USERVER_NAMESPACE_BEGIN
12
13namespace components {
14
15// clang-format off
16
17/// @ingroup userver_components
18///
19/// @brief Component that loads auth configuration settings from a
20/// components::Secdist component if the latter was registered in
21/// components::ComponentList.
22///
23/// The component does **not** have any options for service config.
24
25// clang-format on
26
27class AuthCheckerSettings final : public ComponentBase {
28public:
29 AuthCheckerSettings(const ComponentConfig&, const ComponentContext&);
30
31 /// @ingroup userver_component_names
32 /// @brief The default name of components::AuthCheckerSettings
33 static constexpr std::string_view kName = "auth-checker-settings";
34
35 const server::handlers::auth::AuthCheckerSettings& Get() const { return settings_; }
36
37 static yaml_config::Schema GetStaticConfigSchema();
38
39private:
40 server::handlers::auth::AuthCheckerSettings settings_;
41};
42
43template <>
44inline constexpr bool kHasValidate<AuthCheckerSettings> = true;
45
46template <>
47inline constexpr auto kConfigFileMode<AuthCheckerSettings> = ConfigFileMode::kNotRequired;
48
49} // namespace components
50
51USERVER_NAMESPACE_END