Repository navigation
BREAKING: Check Raw identifiers' types and drop malformed values - #65
Open
jrosendahl-opt wants to merge 3 commits into
Open
jrosendahl-opt wants to merge 3 commits into
jrosendahl-opt wants to merge 3 commits into
Conversation
OptableIdentifier.Raw sent any string unchanged. Match the iOS SDK
(optable-ios-sdk#98):
- A known type is encoded exactly like its typed identifier. "e" and
"p" must already be SHA-256 hashes, like Hem and HashedPhoneNumber,
or the ID is dropped, so Raw("e:jane@example.com") never sends a
plaintext Email. Custom types are "c" and "c<number>".
- An unknown type is sent as given, split on the first ":".
- A value with no ":", an empty type or an empty value is dropped.
Apps passing plaintext or malformed values through Raw stop sending
them, so this is for 2.0.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 5 tasks
Treat a whitespace-only value like an empty one, so "xyz: " is dropped instead of being sent, matching the iOS follow-up to optable-ios-sdk#98. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Treat a whitespace-only type like an empty one, so " :abc" is dropped, matching optable-ios-sdk#98. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Why
OptableIdentifier.Rawsent any string unchanged, soRaw("e:jane@example.com")sent a plaintext Email and malformed values went to the DCN as-is. The iOS SDK checks raw identifiers (optable-ios-sdk#98), and the same strict behaviour was requested for both SDKs.What Changed
Raw("type:value"), split on the first::e,p,z,i4,i6,a,g,r,s,f,n,id5,utiq,v,c/c<number>) is encoded exactly like its typed identifier.eandpmap toHem/HashedPhoneNumber, so a value that isn't a SHA-256 hash is dropped.c0is sent asc, a negative number uses its absolute value.ggets the same dedupe against the device GAID asGoogleGaid.xyz:Some Value,xyz:a:b,cookie:abc). Types are case-sensitive.:, an empty or whitespace-only type (:abc,:abc), an empty or whitespace-only value (xyz:,xyz:), or an empty string is dropped, fromidentifyand from targetingidsandhidsalike.IdentifiersEncoderencodes one identifier in its own function so a known raw value goes through the same code as its typed identifier.e/p, unknown types, malformed values, rawgdedupe.tryIdentifyFromUrl()already checks the hash before sendingRaw("e:<hash>"), so it keeps working.How to Test
./gradlew testpasses (166 tests locally)Raw)Rawrow updatedNotes
Do not merge before v1.3.0 is tagged. For 2.0.0, alongside #63. Apps passing plaintext or malformed values through
Rawsilently stop sending them; code still compiles.Rebase needed against whichever merge first: #62 (
encode()takes the GAID as a parameter) and #63 (Custom(index, value)andOptableVID, which this code should then build forc/cNandv).🤖 Generated with Claude Code