-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(cognito): support emailVerified
for AttributeMapping
interface
#31632
Conversation
emailVerified
for AttributeMapping
interface
368523d
to
e6842a4
Compare
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Exemption Request: Not all attributes defined in the |
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.
Looks good, just a slight improvement. Also I would recommend adding a small section in README. You're absolutely right that the current README doesn't include every new feature, and that's because we missed it in previous code reviews. We would ideally still want to insist on adding a relevant README section for each new feature.
packages/aws-cdk-lib/aws-cognito/test/user-pool-idps/base.test.ts
Outdated
Show resolved
Hide resolved
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
/** The email verified atribute provided by Apple */ | ||
public static readonly APPLE_EMAIL_VERIFIED = new ProviderAttribute('email_verified'); |
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.
$ integ-runner --language javascript test/aws-cognito/test/integ.user-pool-idp.apple.js --update-on-failed
Verifying integration test snapshots...
CHANGED aws-cognito/test/integ.user-pool-idp.apple 1.45s
Resources
[~] AWS::Cognito::UserPoolIdentityProvider apple9B5408AC
└─ [~] AttributeMapping
└─ [+] Added: .email_verified
Snapshot Results:
Tests: 1 failed, 1 total
Failed: /Users/yasuaki640/ghq/github.com/aws/aws-cdk/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-idp.apple.js
Running integration tests for failed tests...
Running in parallel across regions: us-east-1, us-east-2, us-west-2
Running test /Users/yasuaki640/ghq/github.com/aws/aws-cdk/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-idp.apple.js in us-east-1
✨ Synthesis time: 1.24s
integ-user-pool-idp-apple: deploying... [1/1]
integ-user-pool-idp-apple: creating CloudFormation changeset...
integ-user-pool-idp-apple | 0/5 | 4:22:30 PM | REVIEW_IN_PROGRESS | AWS::CloudFormation::Stack | integ-user-pool-idp-apple User Initiated
integ-user-pool-idp-apple | 0/5 | 4:22:37 PM | CREATE_IN_PROGRESS | AWS::CloudFormation::Stack | integ-user-pool-idp-apple User Initiated
integ-user-pool-idp-apple | 0/5 | 4:22:40 PM | CREATE_IN_PROGRESS | AWS::Cognito::UserPool | pool (pool056F3F7E)
integ-user-pool-idp-apple | 0/5 | 4:22:42 PM | CREATE_IN_PROGRESS | AWS::Cognito::UserPool | pool (pool056F3F7E) Resource creation Initiated
integ-user-pool-idp-apple | 1/5 | 4:22:42 PM | CREATE_COMPLETE | AWS::Cognito::UserPool | pool (pool056F3F7E)
integ-user-pool-idp-apple | 1/5 | 4:22:42 PM | CREATE_IN_PROGRESS | AWS::Cognito::UserPoolIdentityProvider | apple (apple9B5408AC)
integ-user-pool-idp-apple | 1/5 | 4:22:42 PM | CREATE_IN_PROGRESS | AWS::Cognito::UserPoolDomain | pool/domain (pooldomain430FA744)
integ-user-pool-idp-apple | 1/5 | 4:22:44 PM | CREATE_IN_PROGRESS | AWS::Cognito::UserPoolDomain | pool/domain (pooldomain430FA744) Resource creation Initiated
integ-user-pool-idp-apple | 1/5 | 4:22:44 PM | CREATE_FAILED | AWS::Cognito::UserPoolIdentityProvider | apple (apple9B5408AC) Provided private key cannot be used for Sign in with Apple. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: 373a191f-4d9f-4045-a677-9499b98a1cc1; Proxy: null)
integ-user-pool-idp-apple | 1/5 | 4:22:44 PM | CREATE_FAILED | AWS::Cognito::UserPoolDomain | pool/domain (pooldomain430FA744) Resource creation cancelled
integ-user-pool-idp-apple | 1/5 | 4:22:44 PM | ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | integ-user-pool-idp-apple The following resource(s) failed to create: [pooldomain430FA744, apple9B5408AC]. Rollback requested by user.
integ-user-pool-idp-apple | 1/5 | 4:22:46 PM | DELETE_IN_PROGRESS | AWS::Cognito::UserPoolDomain | pool/domain (pooldomain430FA744)
integ-user-pool-idp-apple | 2/5 | 4:22:46 PM | DELETE_COMPLETE | AWS::Cognito::UserPoolIdentityProvider | apple (apple9B5408AC)
integ-user-pool-idp-apple | 3/5 | 4:22:47 PM | DELETE_COMPLETE | AWS::Cognito::UserPoolDomain | pool/domain (pooldomain430FA744)
integ-user-pool-idp-apple | 3/5 | 4:22:47 PM | DELETE_IN_PROGRESS | AWS::Cognito::UserPool | pool (pool056F3F7E)
integ-user-pool-idp-apple | 2/5 | 4:22:48 PM | DELETE_COMPLETE | AWS::Cognito::UserPool | pool (pool056F3F7E)
integ-user-pool-idp-apple | 3/5 | 4:22:49 PM | ROLLBACK_COMPLETE | AWS::CloudFormation::Stack | integ-user-pool-idp-apple
Failed resources:
integ-user-pool-idp-apple | 4:22:44 PM | CREATE_FAILED | AWS::Cognito::UserPoolIdentityProvider | apple (apple9B5408AC) Provided private key cannot be used for Sign in with Apple. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: 373a191f-4d9f-4045-a677-9499b98a1cc1; Proxy: null)
❌ integ-user-pool-idp-apple failed: The stack named integ-user-pool-idp-apple failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Provided private key cannot be used for Sign in with Apple. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: ***; Proxy: null)
FAILED aws-cognito/test/integ.user-pool-idp.apple-integ.user-pool-idp.apple (undefined/us-east-1) 43.073s
Integration test failed: Error: Command exited with status 1
Test Results:
Tests: 1 failed, 1 total
Error: Some integration tests failed!
at main (/Users/yasuaki640/ghq/github.com/aws/aws-cdk/packages/@aws-cdk/integ-runner/lib/cli.js:166:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. |
Let me help you with the tests. |
@yasuaki640 can you allow me to push to your forked repo? |
Alternatively, you can copy & paste the following diff into a file called
|
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.
LGTM, thank you for contributing!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Issue #30467
Closes #30467
Reason for this change
For custom OpenId providers, there is no way to automatically validate email upon sign-in.
Therefore, we would like to add the
email_verified
attribute to attribute mapping, but it is not present in the member definition ofAttributeMapping
interface., so we have added it in this PR.Description of changes
Added
emailVerified
attribute toAttributeMapping
interface.Description of how you validated changes
Added the
email_verified
assertion to both unit and integration tests.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license