feat(spanner): auth login support for Spanner Omni endpoints#13470
Conversation
ed429f9 to
538b901
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces username and password authentication for Spanner Omni using the OPAQUE protocol. It adds the necessary gRPC service stubs, cryptographic utilities (including Argon2 stretching and Simplified SWU mapping), and a new SpannerOmniCredentials class to handle token refresh. Feedback on the changes highlights a security vulnerability in SpannerOmniCredentials where sensitive password bytes could remain in memory if an exception occurs during encoding. Additionally, improvements are suggested to enforce exact envelope size checks in LoginClient to avoid unhandled exceptions, and to ensure both username and password are non-empty in SpannerOmniHelper before attempting login.
d0d0b69 to
520c75b
Compare
a4cfbf1 to
0012a2d
Compare
0012a2d to
a4874c5
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces OPAQUE protocol authentication support for Spanner Omni. It adds new dependencies on Bouncy Castle and Tink, introduces a login method to SpannerOptions and ConnectionOptions, and implements the OPAQUE cryptographic handshake via several new classes including LoginClient, OpaqueUtil, and SpannerOmniCredentials. A security concern was raised regarding OpaqueUtil.expandMessageXmd, where intermediate sensitive arrays derived from the password are not zeroed out after use, potentially exposing cryptographic material in memory.
|
PTAL @styee |
styee
left a comment
There was a problem hiding this comment.
This matches the Go and C++ implementations. There are few things Gemini found, I will apply the same findings elsewhere.
…ON_CREDENTIALS env var
9161519 to
e15ec8c
Compare
This PR introduces native authentication support for Spanner Omni endpoints using the OPAQUE password-authenticated key exchange protocol.
Key Changes:
Login.java,Authentication.java,LoginServiceGrpc.java) and a gRPCLoginClientto handle the authentication handshake with Omni endpoints.LoginClientutilizingOpaqueUtilto perform the secure two-step OPAQUE authentication flow over gRPC.ConnectionOptionsandSpannerOptions.Builderwith a newlogin(username, password)method to wire up Omni credentials. The channel initialization logic was moved toprepareBuilder()to ensure the builder pattern remains order-independent.To run Integration Tests with auth login run below command with default username/password
Design Document: Spanner Omni Auth Login