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