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

[SDK-3534] Credential manager support #497

Closed
wants to merge 4 commits into from

Conversation

poovamraj
Copy link
Contributor

Changes

We have provided Credentials Manager support for Android in React Native. The following methods are added

  • getCredentials
  • saveCredentials
  • hasValidCredentials
  • clearCredentials

References

#476

Testing

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@poovamraj poovamraj requested a review from a team as a code owner August 9, 2022 09:28
@poovamraj poovamraj changed the title Credential manager support [SDK-3534] Credential manager support Aug 9, 2022
Copy link
Contributor

@stevehobbsdev stevehobbsdev left a comment

Choose a reason for hiding this comment

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

Looks great, left a couple comments 🎉

Comment on lines +18 to +19
* @param {Number} credentials.expiresIn optional - `expiresAt` should not be empty if this is. Used to denote when the token will expire from the issued time
* @param {String} credentials.expiresAt optional - `expiresIn` should not be empty if this is. Used to denote when the token will expire. Has precendence over `expiresIn`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure on the docs here. Looking at the code, either expiresIn or expiresAt is required but at least one of them must be specified, but the docs say they're both optional.

Edit: ok I see now:

credentials.expiresIn optional - expiresAt should not be empty if this is.

I found this really confusing and we should reword. How about:

"credentials.expiresIn - optional if expiresAt is set.."

And the converse for expiresAt.

src/credentials-manager/index.js Outdated Show resolved Hide resolved
src/credentials-manager/index.js Outdated Show resolved Hide resolved
src/credentials-manager/index.js Show resolved Hide resolved
}

//private
async ensureCredentialManagerIsInitialized() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we prefix this?

i.e. _ensureCredentialManagerIsInitialized

@stevehobbsdev
Copy link
Contributor

Will we be adding tests here or in a follow-up PR? I'm not seeing any in the diff.

poovamraj and others added 2 commits August 12, 2022 15:33
Co-authored-by: Steve Hobbs <steve.hobbs.mail@gmail.com>
Co-authored-by: Steve Hobbs <steve.hobbs.mail@gmail.com>
@poovamraj poovamraj closed this Aug 15, 2022
@poovamraj poovamraj deleted the credential-manager-support branch September 29, 2022 10:32
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.

2 participants