[eas-cli] Escape Apple credentials before scrubbing them from metadata telemetry - #4256
Open
dennytosp wants to merge 1 commit into
Open
[eas-cli] Escape Apple credentials before scrubbing them from metadata telemetry#4256dennytosp wants to merge 1 commit into
dennytosp wants to merge 1 commit into
Conversation
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
dennytosp
force-pushed
the
fix/metadata-telemetry-scrubber-escaping
branch
from
August 22, 2026 09:08
492e92f to
ca0e8c2
Compare
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
makeDataScrubberAsyncinsrc/metadata/utils/telemetry.tsredacts the Apple app ID, username, password, token, team ID and provider ID from the request and response data thateas metadata:push/eas metadata:pullsend to analytics. It builds those patterns by passing the value straight tonew RegExp, but every one of them is chosen by the user, so they routinely contain characters that mean something in a pattern.That breaks the redaction in both directions:
So a credential with
+,.or*in it is the one thing the scrubber is there to catch and the one thing it lets through, and a credential with an unbalanced(or[throws out ofsubscribeTelemetryAsyncbefore the first request is made.An empty
app.idhas the same shape of problem:new RegExp('', 'gi')matches at every position, so{APPLE_APP_ID}would be spliced between every character of the payload.How
The values are escaped before they become patterns, through a new
escapeRegExpinsrc/utils/expodash, matching how@expo/build-toolsalready handles this withlodash/escapeRegExp(eas-clidoes not depend on lodash, andexpodashis where the package keeps its lodash replacements).The six patterns now go through one
literalPatternhelper, which also skips empty values so a missing app ID cannot produce a match-everything pattern.Test Plan
yarn test,yarn typecheck,yarn lintandyarn fmt:checkall pass.Two cases were added to
telemetry.test.ts: one asserting that auser+eas@icloud.com/S3cret(1)pair is redacted, and one asserting that a password ofa.cno longer redacts the unrelated textabc. Both fail onmain.escapeRegExphas its own unit tests, including a round-trip check that the escaped pattern matches the value itself and nothing else.