userver: userver/server/handlers/auth/digest/nonce_cache_settings_component.hpp Source File
Loading...
Searching...
No Matches
nonce_cache_settings_component.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/server/handlers/auth/digest/nonce_cache_settings_component.hpp
4/// @brief @copybrief server::handlers::auth::digest::NonceCacheSettingsComponent
5
6#include <chrono>
7#include <cstddef>
8#include <optional>
9#include <string>
10
11#include <userver/components/component_base.hpp>
12#include <userver/dynamic_config/source.hpp>
13#include <userver/server/handlers/auth/digest/auth_checker_settings_component.hpp>
14
15#include "auth_checker_settings.hpp"
16
17USERVER_NAMESPACE_BEGIN
18
19namespace server::handlers::auth::digest {
20
22 std::size_t ways{};
23 std::size_t way_size{};
24};
25
26// clang-format off
27
28/// @brief Component that loads nonce cache settings from a static_config.yaml
29///
30/// ## Static options of server::handlers::auth::digest::NonceCacheSettingsComponent :
31/// @include{doc} scripts/docs/en/components_schema/core/src/server/handlers/auth/digest/nonce_cache_settings_component.md
32///
33/// Options inherited from @ref server::handlers::auth::digest::AuthCheckerSettingsComponent :
34/// @include{doc} scripts/docs/en/components_schema/core/src/server/handlers/auth/digest/auth_checker_settings_component.md
35///
36/// Options inherited from @ref components::ComponentBase :
37/// @include{doc} scripts/docs/en/components_schema/core/src/components/impl/component_base.md
38
39// clang-format on
40
41class NonceCacheSettingsComponent final : public AuthCheckerSettingsComponent {
42public:
43 /// @ingroup userver_component_names
44 /// @brief The default name of
45 /// server::handlers::auth::NonceCacheSettingsComponent
46 static constexpr std::string_view kName = "nonce-cache-settings";
47
48 NonceCacheSettingsComponent(const components::ComponentConfig& config, const components::ComponentContext& context);
49
50 ~NonceCacheSettingsComponent() final;
51
52 const NonceCacheSettings& GetSettings() const;
53
54 static yaml_config::Schema GetStaticConfigSchema();
55
56private:
57 NonceCacheSettings settings_;
58};
59
60} // namespace server::handlers::auth::digest
61
62template <>
63inline constexpr bool components::kHasValidate<server::handlers::auth::digest::NonceCacheSettingsComponent> = true;
64
65USERVER_NAMESPACE_END