Skip to content

PR13 — Add role-tier x service permission forwarding tests - #5

Merged
man4ish merged 1 commit into
mainfrom
feature/pr13-dynamic-rbac-activation
Aug 6, 2026
Merged

man4ish merged 1 commit into
mainfrom
feature/pr13-dynamic-rbac-activation

Conversation

@man4ish

@man4ish man4ish commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

No functional code change in this repo. This PR adds test coverage confirming the Gateway correctly forwards the right permissions and required_permission to the Policy Engine for every role tier in PR13's scenario matrix (Platform Admin, Org Admin, Scientist, Viewer) across all 5 SERVICE_PERMISSION_MAP-mapped services (workbench, tes, toolserver, model-registry, rag).

SERVICE_PERMISSION_MAP, header forwarding (X-Permissions, deliberately no roles header — matches PR13's "rely on permissions, not hardcoded roles" direction), and PolicyMiddleware's unconditional gating of all 5 services were already correct from PR12 — this PR proves it holds for the new dynamic role tiers specifically, rather than assuming it does.

New file: tests/test_pr13_role_tier_permission_forwarding.py — parametrized over 4 role tiers × 5 services (20 cases), asserting the exact permissions list and required_permission value reach PolicyClient.evaluate, plus a follow-up confirming X-Permissions varies correctly per tier for the two new PR13 default roles (scientist/viewer).

Dependency

This PR is part of PR13 — Dynamic Enterprise RBAC Activation.
It must be reviewed and merged in dependency order with the other PR13 repositories.
Do not merge independently.

Dependency order: auth → policy-engine → api-gateway (this PR) → control-center → studio → docs.

Validation

Tests performed: 178 passed (full suite, including 25 new PR13 tests — 20 role-tier × service forwarding cases + 5 X-Permissions variation checks).

Security checks: none required beyond the new coverage — this repo's authorization-relevant code (permission forwarding, header construction) is unchanged. Confirmed via test that no roles header is ever forwarded downstream (by design) and permissions are forwarded verbatim from the JWT, unmodified.

Compatibility notes: purely additive test file, zero production code touched. New tests mock PolicyClient.evaluate rather than exercising real Policy Engine decision logic, matching this repo's existing test convention (the actual allow/deny decision is tested in and owned by omnibioai-policy-engine).

Related PRs

Part of the PR13 review set, all on feature/pr13-dynamic-rbac-activation:

  • omnibioai-auth — PR #32 (draft, open)
  • omnibioai-policy-engine — PR #2 (draft, open) — the enforcement fix this repo's forwarding feeds into
  • omnibioai-control-center — PR #20 (draft, open)
  • omnibioai-studio — deployment runbook + smoke test exercising this end to end
  • omnibioai-docs — architecture documentation

Review only — do not merge. No migration applied, no deployment performed, live stack untouched.

Confirms Policy Engine receives the correct permissions/required_permission
per role tier (Platform Admin/Org Admin/Scientist/Viewer) for each of the
5 SERVICE_MAP-mapped services, and X-Permissions varies correctly by tier.
No functional code change -- gateway forwarding was already correct.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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