[PM-16251] Remove ActiveUserState from Policy Service#13231
Conversation
|
Great job, no security vulnerabilities found in this Pull Request |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13231 +/- ##
==========================================
+ Coverage 35.29% 35.32% +0.02%
==========================================
Files 3126 3129 +3
Lines 92597 92695 +98
Branches 16805 16835 +30
==========================================
+ Hits 32684 32741 +57
- Misses 57473 57500 +27
- Partials 2440 2454 +14 ☔ View full report in Codecov by Sentry. |
…en/clients into ac/PM-16251-vNext-Policy-Service
| const organization = orgDict[policy.organizationId]; | ||
|
|
||
| // This shouldn't happen, i.e. the user should only have policies for orgs they are a member of | ||
| // But if it does, err on the side of enforcing the policy |
There was a problem hiding this comment.
non-blocking question: is there a way for us to get visibility into this in the rare event it does happen?
I checked Datadog, and it doesn't look like we use RUM. I'm not sure if we're using another monitoring tool for the client side.
There was a problem hiding this comment.
@JimmyVo16 : We don't have any observability for front-end errors. (There was an innovation sprint proposal related to this but it was deferred if you want to look it up for context - user privacy is a big issue with logging/analytics.)
libs/common/src/admin-console/abstractions/policy/vnext-policy.service.abstraction.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/abstractions/policy/vnext-policy.service.abstraction.ts
Show resolved
Hide resolved
libs/common/src/admin-console/services/policy/default-vnext-policy.service.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/policy/default-vnext-policy.service.ts
Outdated
Show resolved
Hide resolved
| const organization = orgDict[policy.organizationId]; | ||
|
|
||
| // This shouldn't happen, i.e. the user should only have policies for orgs they are a member of | ||
| // But if it does, err on the side of enforcing the policy |
There was a problem hiding this comment.
@JimmyVo16 : We don't have any observability for front-end errors. (There was an innovation sprint proposal related to this but it was deferred if you want to look it up for context - user privacy is a big issue with logging/analytics.)
libs/common/src/admin-console/abstractions/policy/vnext-policy.service.abstraction.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/policy/default-vnext-policy.service.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/policy/default-vnext-policy.service.spec.ts
Outdated
Show resolved
Hide resolved
| describe("policies$", () => { | ||
| it("returns all policies", async () => { |
There was a problem hiding this comment.
This tests contradicts the next tests: it can't return all policies and not return policies that are disabled or not enforced. As per previous comment this behavior is likely to change, but just consider how the test can be as specific as possible to its intended behavior.
libs/common/src/admin-console/services/policy/default-vnext-policy.service.spec.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/policy/default-vnext-policy.service.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/abstractions/policy/vnext-policy.service.abstraction.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/policy/default-vnext-policy.service.spec.ts
Outdated
Show resolved
Hide resolved
|




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-16251
📔 Objective
This PR adds in the vNext implementations of the Policy Service with ActiveUserState references removes. Promise based async functions are refactored to return Observables, and the service is refactored to remove get$ and getAll$. Functions are refactored to expect a UserId as a required param.
This code is not yet wired up, this is only the initial implementation. This will be wired up in followup PRs
📸 Screenshots
⏰ 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