grpc
src
core
ext
xds
certificate_provider_registry.h
Go to the documentation of this file.
1
//
2
//
3
// Copyright 2020 gRPC authors.
4
//
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
//
17
//
18
19
#ifndef GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
20
#define GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
21
22
#include <
grpc/support/port_platform.h
>
23
24
#include <memory>
25
26
#include "absl/strings/string_view.h"
27
28
#include "
src/core/ext/xds/certificate_provider_factory.h
"
29
30
namespace
grpc_core
{
31
32
// Global registry for all the certificate provider plugins.
33
class
CertificateProviderRegistry
{
34
public
:
35
// Returns the factory for the plugin keyed by name.
36
static
CertificateProviderFactory
*
LookupCertificateProviderFactory
(
37
absl::string_view
name
);
38
39
// The following methods are used to create and populate the
40
// CertificateProviderRegistry. NOT THREAD SAFE -- to be used only during
41
// global gRPC initialization and shutdown.
42
43
// Global initialization of the registry.
44
static
void
InitRegistry
();
45
46
// Global shutdown of the registry.
47
static
void
ShutdownRegistry
();
48
49
// Register a provider with the registry. Can only be called after calling
50
// InitRegistry(). The key of the factory is extracted from factory
51
// parameter with method CertificateProviderFactory::name. If the same key
52
// is registered twice, an exception is raised.
53
static
void
RegisterCertificateProviderFactory
(
54
std::unique_ptr<CertificateProviderFactory> factory);
55
};
56
57
}
// namespace grpc_core
58
59
#endif // GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
grpc_core::CertificateProviderRegistry::RegisterCertificateProviderFactory
static void RegisterCertificateProviderFactory(std::unique_ptr< CertificateProviderFactory > factory)
Definition:
certificate_provider_registry.cc:85
grpc_core::CertificateProviderRegistry::ShutdownRegistry
static void ShutdownRegistry()
Definition:
certificate_provider_registry.cc:80
grpc_core
Definition:
call_metric_recorder.h:31
grpc_core::CertificateProviderRegistry::InitRegistry
static void InitRegistry()
Definition:
certificate_provider_registry.cc:76
absl::string_view
Definition:
abseil-cpp/absl/strings/string_view.h:167
grpc_core::CertificateProviderRegistry
Definition:
certificate_provider_registry.h:33
setup.name
name
Definition:
setup.py:542
certificate_provider_factory.h
grpc_core::CertificateProviderFactory
Definition:
certificate_provider_factory.h:37
grpc_core::CertificateProviderRegistry::LookupCertificateProviderFactory
static CertificateProviderFactory * LookupCertificateProviderFactory(absl::string_view name)
Definition:
certificate_provider_registry.cc:70
port_platform.h
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:52