re-add experimental::MetadataCredentialsFromPlugin

pull/36176/head
AJ Heller 10 months ago
parent 62fe9dec93
commit fd64d59c23
  1. 14
      src/cpp/client/secure_credentials.cc

@ -464,8 +464,10 @@ class MetadataCredentialsPluginWrapper final : private internal::GrpcLibrary {
} // namespace
namespace experimental {
std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
std::unique_ptr<MetadataCredentialsPlugin> plugin) {
std::unique_ptr<MetadataCredentialsPlugin> plugin,
grpc_security_level min_security_level) {
grpc::internal::GrpcLibrary init; // To call grpc_init().
const char* type = plugin->GetType();
MetadataCredentialsPluginWrapper* wrapper =
@ -475,7 +477,15 @@ std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
MetadataCredentialsPluginWrapper::DebugString,
MetadataCredentialsPluginWrapper::Destroy, wrapper, type};
return WrapCallCredentials(grpc_metadata_credentials_create_from_plugin(
c_plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr));
c_plugin, min_security_level, nullptr));
}
} // namespace experimental
std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
std::unique_ptr<MetadataCredentialsPlugin> plugin) {
return experimental::MetadataCredentialsFromPlugin(
std::move(plugin), GRPC_PRIVACY_AND_INTEGRITY);
}
} // namespace grpc

Loading…
Cancel
Save