Skip to content

a2ui-server: plugged RBAC gates over the app's RbacBinding - #51

Merged
AdaWorldAPI merged 1 commit into
mainfrom
ccr-0455e606-wmtsor
Oct 8, 2026
Merged

AdaWorldAPI merged 1 commit into
mainfrom
ccr-0455e606-wmtsor

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

A new module, a2ui_server::plugged, adds the bound RBAC verdict to the existing session gates. It reuses lance-graph's contract::rbac_plug socket (lance-graph#1404).

a2ui-rs owns no classes or roles; it renders whatever app it serves. So it declares no RbacPlug of its own. The app declares and binds its plug (for example medcare-rs's RBAC_PLUG, AdaWorldAPI/MedCare-rs#626) and passes the RbacBinding in.

  • project_plugged(session, binding, role, key, surface):
    1. requires a READ grant on the node's class;
    2. narrows the session role mask by the role's declared field mask for that class (no mask declared means no narrowing);
    3. calls the unchanged project_surface, so its fail-closed rules still apply.
  • resolve_action_plugged(session, binding, role, invoke, actions): calls the unchanged resolve_action (class range and ordinal), then requires an ACT grant for the resolved predicate.
  • A class or role outside the plug is refused with RbacDrift::NotPlugged or RbacDrift::RoleNotPlugged, never allowed because it is unknown. The test case for this is a class inside the session range but outside the plug.

What is unchanged

Session, project_surface, resolve_action and every existing call site. No new dependencies; Cargo.lock only moves lance-graph-contract to the main revision that carries rbac_plug.

Tests

  • 6 new tests; the full workspace suite passes.
  • Four disable runs each turned their target test red: removing the READ gate, removing mask narrowing, removing the ACT gate, and bypassing the session gate.
  • cargo clippy --all-targets -D warnings and cargo fmt --check are clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg


Generated by Claude Code

…ged)

a2ui-rs owns no classes or roles, so it declares no RbacPlug; the app it
serves binds its own plug and hands the RbacBinding here. Two additive
gates add that verdict to the unchanged Session gates:

- project_plugged: READ grant on the node's class, the role's declared
  field mask narrows the session role mask, then project_surface.
- resolve_action_plugged: resolve_action (range + ordinal), then an ACT
  grant for the resolved predicate.

A class or role outside the plug is refused (RbacDrift), never allowed.
Cargo.lock moves lance-graph-contract to the rev carrying rbac_plug.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Pull request is closed - (🔄 Check again to try again)

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 8, 2026 08:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T08:10:24.492339Z 53f975e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AdaWorldAPI
AdaWorldAPI merged commit 55b318d into main Oct 8, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants