Gapic::Rest::ClientStub#initialize already yields the Faraday connection after setup:
# gapic-common/lib/gapic/rest/client_stub.rb:94
yield @connection if block_given?
However, none of the auto-generated ServiceStub classes pass a block through when creating the ClientStub, so this hook is unreachable from the public API.
Use case: Configuring mTLS client certificates on the Faraday connection for services that require mutual TLS authentication (e.g., connecting to an API gateway that validates client certs).
# What we'd like to do:
connection.ssl.client_cert = OpenSSL::X509::Certificate.new(cert_pem)
connection.ssl.client_key = OpenSSL::PKey::RSA.new(key_pem)
Proposed fix: Update the generator template for REST ServiceStub#initialize to accept and forward &block to ClientStub.new.
Affected version: gapic-common 1.0.0, google-cloud-ai_platform-v1 1.17.0
Gapic::Rest::ClientStub#initializealready yields the Faraday connection after setup:However, none of the auto-generated
ServiceStubclasses pass a block through when creating theClientStub, so this hook is unreachable from the public API.Use case: Configuring mTLS client certificates on the Faraday connection for services that require mutual TLS authentication (e.g., connecting to an API gateway that validates client certs).
Proposed fix: Update the generator template for REST
ServiceStub#initializeto accept and forward&blocktoClientStub.new.Affected version:
gapic-common1.0.0,google-cloud-ai_platform-v11.17.0