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

fix(amplify-graphiql-explorer): amplify mock with Cognito User Pool #12906

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

aoi
Copy link

@aoi aoi commented Jul 5, 2023

Description of changes

This bug is caused by jsonwebtoken's verify method.
The issue is here. auth0/node-jsonwebtoken#863
There is no choice but to use an alternative library.

I've replaced jsonwebtoken to jsrsasign.
I chose jsrsasign for the following reasons:

  1. jsrsasign is featured on jwt.io which is a trustworthy website. https://jwt.io/libraries?language=JavaScript
  2. 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 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.

@aoi aoi requested review from a team as code owners July 5, 2023 14:38
@codecov-commenter
Copy link

Codecov Report

Merging #12906 (ab4acb7) into dev (ec9a2ba) will increase coverage by 48.46%.
The diff coverage is 58.63%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff             @@
##              dev   aws-amplify/amplify-cli#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     
Impacted Files Coverage Δ
...y-category-function/src/commands/function/build.ts 0.00% <0.00%> (ø)
...ify-category-function/src/events/prePushHandler.ts 33.33% <0.00%> (+33.33%) ⬆️
...ider-utils/awscloudformation/utils/layerHelpers.ts 21.80% <0.00%> (+21.80%) ⬆️
...er-utils/awscloudformation/utils/storeResources.ts 30.38% <ø> (+30.38%) ⬆️
...ib/S3AndCloudFront/helpers/configure-CloudFront.js 87.06% <ø> (+87.06%) ⬆️
...lify-category-hosting/lib/S3AndCloudFront/index.js 89.65% <ø> (+89.65%) ⬆️
...ifications/src/commands/notifications/configure.ts 0.00% <0.00%> (ø)
...e/src/amplify-node-pkg-detector/lock-file-types.ts 100.00% <ø> (+100.00%) ⬆️
.../src/amplify-node-pkg-detector/yarn-lock-parser.ts 100.00% <ø> (+100.00%) ⬆️
packages/amplify-cli-core/src/constants.ts 100.00% <ø> (+100.00%) ⬆️
... and 47 more

... and 1249 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

None yet

2 participants