-
Notifications
You must be signed in to change notification settings - Fork 0
seedless onboarding password sync #6
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
base: feat/seedless-multi-srp
Are you sure you want to change the base?
seedless onboarding password sync #6
Conversation
e6e424b
to
60cff9b
Compare
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Show resolved
Hide resolved
@@ -457,6 +477,71 @@ export class SeedlessOnboardingController extends BaseController< | |||
this.#isUnlocked = false; | |||
} | |||
|
|||
/** | |||
* @description Fetch the password corresponding to the current authPubKey in state (current device password). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @description Fetch the password corresponding to the current authPubKey in state (current device password). | |
* @description Fetch the latest password corresponding to the current authPubKey in state (current device password). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lwin-kyaw actually it's not latest, it's the old password (the current password being used for this device) which is already out of sync with the current global password so that user just have to input the latest global password when they are logged out because their device password went out of sync, then we use this recovered old password to unlock the vault and set the password to the new global password
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'm abit confused by the term global
.
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
lgtm. |
…dless-onboarding-password-sync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job, minor comments
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
…password-sync # Conflicts: # packages/seedless-onboarding-controller/src/SeedlessOnboardingController.test.ts # packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…dless-onboarding-password-sync # Conflicts: # packages/seedless-onboarding-controller/src/SeedlessOnboardingController.test.ts
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Show resolved
Hide resolved
packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts
Outdated
Show resolved
Hide resolved
d7c3553
to
9cf2022
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
await this.#assertPasswordInSync({ | ||
skipCache: true, | ||
}); | ||
// NOTE don't include #assertPasswordInSync in #withControllerLock since #assertPasswordInSync already acquires the controller lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically, shouldn't this be called within the same lock?
maybe there should be a flag in assertPasswordInSync
that allows this to be called from within an existing lock.
idTokens: hashedIdTokenHexes, | ||
groupedAuthConnectionParams: { | ||
authConnectionId, | ||
return await this.#withControllerLock(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit hard to see which changes are because of adding the controller lock, and which are because of adding password syncing functionality. i think ideally this could have been split into 2 PRs. it's OK now, just mentioning it for next time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should have a test that checks for SeedlessOnboardingControllerError.OutdatedPassword
when trying to add a backup item using outdated keys, right?
Explanation
Handle password sync flow
References
https://docs.google.com/document/d/1r7WwVgrdmBLzhX7yYDrVc-NEs_Q02VPBGXi2-VGQAyc/edit?tab=t.0
Changelog
Checklist