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

feat(cognito): support provider details for UserPoolIdentityProviderSaml #29588

Merged
merged 10 commits into from
Apr 17, 2024

Conversation

badmintoncryer
Copy link
Contributor

@badmintoncryer badmintoncryer commented Mar 23, 2024

Issue # (if applicable)

Closes #29494.
Closes #29598.

#29598 is really close issue and I tried to resolve it in this PR.
If it is not good to resolve multiple issues in 1 PR, I would separate this PR.

Reason for this change

UserPoolIdentityProviderSaml can configure ProviderDetails but there are some items that is not configurable from AWS CDK.

  • EncryptedResponses
  • RequestSigningAlgorithm
  • IDPInit

Description of changes

Add 3 properties to UserPoolIdentityProviderSamlProps.

  • encryptedResponses
  • requestSigningAlgorithm
  • idpInitiated

Description of how you validated changes

Added both unit and integ tests.

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team March 23, 2024 04:26
@github-actions github-actions bot added star-contributor [Pilot] contributed between 25-49 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Mar 23, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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.

@aws-cdk-automation aws-cdk-automation dismissed their stale review March 25, 2024 06:08

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@badmintoncryer badmintoncryer changed the title feat(cognito): accepting encrypted SAML responses and signing SAML requests for SAML provider feat(cognito): support provider details for UserPoolIdentityProviderSaml Mar 25, 2024
@@ -99,6 +124,9 @@ export class UserPoolIdentityProviderSaml extends UserPoolIdentityProviderBase {
IDPSignout: props.idpSignout ?? false,
MetadataURL: metadataType === UserPoolIdentityProviderSamlMetadataType.URL ? metadataContent : undefined,
MetadataFile: metadataType === UserPoolIdentityProviderSamlMetadataType.FILE ? metadataContent : undefined,
EncryptedResponses: props.encryptedResponses ?? undefined,
RequestSigningAlgorithm: props.signingRequests ? 'rsa-sha256' : undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could not find any information about what algorithm is acceptable for RequestSigningAlgorithm without rsa-sha256.

https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolidentityprovider.html#aws-resource-cognito-userpoolidentityprovider-properties

SAML
Create or update request with Metadata URL: "ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256" }

I defined signingRequest as boolean but it may be better to define SigningAlgorithm enum and use it.
I would like to hear the reviewer's opinion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also unable to find documentation regarding other availabilities, maybe someone from AWS can clear it up if they have internal docs regarding this.

Regardless, even if rsa-sha256 is the only current available signing algorithm, adding an enum right away gives us more extensibility if and when other algorithms are made available. The boolean would become redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nmussy Thank you for your opinion!!
I will create a new enum and remove Boolean definition.

Copy link
Contributor

Choose a reason for hiding this comment

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

This would have been my one comment on this PR. Great suggestion.

@badmintoncryer badmintoncryer marked this pull request as ready for review March 25, 2024 07:35
@badmintoncryer badmintoncryer force-pushed the 29494-samlProvider branch 2 times, most recently from 7361eb9 to 0e68618 Compare March 25, 2024 23:41
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 26, 2024
Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Great work! I have... no notes? That's weird.

Thanks for making this change and thank you to @nmussy for your initial round of feedback!

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 17, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 3256c70
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Apr 17, 2024

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 star-contributor [Pilot] contributed between 25-49 PRs to the CDK
Projects
None yet
4 participants