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(cognito): reorganize identity providers structure so that UserPoolIdentityProviderBase is not exported #10925

Merged
merged 5 commits into from
Oct 21, 2020

Conversation

shivlaks
Copy link
Contributor

we had split our identity providers to have a file per provider.
however, in this organization we were exporting the base class which
we did not intend to.

the UserPoolIdentityProviderBase class cannot be moved to a separate
file (i.e. private folder) as JSII will be unable to resolve type.

updated to follow our typical pattern of containing all extensions of the base
class within a single file user-pool-idp.ts and moved all the tests
over as well.

BREAKING CHANGE: the UserPoolIdentityProviderBase abstract class has been removed. Use the UserPoolIdentityProvider* classes directly.


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

…oolIdentityProviderBase is not exported

we had split out identity providers to have a file per provider.
however, in this organization we were exporting the base class which
we did not intend to.

the `UserPoolIdentityProviderBase` class cannot be moved to a separate
file (i.e. private folder) as JSII will be unable to resolve type.

following our typical pattern of containing all extensions of the base
class within a single file `user-pool-idp.ts` and moved all the tests
over as well.

BREAKING CHANGE: the `UserPoolIdentityProviderBase` abstract class has been removed. Use the `UserPoolIdentityProvider*` classes directly.
@shivlaks shivlaks added the @aws-cdk/aws-cognito Related to Amazon Cognito label Oct 17, 2020
@shivlaks shivlaks requested a review from nija-at October 17, 2020 10:19
@shivlaks shivlaks self-assigned this Oct 17, 2020
@gitpod-io
Copy link

gitpod-io bot commented Oct 17, 2020

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 17, 2020
Copy link
Contributor

@nija-at nija-at left a comment

Choose a reason for hiding this comment

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

How about instead moving UserPoolIdentifyProviderBase off into a separate file, maybe under lib/private/? How complicated would that look?
I like the separate file structure we already have and want to see if we can maintain that.

/**
* Properties to create a new instance of UserPoolIdentityProvider
*/
export interface UserPoolIdentityProviderProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this also be non-exported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about instead moving UserPoolIdentifyProviderBase off into a separate file, maybe under lib/private/? How complicated would that look?
I like the separate file structure we already have and want to see if we can maintain that.

this is actually what I initially tried (mentioned it in the commit body) but JSII will not allow it. I also tried to preserve the structure initially.

as for the props, we need to export it as it's an extended interface. All our constructs export the base interface. (jsii also throws an error if you exclude it)

Copy link
Contributor

@nija-at nija-at Oct 21, 2020

Choose a reason for hiding this comment

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

Ok, that's fine.

Can we open issues two separate issues in the JSII repo for these? I'd like to hear from the JSII team if this is unsupported for a reason or just a gap.

Copy link
Contributor Author

@shivlaks shivlaks Oct 21, 2020

Choose a reason for hiding this comment

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

@nija-at - since they both hit the same error message within JSII (for props and for a base class that's in a private module / not explicitly exported from the module), I've created aws/jsii#2159

happy to separate it out based on the guidance in the issue though!

@shivlaks shivlaks requested a review from nija-at October 20, 2020 17:01
@nija-at nija-at added the pr/do-not-merge This PR should not be merged at this time. label Oct 21, 2020
@shivlaks shivlaks removed the pr/do-not-merge This PR should not be merged at this time. label Oct 21, 2020
@mergify
Copy link
Contributor

mergify bot commented Oct 21, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Contributor

mergify bot commented Oct 21, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: c7fd51a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Oct 21, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 60f493c into master Oct 21, 2020
@mergify mergify bot deleted the shivlaks/cognito-user-pool-base branch October 21, 2020 19:13
shivlaks added a commit that referenced this pull request Oct 22, 2020
…at UserPoolIdentityProviderBase is not exported (#10925)"

This reverts commit 60f493c.
shivlaks added a commit that referenced this pull request Oct 22, 2020
…re so that UserPoolIdentityProviderBase is not exported (#10925)""

This reverts commit d1e2d70.
mergify bot pushed a commit that referenced this pull request Nov 6, 2020
…hat base class is not exported (#11056)

This reverts commit from #10925 which folded all implementations of `UserPoolIdentityProviderBase`
into a single file.

It was desirable to maintain our original code organization but we also did not want to export the base class
In light of guidance provided in aws/jsii#2159,  reverted back to original code organization and added
the `@internal` decorator on the base class in a private directory

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cognito Related to Amazon Cognito contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants