amplify-cli
amplify-cli copied to clipboard
fix(amplify-graphiql-explorer): amplify mock with Cognito User Pool
Description of changes
This bug is caused by jsonwebtoken's verify method. The issue is here. https://github.com/auth0/node-jsonwebtoken/issues/863 There is no choice but to use an alternative library.
I've replaced jsonwebtoken to jsrsasign. I chose jsrsasign for the following reasons:
- jsrsasign is featured on jwt.io which is a trustworthy website. https://jwt.io/libraries?language=JavaScript
- Since jose requested async/await, jsrsasign is less affected by the fix. There is not much difference in functionality.
Issue #, if available
aws-amplify/amplify-category-api#1646 12905
Description of how you validated changes
I've confirmed amplify mock with Cognito User Pool works.
The GraphiQL page is shown propery. The queries work.
Checklist
- [ ] PR description included
- [ ]
yarn testpasses - [ ] 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.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 48.46%. Comparing base (ec9a2ba) to head (40b60a4).
:warning: Report is 715 commits behind head on dev.
Additional details and impacted files
@@ Coverage Diff @@
## dev #12906 +/- ##
===========================================
+ Coverage 0.00% 48.46% +48.46%
===========================================
Files 1296 837 -459
Lines 149743 38041 -111702
Branches 1296 7747 +6451
===========================================
+ Hits 0 18436 +18436
+ Misses 148447 18017 -130430
- Partials 1296 1588 +292
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.