Skip to content

feat: Virtru as attribute store#40634

Draft
KevLehman wants to merge 61 commits into
developfrom
feat/abac-virtru-attribute-store
Draft

feat: Virtru as attribute store#40634
KevLehman wants to merge 61 commits into
developfrom
feat/abac-virtru-attribute-store

Conversation

@KevLehman
Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented May 20, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ee1ee9a7-dc08-4aae-b016-178a1e363589

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

⚠️ No Changeset found

Latest commit: d85927a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 90.98837% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.77%. Comparing base (5d00ea5) to head (d85927a).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40634      +/-   ##
===========================================
+ Coverage    69.65%   69.77%   +0.12%     
===========================================
  Files         3338     3343       +5     
  Lines       123246   123544     +298     
  Branches     21973    21985      +12     
===========================================
+ Hits         85841    86205     +364     
+ Misses       34052    33988      -64     
+ Partials      3353     3351       -2     
Flag Coverage Δ
e2e 59.14% <ø> (-0.06%) ⬇️
e2e-api 45.99% <ø> (+0.01%) ⬆️
unit 70.66% <90.98%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KevLehman KevLehman force-pushed the feat/abac-virtru-attribute-store branch from 7a0c73b to f3a549c Compare May 21, 2026 14:22
KevLehman added 25 commits May 22, 2026 10:17
Update test assertions to await the now-async method.
KevLehman added 20 commits May 22, 2026 10:17
The service relied solely on the 'license.module' broker event to track
the ABAC license flag, missing the initial state if the event fired before
subscription. Seed hasAbacLicense in started() via License.hasModule('abac')
so the effective attribute-store evaluation works on the first request.
In microservices the AbacService runs in the authorization-service
process while the license lives in the monolith. reevaluateAttributeStore
re-synced the store selection from a stale hasAbacLicense field, so the
Virtru attribute store was never selected. Refresh the flag from the
License service (broker call) before re-syncing; the monolith already
invokes this on License.onToggledFeature('abac').
The attribute-store selection was gated by a cached hasAbacLicense flag
seeded at startup and refreshed by a license-module event. In
microservices the AbacService runs in the authorization-service while the
license lives in the monolith, so both the startup seed and the event
race the cross-process license validation, leaving the service stuck on
the local store and the Virtru store unreachable.

Query the license service live at the point of use instead: effectiveStore
awaits License.hasModule('abac'), and the store instance is resolved
on demand. This matches the request-time license gate already used by the
ABAC API routes and removes the startup race entirely. Drops the
hasAbacLicense field, the license-module listener and reevaluateAttributeStore.
The microservices never run the Log_Level settings watch that the
monolith uses, so @rocket.chat/logger stayed pinned at 'warn' and debug
output from service-side code was invisible in CI. Seed the logger's
default level from a LOG_LEVEL env var and pass DEBUG_LOG_LEVEL into each
microservice container so e2e debug runs surface service logs.
VirtruAttributeStore.decideRooms now translates a failed GetDecisionBulk
call into PdpUnavailableError, so a write blocked by an unreachable
decision endpoint surfaces error-pdp-unavailable instead of a raw error.

e2e fixes: the "admin A can POST" test now targets a fresh room instead
of the pre-seeded shared room (which already had the clearance key); the
admin B DENY write tests assert error-abac-not-authorized-to-modify-room
(the PDP is reachable and returns DENY); and the wipe-transition and
local-mode-regression before hooks reset/seed the mock server before
issuing PDP-gated writes.
@KevLehman KevLehman force-pushed the feat/abac-virtru-attribute-store branch from b2dc287 to 2a00e01 Compare May 22, 2026 16:20
@rc-layne
Copy link
Copy Markdown

rc-layne Bot commented May 22, 2026

⚠️ Layne — 3 warning(s)

Found 3 issue(s): 3 high.

@julio-rocketchat
Copy link
Copy Markdown
Member

/layne exception-approve LAYNE-8598b68f3ce8435a LAYNE-e568b73325f960fd LAYNE-5929c5f8cb7138d7 reason: these are acceptable and valid ignoreSsrfValidation entries, not vulnerabilities

@rc-layne
Copy link
Copy Markdown

rc-layne Bot commented May 22, 2026

✅ Exception recorded for LAYNE-8598b68f3ce8435a, LAYNE-e568b73325f960fd, LAYNE-5929c5f8cb7138d7 by @julio-rocketchat: "these are acceptable and valid ignoreSsrfValidation entries, not vulnerabilities". Re-running scan...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants