Repository navigation
feat: Add migration op event context redaction tests - #383
Merged
Merged
Conversation
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
marked this pull request as ready for review
July 20, 2026 14:43
tanderson-ld
approved these changes
Jul 20, 2026
jsonbailey
approved these changes
Jul 20, 2026
tanderson-ld
pushed a commit
that referenced
this pull request
Jul 20, 2026
🤖 I have created a release *beep* *boop* --- ## [2.38.0](v2.37.0...v2.38.0) (2026-07-20) ### Features * Add contract tests for client-side secure mode hash (h query param) ([#358](#358)) ([16ed598](16ed598)) * Add migration op event context redaction tests ([#383](#383)) ([daa7ad4](daa7ad4)) * Contract tests for client-side prerequisite cycle detection ([#384](#384)) ([3605eb7](3605eb7)) ### Bug Fixes * Fix capability guarding custom event redaction ([#386](#386)) ([357898f](357898f)) --- 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] > **Low Risk** > Mechanical version and changelog update with no runtime or test logic changes in the diff. > > **Overview** > **Release 2.38.0** bumps the harness version from **2.37.0** to **2.38.0** in `main.go` and `.release-please-manifest.json`, and adds a **2.38.0** section to `CHANGELOG.md`. > > The changelog for this release (from already-merged work) covers new contract tests for client-side secure mode hash (`h` query param), migration op event context redaction, and client-side prerequisite cycle detection, plus a fix for capability guarding on custom event redaction tests. This PR does not change test or framework code—only release metadata. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 9ab60fd. 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migration op events inline the evaluation context, but the harness only verified the context key -- it never checked that private attributes were redacted. This meant an SDK could leak private context attributes in
migration_opevents while still passing the suite.This adds a
redacts private context attributestest (gated oninline-context-all) covering:Each asserts the migration op event
contextviaJSONMatchesEventContext, the same redaction matcher used by the ordinary event-context tests.It also strengthens the existing
redacts anonymous context attributesmigration test, which previously only checked the context key, to assert the redacted context when the SDK inlines it.Verified against a server SDK with the redaction bug present (new tests fail, leaking the private attribute) and against the fixed SDK (all migration tests pass).
Note
Low Risk
Test-only changes in the SDK harness; no production runtime behavior is modified.
Overview
Tightens the migration test harness so inline
migration_opevent contexts must redact sensitive attributes, not just match the context key.Adds
redacts private context attributes(requiresinline-context-all) with table-driven cases for all-attributes-private, global private attributes, per-contextPrivate(), and nested paths like/address/city. Each run usesJSONMatchesEventContextto expect stripped values and_meta.redactedAttributes, reusing the same matcher as ordinary event-context tests.When
inline-context-allis enabled,redacts anonymous context attributesnow also asserts the full redacted context viaJSONMatchesEventContext, not only key-level checks.createClientaccepts optionalSDKConfigurervalues (e.g.WithEventsConfig) and applies caller options before the event sink so merged events config stays correct.Reviewed by Cursor Bugbot for commit ef18bea. Bugbot is set up for automated code reviews on this repo. Configure here.