feat(bigquery-jdbc): add SSLTrustStoreType and SSLTrustStoreProvider connection properties#13858
Conversation
…er` connection properties
There was a problem hiding this comment.
Code Review
This pull request adds support for configuring the SSL TrustStore type and provider in the BigQuery JDBC driver, allowing users to customize how the KeyStore is loaded. The feedback recommends removing redundant String.valueOf() calls on variables that are already strings in DataSource.java, and suggests making the loadKeyStore method in BigQueryJdbcProxyUtility.java more robust by checking for and trimming empty or blank strings to prevent potential exceptions.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for configuring the SSL TrustStore type and provider in the BigQuery JDBC driver, updating connection properties, data source configuration, and key store loading logic. A review comment correctly identifies a bug in the integration test where the truststore password property is incorrectly named 'SSLTrustStorePassword' instead of 'SSLTrustStorePwd', which prevents the password from being passed to the driver.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for configuring a custom SSL TrustStore type and provider in the BigQuery JDBC driver by introducing the SSLTrustStoreType and SSLTrustStoreProvider connection properties. These properties are propagated through the connection and data source configurations to customize how the KeyStore is loaded. The feedback suggests narrowing the throws clause of the new loadKeyStore helper method from GeneralSecurityException to KeyStoreException and NoSuchProviderException to improve type safety and avoid forcing callers to handle overly broad exceptions.
b/537362384
This PR introduces the
SSLTrustStoreTypeandSSLTrustStoreProviderconnection properties.Key Changes:
SSLTrustStoreType(defaults toKeyStore::getDefaultTypevia lazy evaluation) andSSLTrustStoreProvidertoBigQueryJdbcUrlUtilityand theDataSourcePOJO.BigQueryConnectionand down through toBigQueryJdbcProxyUtility.loadKeyStore()helper method shared by both the REST (Apache HC5) and gRPC (Netty) network transport builders.Testing:
BigQueryJdbcProxyUtilityTestvalidating that passing valid types works and invalid providers correctly throwNoSuchProviderException.ITLocalSslValidationTestto launch a subprocess that explicitly passes the new properties into the JDBC connection URL, proving that the properties can successfully negotiate a real end-to-end TLS handshake against the mock HTTPS server.