Skip to content

fix(spanner): support plaintext connections for Spanner Omni in pool - #14956

Open
olavloite wants to merge 1 commit into
mainfrom
spanner-omni-plain-text-in-pool
Open

olavloite wants to merge 1 commit into
mainfrom
spanner-omni-plain-text-in-pool

Conversation

@olavloite

Copy link
Copy Markdown
Contributor

Spanner Omni instances are often deployed in local or edge environments (such as local Docker containers for development and testing) where TLS certificates are not configured. In these scenarios, clients authenticate using a username and password over an unencrypted connection.

Previously, when a connection requested plaintext communication, the connection pool unconditionally stripped all credentials and failed to properly configure plaintext transport on the underlying client. This made it impossible to authenticate with local Spanner Omni instances because the credentials were discarded and token refreshes attempted to use TLS against an unencrypted endpoint.

This change ensures that plaintext Spanner Omni connections retain their credentials and configure plaintext transport correctly. Connections to Cloud Spanner and the emulator continue to have their credentials stripped to prevent credential leakage over unencrypted channels.

Spanner Omni instances are often deployed in local or edge environments
(such as local Docker containers for development and testing) where TLS
certificates are not configured. In these scenarios, clients authenticate
using a username and password over an unencrypted connection.

Previously, when a connection requested plaintext communication, the
connection pool unconditionally stripped all credentials and failed to
properly configure plaintext transport on the underlying client. This made
it impossible to authenticate with local Spanner Omni instances because the
credentials were discarded and token refreshes attempted to use TLS against
an unencrypted endpoint.

This change ensures that plaintext Spanner Omni connections retain their
credentials and configure plaintext transport correctly. Connections to
Cloud Spanner and the emulator continue to have their credentials stripped
to prevent credential leakage over unencrypted channels.
@olavloite
olavloite requested review from a team as code owners November 10, 2026 14:47

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates SpannerPool to support SpannerOmniCredentials when using plain text connections. It replaces the manual plaintext channel configuration with builder.usePlainText() and allows credentials to be retained if they are an instance of SpannerOmniCredentials. Additionally, several unit tests have been added to SpannerPoolTest to verify the creation of Spanner instances with Omni credentials under different configurations. I have no feedback to provide.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant