Skip to content

Commit b6282f0

Browse files
committed
Fix nit comments. Removes watcher methods from python
1 parent b22f6fb commit b6282f0

5 files changed

Lines changed: 4 additions & 14 deletions

File tree

include/grpcpp/security/tls_certificate_provider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ struct GRPCXX_DLL IdentityKeyCertPair {
5353
// A basic CertificateProviderInterface implementation that will load credential
5454
// data from static string during initialization. This provider will always
5555
// return the same cert data for all cert names, and reloading is not supported.
56-
class GRPCXX_DLL StaticDataCertificateProvider
57-
: public CertificateProviderInterface {
56+
class [[deprecated("Use InMemoryCertificateProvider instead")]] GRPCXX_DLL
57+
StaticDataCertificateProvider : public CertificateProviderInterface {
5858
public:
5959
StaticDataCertificateProvider(
6060
const std::string& root_certificate,

src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ InMemoryCertificateProvider::InMemoryCertificateProvider()
432432
if (!info.root_being_watched && !info.identity_being_watched) {
433433
watcher_info_.erase(cert_name);
434434
}
435-
ExecCtx exec_ctx;
436435
if (roots != nullptr || pem_key_cert_pairs.has_value()) {
437436
distributor_->SetKeyMaterials(cert_name, roots, pem_key_cert_pairs);
438437
}
@@ -469,7 +468,6 @@ absl::Status InMemoryCertificateProvider::Update(
469468
pem_key_cert_pairs_ = *pem_key_cert_pairs;
470469
}
471470
if (root_changed || identity_cert_changed) {
472-
ExecCtx exec_ctx;
473471
grpc_error_handle root_cert_error =
474472
GRPC_ERROR_CREATE("Unable to get latest root certificates.");
475473
grpc_error_handle identity_cert_error =
@@ -568,6 +566,7 @@ grpc_tls_certificate_provider_in_memory_create() {
568566

569567
bool grpc_tls_certificate_provider_in_memory_set_root_certificate(
570568
grpc_tls_certificate_provider* provider, const char* root_cert) {
569+
grpc_core::ExecCtx exec_ctx;
571570
auto in_memory_provider =
572571
grpc_core::DownCast<grpc_core::InMemoryCertificateProvider*>(provider);
573572
return in_memory_provider
@@ -578,6 +577,7 @@ bool grpc_tls_certificate_provider_in_memory_set_root_certificate(
578577
bool grpc_tls_certificate_provider_in_memory_set_identity_certificate(
579578
grpc_tls_certificate_provider* provider,
580579
grpc_tls_identity_pairs* pem_key_cert_pairs) {
580+
grpc_core::ExecCtx exec_ctx;
581581
grpc_core::PemKeyCertPairList identity_pairs_core;
582582
if (pem_key_cert_pairs != nullptr) {
583583
identity_pairs_core = std::move(pem_key_cert_pairs->pem_key_cert_pairs);

src/cpp/common/tls_certificate_provider.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ absl::Status InMemoryCertificateProvider::UpdateRoot(
9494
c_provider_, root_certificate.c_str())
9595
? absl::OkStatus()
9696
: absl::InternalError("Unable to update root certificate");
97-
;
9897
}
9998

10099
absl::Status InMemoryCertificateProvider::UpdateIdentityKeyCertPair(

src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -625,14 +625,6 @@ cdef extern from "grpc/credentials.h":
625625
grpc_tls_identity_pairs* pem_key_cert_pairs
626626
) nogil
627627

628-
629-
630-
void grpc_tls_credentials_options_watch_root_certs(
631-
grpc_tls_credentials_options *options) nogil
632-
633-
void grpc_tls_credentials_options_watch_identity_key_cert_pairs(
634-
grpc_tls_credentials_options *options) nogil
635-
636628
void grpc_tls_certificate_provider_release(
637629
grpc_tls_certificate_provider *provider) nogil
638630

test/core/credentials/transport/tls/grpc_tls_certificate_provider_test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,6 @@ TEST_F(GrpcTlsCertificateProviderTest,
896896
// Watcher watching only identity certs.
897897
WatcherState* identity_watcher =
898898
MakeWatcher(provider.distributor(), std::nullopt, kCertName);
899-
900899
// Initial State.
901900
EXPECT_THAT(
902901
both_watcher->GetCredentialQueue(),

0 commit comments

Comments
 (0)