Repository navigation
fix: Escape attribute names that look like references in redactedAttributes - #309
Merged
Merged
Conversation
3 tasks done
…ibutes _meta.redactedAttributes holds attribute references. The SDK wrote the literal name of a redacted top-level attribute, so a private attribute named "/a" was reported as "/a", which LaunchDarkly reads as a reference to an attribute named "a". The name is now written as "/~1a".
keelerm84
force-pushed
the
mk/SDK-3775/escape-redacted-attribute-names
branch
from
November 30, 2026 18:34
772688c to
9ea31bf
Compare
keelerm84
pushed a commit
that referenced
this pull request
Nov 30, 2026
🤖 I have created a release *beep* *boop* --- ## [6.13.2](6.13.1...6.13.2) (2026-11-30) ### Bug Fixes * Escape attribute names that look like references in redactedAttributes ([#309](#309)) ([d59cb4b](d59cb4b)) * Evaluate before and after clauses on timestamps with up to nine fractional digits ([#308](#308)) ([a174822](a174822)) * Redact nested private attributes in associative arrays that have ([1c5dba7](1c5dba7)) * Redact nested private attributes when attribute values are `stdClass` objects ([#306](#306)) ([1c5dba7](1c5dba7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). 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
_meta.redactedAttributesin analytics events holds attribute references. When a top-level attribute was redacted, the SDK wrote its literal name. A private attribute named/awas reported as/a, which LaunchDarkly reads as a reference to an attribute nameda. The SDK now writes the escaped reference,/~1a. This applies to per-context and global private attributes and toall_attributes_private. The redaction itself was already correct.The v2 contract tests for private attribute names that look like references now pass.
Note
Overview
When a whole top-level custom attribute is redacted,
_meta.redactedAttributesnow recordsAttributeReference::fromLiteral($attr)->getPath()instead of the raw attribute name. Names that start with/(for example/aor/~x) are emitted as escaped paths such as/~1aand/~1~0x, so LaunchDarkly does not treat them as nested references toaor~x.This applies when attributes are marked private on the context, via global private config, or when
all_attributes_privateredacts every attribute. Nested object redaction was already writing escaped paths via parsedAttributeReferenceinstances; only whole-attribute redaction incheckWholeAttributePrivatewas wrong.Unit tests cover per-context private attributes and
all_attributes_privatefor these edge-case names.Reviewed by Cursor Bugbot for commit 9ea31bf. Bugbot is set up for automated code reviews on this repo. Configure here.