-
Notifications
You must be signed in to change notification settings - Fork 929
[PM-30899] Store account keys upon SSO user creation #6384
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: main
Are you sure you want to change the base?
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
dfa18a7 to
04f6a64
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6384 +/- ##
=======================================
Coverage 85.56% 85.56%
=======================================
Files 764 764
Lines 55501 55506 +5
Branches 8047 8047
=======================================
+ Hits 47488 47493 +5
Misses 5239 5239
Partials 2774 2774 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7098446 to
17b844d
Compare
|
Claude finished @SaintPatrck's task in 1m 39s —— View job Code Review SummaryPR: PM-30899 Store account keys upon SSO user creation OverviewThis PR fixes an issue where SSO users were forced to re-authenticate after app process death even when the device is trusted. The fix ensures Changes Reviewed
AnalysisSecurity - The changes correctly handle sensitive cryptographic material following established patterns in the codebase. Account keys are stored using the same mechanisms as other sensitive data. Correctness - The implementation is sound:
Test Coverage - Comprehensive:
Code Quality
Verdict✅ APPROVED - Clean implementation with no issues found. Reviewed with Claude Code |
| authDiskSource | ||
| .storeAccountKeys( | ||
| userId = userId, | ||
| accountKeys = response.accountKeys, |
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.
Should this be done in the onSuccess down below?
If organizationResetPasswordEnroll fails, we will have persisted these keys without completing the full flow.
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.
There is also this comment down below:
// TDE and SSO user creation still uses crypto-v1. These users are not
// expected to have the AEAD keys so we only store the private key for now.
// See #5682 (comment)
// for more details.
Do we know if this is still true?
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.
Should this be done in the onSuccess down below?
Good catch. Yes.
@quexten what's the status of TDE & SSO user creation? Is it safe to remove the crypto-v1 usages yet?
This commit updates the `createAccountKeys` API call to handle and store the full response object, which includes the `accountKeys`. When a new SSO user is created, the `accountKeys` received from the `createAccountKeys` endpoint are now stored in `authDiskSource`. Additionally, during a soft logout, the user's `accountKeys` are preserved and restored along with other account data upon re-authentication. Specific changes include: - Modified `AccountsService` and related API definitions to expect and return a `CreateAccountKeysResponseJson` object instead of `Unit`. - Introduced the `CreateAccountKeysResponseJson` data class to model the API response. - Updated `AuthRepositoryImpl` to store the `accountKeys` from the response after creating a new SSO user. - Updated `UserLogoutManagerImpl` to ensure `accountKeys` are retained during a soft logout. - Adjusted associated tests to reflect these changes, including mocking the new response structure and verifying that `accountKeys` are stored correctly.
17b844d to
ae1ca95
Compare

🎟️ Tracking
PM-30899
📔 Objective
Update the
createAccountKeysAPI call to handle and store the full response object, which includes theaccountKeys.When a new SSO user is created, the
accountKeysreceived from thecreateAccountKeysendpoint are now stored inauthDiskSource.Additionally, during a soft logout, the user's
accountKeysare preserved and restored along with other account data upon re-authentication.This fixes an issue where an SSO user was forced to re-authenticate after app process death, even when the device is trusted.
Specific changes include:
AccountsServiceand related API definitions to expect and return aCreateAccountKeysResponseJsonobject instead ofUnit.CreateAccountKeysResponseJsondata class to model the API response.AuthRepositoryImplto store theaccountKeysfrom the response after creating a new SSO user.UserLogoutManagerImplto ensureaccountKeysare retained during a soft logout.accountKeysare stored correctly.⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes