feat(audience): warn and drop identify()/alias() calls with a malformed passport id#2899
Open
nattb8 wants to merge 1 commit into
Open
feat(audience): warn and drop identify()/alias() calls with a malformed passport id#2899nattb8 wants to merge 1 commit into
nattb8 wants to merge 1 commit into
Conversation
|
View your CI Pipeline Execution ↗ for commit b17e38b
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
✅ Audience Bundle Size — @imtbl/audience
Budget: 24.00 KB gzipped (warn at 20.00 KB) |
✅ Pixel Bundle Size — @imtbl/pixel
Budget: 10.00 KB gzipped (warn at 8.00 KB) |
nattb8
force-pushed
the
feat/validate-passport-id
branch
from
July 9, 2026 23:53
19180b5 to
8217e4c
Compare
nattb8
force-pushed
the
feat/validate-passport-id
branch
2 times, most recently
from
July 10, 2026 01:20
f7a2eff to
2df7fff
Compare
nattb8
marked this pull request as ready for review
July 10, 2026 01:30
nattb8
force-pushed
the
feat/validate-passport-id
branch
from
July 10, 2026 01:30
2df7fff to
2b70a9f
Compare
…ed passport id Studios sometimes call identify() or alias() with identityType passport but pass their own internal user id instead of a real Passport id, which silently pollutes downstream analytics. Reject the call (no-op, no event sent, userId untouched) and warn unconditionally when the id doesn't look like a Passport id, using the same connection|id or UUID shape Passport actually issues. Also adds sample-app coverage for the new behaviour.
nattb8
force-pushed
the
feat/validate-passport-id
branch
from
July 10, 2026 01:47
2b70a9f to
b17e38b
Compare
shineli1984
approved these changes
Jul 10, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 10, 2026
JCSanPedro
reviewed
Jul 14, 2026
| * Validate that an ID looks like a Passport ID: either `<connection>|<id>` | ||
| * (e.g. `email|abc123`, `google-oauth2|456`) or a bare UUID. | ||
| */ | ||
| export function isPassportIdValid(id: string): boolean { |
Contributor
There was a problem hiding this comment.
Something we should keep in mind, when we migrate from Auth0 -> Ory Kratos, the user id format will change. Will become UUIDs I think.
Hmm actually, probably need to consult with @brayansdt the implications of some of these things when we migrate.
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
Studios sometimes call
identify()oralias()withidentityType: 'passport'but pass their own internal user id instead of a real Passport id, and today nothing catches it, so bad data silently flows into the audience pipeline. This rejects the call (no event sent,userIduntouched) and warns unconditionally (not gated behinddebug) when the id doesn't match the shape Passport actually issues (connection|idor a bare UUID), so studios see the mistake immediately during local testing instead of finding it in the data warehouse later.Test plan
isPassportIdValid(core) covering valid pipe-form ids, valid UUIDs, whitespace padding, and invalid shapesidentify()/alias(): malformed passport id warns and drops the call; warning fires withoutdebugenabled; valid ids and non-passport identity types never warnpnpm jestpasses forpackages/audience/coreandpackages/audience/sdkeslintpasses on all changed filestsc --noEmitpasses forpackages/audience/sdk