userver: userver/server/handlers/auth/digest/auth_checker_settings_component.hpp Source File
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
auth_checker_settings_component.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/server/handlers/auth/digest/auth_checker_settings_component.hpp
4/// @brief @copybrief server::handlers::auth::digest::AuthCheckerSettingsComponent
5
6#include <chrono>
7#include <optional>
8#include <string>
9
10#include <userver/components/component_base.hpp>
11#include <userver/dynamic_config/source.hpp>
12
14
15USERVER_NAMESPACE_BEGIN
16
17namespace server::handlers::auth::digest {
18
19// clang-format off
20
21/// @brief Component that loads digest auth configuration settings from a
22/// static_config.yaml
23/// ## Static options:
24///
25/// Name | Description | Default value
26/// ---------- | ---------------------------------------------- | -------------
27/// algorithm | algorithm for hashing nonce   | sha256
28/// domains | list of URIs, that define the protection space | /
29/// qops | list of supported qop-options. Use `auth` for authentication and `auth-in` for authentication with integrity protection | auth
30/// is-proxy | indicates that the server is a proxy server. If set, the Proxy prefix is inserted into the header | false
31/// is-session | activate session algorithm (md5-sess, sha256-sess or sha512-sess) | false
32/// nonce-ttl | ttl for nonce | 10s
33
34// clang-format on
35
37public:
38 /// @ingroup userver_component_names
39 /// @brief The default name of
40 /// server::handlers::auth::digest::AuthCheckerSettingsComponent
41 static constexpr std::string_view kName = "auth-digest-checker-settings";
42
43 AuthCheckerSettingsComponent(
44 const components::ComponentConfig& config,
45 const components::ComponentContext& context
46 );
47
48 ~AuthCheckerSettingsComponent() override;
49
50 const AuthCheckerSettings& GetSettings() const;
51
52 static yaml_config::Schema GetStaticConfigSchema();
53
54private:
55 AuthCheckerSettings settings_;
56};
57
58} // namespace server::handlers::auth::digest
59
60template <>
61inline constexpr bool components::kHasValidate<server::handlers::auth::digest::AuthCheckerSettingsComponent> = true;
62
63USERVER_NAMESPACE_END