PR12: Enterprise IAM/RBAC end-to-end validation and hardening - #1
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan