-
Notifications
You must be signed in to change notification settings - Fork 87
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
[eas-cli] [ENG-14629] Improve AppleID validation #2830
Conversation
Clears the AppleID received from the prompt See: https://linear.app/expo/issue/ENG-14629/improve-apple-id-input-validation
Adds tests for `resolveUserCredentialsAsync` function, including reading malformed AppleID from the prompt See: https://linear.app/expo/issue/ENG-14629/improve-apple-id-input-validation
Removed redundant expect() See: https://linear.app/expo/issue/ENG-14629/improve-apple-id-input-validation
Subscribed to pull request
Generated by CodeMention |
Size Change: -914 B (0%) Total Size: 53.4 MB
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
type: 'text', | ||
name: 'username', | ||
message: `Apple ID:`, | ||
validate: (val: string) => val !== '', | ||
initial: lastAppleId ?? undefined, | ||
}); | ||
username = username.replace(/[\x00-\x1F]/gi, ''); |
There was a problem hiding this comment.
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?
…-14629_improve_apple_id_validation
Added a comment with context for the change See: https://linear.app/expo/issue/ENG-14629/improve-apple-id-input-validation
Updated CHANGELOG.md See: https://linear.app/expo/issue/ENG-14629/improve-apple-id-input-validation
✅ Thank you for adding the changelog entry! |
Why
https://linear.app/expo/issue/ENG-14629/improve-apple-id-input-validation
\u0017
)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
functionTested the behaviour for a username with reported invalid characters