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

Revert "Revert "[eas-json] validate EAS Submit inputs better"" #2202

Conversation

szdziedzic
Copy link
Member

@szdziedzic szdziedzic commented Jan 29, 2024

Why

Apply changes from #2198 with fixes

How

Same as for #2198, but I made constraints for validating ascApiKeyId and ascAppId more loose and added some comments.

Test plan

Tests

Copy link

github-actions bot commented Jan 29, 2024

Size Change: +4.7 kB (0%)

Total Size: 51.5 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 51.5 MB +4.7 kB (0%)

compressed-size-action

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3a1e529) 54.14% compared to head (2852a45) 54.16%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2202      +/-   ##
==========================================
+ Coverage   54.14%   54.16%   +0.03%     
==========================================
  Files         516      516              
  Lines       18798    18808      +10     
  Branches     3769     3772       +3     
==========================================
+ Hits        10176    10186      +10     
  Misses       8601     8601              
  Partials       21       21              

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

@szdziedzic
Copy link
Member Author

/changelog-entry chore Add better validation for EAS Submit inputs

@szdziedzic szdziedzic marked this pull request as ready for review January 29, 2024 11:41
packages/eas-json/src/submit/schema.ts Outdated Show resolved Hide resolved
packages/eas-json/src/__tests__/submitProfiles-test.ts Outdated Show resolved Hide resolved
Co-authored-by: Stanisław Chmiela <[email protected]>
@@ -111,6 +111,11 @@ export default class IosSubmitCommand {
const envAppSpecificPassword = getenv.string('EXPO_APPLE_APP_SPECIFIC_PASSWORD', '');

if (envAppSpecificPassword) {
if (!/^[a-z]{4}-[a-z]{4}-[a-z]{4}-[a-z]{4}$/.test(envAppSpecificPassword)) {
throw new Error(
'EXPO_APPLE_APP_SPECIFIC_PASSWORD must be in the format XXXX-XXXX-XXXX-XXXX, where X is a lowercase letter.'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'EXPO_APPLE_APP_SPECIFIC_PASSWORD must be in the format XXXX-XXXX-XXXX-XXXX, where X is a lowercase letter.'
'EXPO_APPLE_APP_SPECIFIC_PASSWORD must be in the format xxxx-xxxx-xxxx-xxxx, where x is a lowercase letter.'

appleTeamId: Joi.string()
.regex(/^[\dA-Z]{10}$/) // Apple says that it always has to be 10 characters long https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/
.message(
'Invalid Apple Team ID was specified. It should consist of 10 uppercase letters or digits. Example: "AB32CDE81F".'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'Invalid Apple Team ID was specified. It should consist of 10 uppercase letters or digits. Example: "AB32CDE81F".'
'Invalid Apple Team ID was specified. It should consist of 10 uppercase letters or digits. Example: "AB32CZE81F".'

(so as not to confuse with hex, let's add some non-hex characters in the example)

Copy link
Member

@quinlanj quinlanj left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

Copy link

✅ Thank you for adding the changelog entry!

@szdziedzic szdziedzic merged commit fe8f1b3 into main Jan 30, 2024
9 checks passed
@szdziedzic szdziedzic deleted the revert-2200-revert-2198-@szdziedzic/sanitize-values-in-eas-submit-profile-better branch January 30, 2024 10:13
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.

4 participants