-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
refactor(active-user-state-refactor): [PM-12040] Remove ActiveUserSta… #13149
base: main
Are you sure you want to change the base?
refactor(active-user-state-refactor): [PM-12040] Remove ActiveUserSta… #13149
Conversation
…te from SSO Service - First pass of work to update the state. In the middle of testing.
…e-user-state-from-sso-login
…om SSO Service - Fix for jslib-services.module.ts
New Issues (4)Checkmarx found the following issues in this Pull Request
|
…e-user-state-from-sso-login
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13149 +/- ##
==========================================
+ Coverage 35.38% 35.51% +0.13%
==========================================
Files 3010 3007 -3
Lines 91152 90879 -273
Branches 16985 16909 -76
==========================================
+ Hits 32254 32277 +23
+ Misses 56396 56100 -296
Partials 2502 2502 ☔ View full report in Codecov by Sentry. |
…om SSO Service - Fix main.background.ts
4ade22d
to
0091a20
Compare
…om SSO Service - Added simple tests
…om SSO Service - Tiny touchups.
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.
Nice work on this! Would you mind adding recordings of SSO login working still on each client on the PR? Just a few nits below:
@@ -74,12 +76,16 @@ export abstract class SsoLoginServiceAbstraction { | |||
* Gets the value of the active user's organization sso identifier. | |||
* | |||
* This should only be used post successful SSO login once the user is initialized. | |||
* @param userId The user id for the current |
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.
Nit: comment needs to be finished?
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.
Thank you for adding this test suite! Love to see our test coverage go up!
if (userId !== undefined) { | ||
await this.userOrgSsoIdentifierState(userId).update((_) => organizationIdentifier); | ||
} else { | ||
this.logService.warning( | ||
"Tried to set a new user organization sso identifier with an undefined user id.", | ||
); | ||
} |
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.
Nit: using the early return approach cleans this up just a bit, but isn't 100% necessary just something to think about for the future.
Example:
if (userId === undefined) {
this.logService.warning(
"Tried to set a new user organization sso identifier with an undefined user id.",
);
return;
}
await this.userOrgSsoIdentifierState(userId).update((_) => organizationIdentifier);
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.
I prefer that approach too, thanks for catching that. I'll get that fixed in a sec.
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-12040
📔 Objective
Update the SSO Login Service to use SingleUserState instead of deprecated ActiveUserState.
⏰ 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