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(auth): general clean up for credentialsProvider and also rename Credentials from sdk #12021

Merged

Conversation

Samaritan1011001
Copy link
Member

Description of changes

  • General clean up for the CognitoCredentialsProvider
  • IdentityIdStore's loadIdentityId now returns Identity or null
  • Rename Credentials to AWSCredentialsIdentity as a BB item

Issue #, if available

Description of how you validated changes

Works as expected for the following scenarios on a React app,

  • guest user fetchAuthSession
  • guest user -> sign In -> fetchAuthSession -> sign out -> fetchAuthSession
  • sign in -> fetchAuthSession -> sign out

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

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

@Samaritan1011001 Samaritan1011001 requested review from a team as code owners September 12, 2023 22:48
export type {
AwsCredentialIdentity as Credentials,
MetadataBearer,
} from '@aws-sdk/types';
Copy link
Contributor

Choose a reason for hiding this comment

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

are we doing the thing that Allan did on v5 to generate those and have @aws-sdk/types as dev dependency

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, we can create a follow up PR for this. Thanks

Copy link
Contributor

@elorzafe elorzafe left a comment

Choose a reason for hiding this comment

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

Looks good!
qq: what about generating the types instead of making it a dependency

Copy link
Member

@israx israx left a comment

Choose a reason for hiding this comment

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

I think we should add a todo to auto generate the types from the SDK. Other than that, LGTM.

export type {
AwsCredentialIdentity as Credentials,
MetadataBearer,
} from '@aws-sdk/types';
Copy link
Member

Choose a reason for hiding this comment

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

+1

@Samaritan1011001 Samaritan1011001 merged commit c9b7174 into aws-amplify:next/release Sep 14, 2023
14 checks passed
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.

3 participants