Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Secure parameters - #4311

Closed
olavloite wants to merge 2 commits into
googleapis:mainfrom
aseering:secure-parameters
Closed

Secure parameters#4311
olavloite wants to merge 2 commits into
googleapis:mainfrom
aseering:secure-parameters

Conversation

@olavloite

Copy link
Copy Markdown
Collaborator

(Creating Draft PR so it's easier to leave comments)

This change adds support for ClientContext in Options and ensures it is
propagated to ExecuteSql, Read, Commit, and BeginTransaction requests.
It aligns with go/spanner-client-scoped-session-state design.

- Added RequestOptions.ClientContext to Options.
- Refactored request option building to Options.toRequestOptionsProto.
- Updated AbstractReadContext, TransactionRunnerImpl, and SessionImpl to use the shared logic.
- Added tests.
This change adds support for setting and propagating ClientContext in the
Spanner Connection API. ClientContext allows propagating client-scoped
session state (e.g., secure parameters) to Spanner RPCs.

- Added setClientContext/getClientContext to Connection interface and implementation.
- Implemented state propagation from Connection to UnitOfWork and its implementations (ReadWriteTransaction, SingleUseTransaction).
- Fixed accidental import removal in OptionsTest.java.
- Fixed TransactionRunnerImplTest to correctly verify ClientContext propagation.
- Added ClientContextMockServerTest for end-to-end verification.
@product-auto-label product-auto-label Bot added size: l Pull request size is large. api: spanner Issues related to the googleapis/java-spanner API. labels Jan 21, 2026
}

@Test
public void testBeginTransaction_PropagatesClientContext() {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This test seems to be a bit confused about what is the correct/expected behavior.

@olavloite olavloite closed this Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants