Skip to content

feat: Add migration op event context redaction tests - #385

Merged
keelerm84 merged 2 commits into
v3from
mk/sdk-2716/migration-context-redaction-v3
Jul 20, 2026
Merged

keelerm84 merged 2 commits into
v3from
mk/sdk-2716/migration-context-redaction-v3

Conversation

@keelerm84

@keelerm84 keelerm84 commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

Summary

v3 port of #383.

Migration op events inline the evaluation context, but the harness only verified the context key -- it never checked that private attributes were redacted, so an SDK could leak private context attributes in migration_op events while still passing the suite.

Adds a redacts private context attributes test (gated on inline-context-all) covering all-attributes-private, globally-configured private attributes, context-specified private attributes, and nested-property private references, each asserting the migration op event context via JSONMatchesEventContext. Also strengthens the existing redacts anonymous context attributes migration test, which previously only checked the context key.

The only difference from the v2 change is the NewSDKDataSource -> NewSDKDataSystem rename.


Note

Low Risk
Test-harness-only changes; no runtime SDK or production behavior is modified.

Overview
Adds harness coverage so migration op events cannot pass while leaking private context when SDKs inline full contexts (inline-context-all).

A new redacts private context attributes subtest runs migration operations and asserts the op event context via JSONMatchesEventContext for all-attributes-private, global private attributes, per-context Private(), and nested /address/city paths. The existing anonymous redaction migration test is tightened the same way when inlining is enabled (nullified fields plus _meta.redactedAttributes), not just the context key.

createClient now accepts optional SDKConfigurer values (e.g. WithEventsConfig) and applies them before the event sink so events config merges correctly.

Reviewed by Cursor Bugbot for commit 1bcb332. Bugbot is set up for automated code reviews on this repo. Configure here.

Migration op events inline the evaluation context, but the harness only
verified the context key -- never that private attributes were redacted.
Add coverage for all-attributes-private, globally-configured private
attributes, context-specified private attributes, and nested-property
private references, asserting the redacted context via
JSONMatchesEventContext. Also strengthen the existing anonymous-redaction
migration test, which previously only checked the context key.

Relates to SDK-2716, SEC-8527.
@keelerm84
keelerm84 marked this pull request as ready for review July 20, 2026 14:48
@keelerm84
keelerm84 requested a review from a team as a code owner July 20, 2026 14:48
@keelerm84 keelerm84 changed the title test: Add migration op event context redaction tests feat: Add migration op event context redaction tests Jul 20, 2026
@keelerm84
keelerm84 merged commit 34d68e9 into v3 Jul 20, 2026
8 checks passed
@keelerm84
keelerm84 deleted the mk/sdk-2716/migration-context-redaction-v3 branch July 20, 2026 16:27
kinyoklion pushed a commit that referenced this pull request Aug 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[3.2.0-alpha.6](v3.1.1-alpha.6...v3.2.0-alpha.6)
(2026-08-12)


### Features

* Add contract test for streaming connection close on client shutdown
([#403](#403))
([0f91b2a](0f91b2a))
* Add contract tests for client-side secure mode hash (h query param)
([#376](#376))
([3e3012c](3e3012c))
* Add hook-environment-id capability and test
([#412](#412))
([922989a](922989a))
* Add migration op event context redaction tests
([#385](#385))
([34d68e9](34d68e9))
* add tests for handling redacting attributes prefixed with `/`
correctly
([#381](#381))
([ff6929d](ff6929d))
* Verify the in operator keeps booleans and numbers distinct
([fac2879](fac2879))


### Bug Fixes

* Correct privateAttributes JSON tag in context comparison params
([#392](#392))
([d9d2c01](d9d2c01))
* Fix capability guarding custom event redaction
([#387](#387))
([4d3419b](4d3419b))
* Only expect custom-event anonymous redaction for server SDKs
([#389](#389))
([032ae14](032ae14))
* prevent client side wrapper test datasystem from colliding with
primary connection mode
([#394](#394))
([fb40bc6](fb40bc6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **Release-only PR** — bumps the package from `3.1.1-alpha.6` to
**`3.2.0-alpha.6`** in `.release-please-manifest.json`, `main.go`
(`versionString`), and adds the matching **CHANGELOG** section.
> 
> No harness or test code changes appear in this diff; the changelog
summarizes work already merged on the branch (new contract tests for
streaming shutdown, client-side secure mode `h` param,
hook-environment-id, migration/context redaction, `/`-prefixed attribute
redaction, and `in` operator type distinction, plus fixes for
`privateAttributes` JSON tagging, custom-event redaction capability
guards, server-only anonymous redaction expectations, and client-side
wrapper datasystem collision).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
104ac51. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

4 participants