userver: userver/ydb/credentials.hpp Source File
Loading...
Searching...
No Matches
credentials.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/ydb/credentials.hpp
4/// @brief @copybrief ydb::CredentialsProviderComponent
5
6#include <memory>
7#include <string>
8
9#include <userver/components/component_base.hpp>
10#include <userver/yaml_config/fwd.hpp>
11
12namespace NYdb {
13class ICredentialsProviderFactory;
14} // namespace NYdb
15
16USERVER_NAMESPACE_BEGIN
17
18namespace ydb {
19
20// clang-format off
21
22/// @ingroup userver_components
23///
24/// @brief Credentials provider component for creating custom credentials provider factory
25///
26/// Allows use custom credentials provider implementation
27/// Required if `ydb::YdbComponent` comnponent config contains `databases.<dbname>.credentials`
28///
29/// see https://ydb.tech/docs/en/concepts/auth
30
31// clang-format on
32
34public:
35 using components::ComponentBase::ComponentBase;
36
37 /// @brief Create credentials provider factory
38 ///
39 /// @param credentials credentials config (`databases.<dbname>.credentials`
40 /// from `ydb::YdbComponent` component config)
41 virtual std::shared_ptr<NYdb::ICredentialsProviderFactory> CreateCredentialsProviderFactory(
42 const yaml_config::YamlConfig& credentials
43 ) const = 0;
44};
45
46} // namespace ydb
47
48USERVER_NAMESPACE_END