userver
C++ Async Framework
Loading...
Searching...
No Matches
component.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/storages/secdist/component.hpp
4
/// @brief @copybrief components::Secdist
5
6
#
include
<
string
>
7
8
#
include
<
userver
/
components
/
component_base
.
hpp
>
9
#
include
<
userver
/
storages
/
secdist
/
secdist
.
hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
components
{
14
// clang-format off
15
16
/// @ingroup userver_components
17
///
18
/// @brief Component that stores security related data (keys, passwords, ...).
19
///
20
/// The component must be configured in service config.
21
///
22
/// Secdist requires a provider storages::secdist::SecdistProvider
23
/// You can implement your own or use components::DefaultSecdistProvider
24
///
25
/// ## Static configuration example:
26
///
27
/// @snippet samples/redis_service/static_config.yaml Sample secdist static config
28
///
29
/// ## Static options:
30
/// Name | Description | Default value
31
/// ---- | ----------- | -------------
32
/// provider | optional secdist provider component name | 'default-secdist-provider'
33
/// update-period | period between data updates in utils::StringToDuration() suitable format ('0s' for no updates) | 0s
34
35
// clang-format on
36
37
class
Secdist
final
:
public
ComponentBase {
38
public
:
39
/// @ingroup userver_component_names
40
/// @brief The default name of components::Secdist
41
static
constexpr
std
::
string_view
kName
=
"secdist"
;
42
43
Secdist(
const
ComponentConfig&,
const
ComponentContext&);
44
45
const
storages::
secdist
::SecdistConfig& Get()
const
;
46
47
rcu::ReadablePtr<storages::secdist::SecdistConfig> GetSnapshot()
const
;
48
49
storages::
secdist
::Secdist& GetStorage();
50
51
static
yaml_config
::Schema GetStaticConfigSchema();
52
53
private
:
54
storages::
secdist
::Secdist secdist_;
55
};
56
57
template
<>
58
inline
constexpr
bool
kHasValidate<
Secdist
> =
true
;
59
60
template
<>
61
inline
constexpr
auto
kConfigFileMode
<
Secdist
> =
ConfigFileMode
::
kNotRequired
;
62
63
}
// namespace components
64
65
USERVER_NAMESPACE_END
userver
storages
secdist
component.hpp
Generated on Tue Nov 19 2024 11:25:23 for userver by
Doxygen
1.10.0