Skip to content

PR12: Enterprise IAM/RBAC end-to-end validation and hardening - #1

Merged
man4ish merged 1 commit into
mainfrom
feature/pr12-enterprise-iam-rbac-validation
Aug 6, 2026
Merged

man4ish merged 1 commit into
mainfrom
feature/pr12-enterprise-iam-rbac-validation

Conversation

@man4ish

@man4ish man4ish commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • RBAC fixtures and tests: permission- and org-tenancy-aware Policy Engine

Test plan

  • 84/84 tests pass locally

… Engine

Previously had no concept of the JWT permissions claim or org_id at all --
authorization was pure role-name/action-string matching (RBAC), with ABAC
and RULES layered after it. The Gateway already forwarded permissions on
every /policy/evaluate call; nothing here ever read it.

Adds two new, additive gates between RBAC and ABAC:
- PERMISSION (app/core/permissions.py): checks req.permissions against an
  action/resource -> required-permission map (workflow.execute,
  dataset.read, workflow.manage), using the same permission-registry
  strings omnibioai-auth already reserves. Opt-in: a no-op when
  permissions=[] entirely, so today's real traffic (no role is granted
  these permissions yet) sees zero behavior change -- verified by the
  full pre-existing test suite passing unmodified.
- TENANCY (app/core/tenancy.py): requires org_id == context.resource_org_id
  when both are supplied. Same opt-in shape.

Narrows one legacy RBAC rule: dataset.read no longer requires the
data_scientist role (write/delete actions still do) -- read access is now
governed by the PERMISSION gate instead, which is what makes a genuine
read-only "Viewer" tier possible; previously there was no way to grant read
without also granting write/delete.

Adds test_role_hierarchy_fixtures.py, mapping PR12's conceptual Platform
Owner/Org Admin/Scientist/Viewer hierarchy onto the real role/permission
vocabulary (no new roles or DB changes -- see that file's docstring for the
full reasoning), with allow/deny cases for each tier.

Adds permissions.py/tenancy.py to the Cython IP-protection build
(setup.py) for consistency with the rest of app/core, and rebuilds the
.c/.so artifacts for engine.py/rbac.py/cache.py/permissions.py/tenancy.py
this change touches -- this repo's Dockerfile ships committed binaries
directly rather than recompiling at image-build time.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@man4ish
man4ish merged commit 600f894 into main Aug 6, 2026
1 of 2 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.

1 participant