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
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 @ref server::handlers::auth::NonceCacheSettingsComponent
45 static constexpr std::string_view kName = "nonce-cache-settings";
46
47 NonceCacheSettingsComponent(const components::ComponentConfig& config, const components::ComponentContext& context);
48
49 ~NonceCacheSettingsComponent() final;
50
51 const NonceCacheSettings& GetSettings() const;
52
53 static yaml_config::Schema GetStaticConfigSchema();
54
55private:
56 NonceCacheSettings settings_;
57};
58
59} // namespace server::handlers::auth::digest
60
61template <>
62inline constexpr bool components::kHasValidate<server::handlers::auth::digest::NonceCacheSettingsComponent> = true;
63
64USERVER_NAMESPACE_END