channel_creds_registry_init.cc
Go to the documentation of this file.
1 //
2 //
3 // Copyright 2022 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 
20 
21 #include <memory>
22 
23 #include "absl/memory/memory.h"
24 #include "absl/strings/string_view.h"
25 
26 #include <grpc/grpc.h>
27 #include <grpc/grpc_security.h>
28 
31 #include "src/core/lib/json/json.h"
35 
36 namespace grpc_core {
37 
39  public:
40  absl::string_view creds_type() const override { return "google_default"; }
41  bool IsValidConfig(const Json& /*config*/) const override { return true; }
43  const Json& /*config*/) const override {
46  }
47 };
48 
50  public:
51  absl::string_view creds_type() const override { return "insecure"; }
52  bool IsValidConfig(const Json& /*config*/) const override { return true; }
54  const Json& /*config*/) const override {
57  }
58 };
59 
61  public:
62  absl::string_view creds_type() const override { return "fake"; }
63  bool IsValidConfig(const Json& /*config*/) const override { return true; }
65  const Json& /*config*/) const override {
68  }
69 };
70 
72  builder->channel_creds_registry()->RegisterChannelCredsFactory(
73  absl::make_unique<GoogleDefaultChannelCredsFactory>());
74  builder->channel_creds_registry()->RegisterChannelCredsFactory(
75  absl::make_unique<InsecureChannelCredsFactory>());
76  builder->channel_creds_registry()->RegisterChannelCredsFactory(
77  absl::make_unique<FakeChannelCredsFactory>());
78 }
79 
80 } // namespace grpc_core
fake_credentials.h
core_configuration.h
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::CoreConfiguration::Builder
Definition: core_configuration.h:41
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::FakeChannelCredsFactory
Definition: channel_creds_registry_init.cc:60
grpc_core::InsecureChannelCredsFactory::IsValidConfig
bool IsValidConfig(const Json &) const override
Definition: channel_creds_registry_init.cc:52
grpc_security.h
channel_creds_registry.h
credentials.h
grpc_core::InsecureChannelCredsFactory::creds_type
absl::string_view creds_type() const override
Definition: channel_creds_registry_init.cc:51
profile_analyzer.builder
builder
Definition: profile_analyzer.py:159
grpc_core::RefCountedPtr< grpc_channel_credentials >
Json
JSON (JavaScript Object Notation).
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:227
grpc_core::FakeChannelCredsFactory::IsValidConfig
bool IsValidConfig(const Json &) const override
Definition: channel_creds_registry_init.cc:63
grpc_core::FakeChannelCredsFactory::creds_type
absl::string_view creds_type() const override
Definition: channel_creds_registry_init.cc:62
grpc.h
grpc_fake_transport_security_credentials_create
grpc_channel_credentials * grpc_fake_transport_security_credentials_create()
Definition: fake_credentials.cc:79
grpc_insecure_credentials_create
GRPCAPI grpc_channel_credentials * grpc_insecure_credentials_create()
Definition: core/lib/security/credentials/insecure/insecure_credentials.cc:64
grpc_core::ChannelCredsFactory
Definition: channel_creds_registry.h:37
json.h
grpc_core::FakeChannelCredsFactory::CreateChannelCreds
RefCountedPtr< grpc_channel_credentials > CreateChannelCreds(const Json &) const override
Definition: channel_creds_registry_init.cc:64
grpc_core::InsecureChannelCredsFactory
Definition: channel_creds_registry_init.cc:49
grpc_core::RegisterChannelDefaultCreds
void RegisterChannelDefaultCreds(CoreConfiguration::Builder *builder)
Definition: channel_creds_registry_init.cc:71
grpc_core::GoogleDefaultChannelCredsFactory::CreateChannelCreds
RefCountedPtr< grpc_channel_credentials > CreateChannelCreds(const Json &) const override
Definition: channel_creds_registry_init.cc:42
ref_counted_ptr.h
grpc_core::InsecureChannelCredsFactory::CreateChannelCreds
RefCountedPtr< grpc_channel_credentials > CreateChannelCreds(const Json &) const override
Definition: channel_creds_registry_init.cc:53
grpc_core::GoogleDefaultChannelCredsFactory::IsValidConfig
bool IsValidConfig(const Json &) const override
Definition: channel_creds_registry_init.cc:41
grpc_google_default_credentials_create
GRPCAPI grpc_channel_credentials * grpc_google_default_credentials_create(grpc_call_credentials *call_credentials)
Definition: google_default_credentials.cc:429
grpc_core::GoogleDefaultChannelCredsFactory::creds_type
absl::string_view creds_type() const override
Definition: channel_creds_registry_init.cc:40
grpc_core::GoogleDefaultChannelCredsFactory
Definition: channel_creds_registry_init.cc:38
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:52