userver: userver/server/handlers/auth/digest/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
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/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
39public:
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(
46 const components::ComponentConfig& config,
47 const components::ComponentContext& context
48 );
49
50 ~AuthCheckerSettingsComponent() override;
51
52 const AuthCheckerSettings& GetSettings() const;
53
54 static yaml_config::Schema GetStaticConfigSchema();
55
56private:
57 AuthCheckerSettings settings_;
58};
59
60} // namespace server::handlers::auth::digest
61
62template <>
63inline constexpr bool components::kHasValidate<server::handlers::auth::digest::AuthCheckerSettingsComponent> = true;
64
65USERVER_NAMESPACE_END