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

chore: Add input validation for private key in oauth flow #11790

Merged
merged 2 commits into from
Feb 9, 2023

Conversation

Amplifiyer
Copy link
Contributor

@Amplifiyer Amplifiyer commented Jan 16, 2023

Description of changes

Add input validation for private key in sign in with apple oauth flow.

This changes CX a little bit.

Before -> CLI accepts just the key portion OR the key with header and footer as valid input when given without any line breaks, but no input validation since just the key cannot be reliably validated with regex.
After -> CLI only accepts the private key with header and footer as valid input when given without any line breaks. The input is validated to have the right header and footer.

The obvious benefit of this change is to remove any guesswork on CX to figure out the right format. There are at least 4 different customers who have run into this issue trying to figure out the format (e.g. providing the absolute path to the .p8 file or providing just the key but with line breaks and the prompter just takes the first line as input)

This also brings it in parity with validation in Studio

image

Issue #, if available

fix: #8097, #9478

Docs PR: aws-amplify/docs#5018

Description of how you validated changes

e2e tests and manually tested the walkthrough for both add and update.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Amplifiyer Amplifiyer marked this pull request as ready for review January 18, 2023 16:16
@Amplifiyer Amplifiyer requested a review from a team as a code owner January 18, 2023 16:16
@Amplifiyer Amplifiyer merged commit 7148d44 into aws-amplify:dev Feb 9, 2023
Amplifiyer added a commit to Amplifiyer/amplify-cli that referenced this pull request Feb 10, 2023
Amplifiyer added a commit that referenced this pull request Feb 10, 2023
@aws-eddy aws-eddy mentioned this pull request Apr 25, 2023
6 tasks
@awsluja awsluja mentioned this pull request Jun 7, 2023
6 tasks
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.

Add input validation to SIWA private key prompt
3 participants