Skip to content

Conversation

@himanshuchawla009
Copy link
Member

@himanshuchawla009 himanshuchawla009 commented Dec 10, 2024

Motivation and Context

This pr allows users to import existing sfa users to mfa.

Jira Link:

Description

This PR adds a new parameter named registerExistingSFAKey in login function. If this param is set to true thn it sfa key will be imported to mpc.

Few things to consider:-

  • Once sfa key is imported, key wont be accesible from sfa sdks.

  • If you reset your MPC account, you cant access it from SFA again.

  • Also this function will throw error if sfa key was generated for v1 sfa user. Upgrading for v1 users is not possible at all so we should mention this in docs such that application can handle this case while registering sfa user.

  • This doesn't work for redirect flow, there is a bug in mpc core kit which doesn't handles redirect import case, so i have added it to throw an error if import key flow is used in redirect mode. We will remove the error once the redirect flow is fixed.

How has this been tested?

I have added one new test which creates a SFA key, than sets registerExistingSFAKey in mpc core kit so that mpc core kit import sfa key.
Later test tries to login with sfa again and sfa key should be empty, where as mpc exported key should match existing sfa key.

This PR affects, loginWithJwt, loginWithOauth and setupTkey functions

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • [] I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code requires a db migration.

Copy link
Contributor

@ieow ieow left a comment

Choose a reason for hiding this comment

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

lgtm

@ieow
Copy link
Contributor

ieow commented Dec 11, 2024

lgtm

@himanshuchawla009 himanshuchawla009 merged commit 74c77f9 into master Dec 11, 2024
3 checks passed
@himanshuchawla009 himanshuchawla009 deleted the feat/import-sfa branch December 11, 2024 06:41
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