Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eas-cli] [ENG-14629] Improve AppleID validation #2830

Merged

Conversation

radoslawkrzemien
Copy link
Contributor

Why

https://linear.app/expo/issue/ENG-14629/improve-apple-id-input-validation

  • user was asked to log into their Apple account
  • prompt displayed for the username, pre-filled with value from cache
  • value from cache contains invalid, unprintable characters (\u0017)
  • user accepts "correct" username
  • fails to log in
  • user removes the cache file
  • logs in successfully when manually typing "the same" username (but without invalid characters)

How

The username value from prompt is cleared of any invalid unprintable characters before updating cache and using the value to log into Apple account

Test Plan

Added tests for resolveUserCredentialsAsync function
Tested the behaviour for a username with reported invalid characters

Copy link

linear bot commented Jan 21, 2025

Copy link

Subscribed to pull request

File Patterns Mentions
**/* @szdziedzic, @khamilowicz, @sjchmiela

Generated by CodeMention

Copy link

github-actions bot commented Jan 21, 2025

Size Change: -914 B (0%)

Total Size: 53.4 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 53.4 MB -914 B (0%)

compressed-size-action

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.59%. Comparing base (5a16f3d) to head (efdcb4a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2830      +/-   ##
==========================================
+ Coverage   52.46%   52.59%   +0.14%     
==========================================
  Files         584      584              
  Lines       22637    22638       +1     
  Branches     4467     4707     +240     
==========================================
+ Hits        11874    11905      +31     
+ Misses      10729     9805     -924     
- Partials       34      928     +894     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

type: 'text',
name: 'username',
message: `Apple ID:`,
validate: (val: string) => val !== '',
initial: lastAppleId ?? undefined,
});
username = username.replace(/[\x00-\x1F]/gi, '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment here about historical context and what intention stands behind this regex?

Copy link

✅ Thank you for adding the changelog entry!

@radoslawkrzemien radoslawkrzemien merged commit 004caf4 into main Jan 22, 2025
10 checks passed
@radoslawkrzemien radoslawkrzemien deleted the @radoslawkrzemien/ENG-14629_improve_apple_id_validation branch January 22, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants