Harden central authorization: route inventory, decision table, document revocation (#10) #51
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/rag-rust!51
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/10-central-authorization"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #10 (does not close it: two acceptance criteria stay deferred, see below).
What this adds
Test-and-docs hardening of the centralized authorization boundary. No production (non-test) code changes.
rag_api::inventory::ROUTES, 31 routes, five protection classes) andcrates/api/tests/route_inventory.rs: fails when a mounted route is unclassified, when.nest(/.route_service(/.nest_service(/.fallback(appears in non-test code, or when an enforced route's file does not use theEnforcer. It is a source-text, path-level check; it proves a route is classified and its file uses theEnforcer, not that each handler calls it correctly.crates/authorization/src/tests/matrix.rs): 8,100 combinations over clearance, compartments, need-to-know, organization, group, action, resource status and policy version. Expected results are hand-written flags from the rules, not computed from the decider; the decider agreed with every combination. It asserts permit or deny, not the denial reason.documents_revocation_postgres, 4 tests): 11 revocation kinds each hide the document on the next request (each with a same-account 200 control); a document with every version revoked, deleted or unavailable is hidden; a lapsed policy gives the same bytes as an absent document; an administrator with onlyadminister, or without the document's group, reads nothing. Shared test helpers moved intocommon/as a separate commit (pure move;documents_api18 andconversations_revocation6 unchanged).docs/operations/authorization.md): stale text fixed, route inventory section, and a "Deferred and open" section.Not closed by this PR
proposed; propagation is measured only for account suspension. This PR proves next-request revocation on the real document routes, not a bound.SearchGrantwindow, conversation pagination and timing leaks, citations stillDenyAllSources, group-forest 10,000-node cap, and Ruling 11 (lapsed policy is the uniform 404 as built, still open).active_attributesreturns the latest active version, so revoking only the newest version of a multi-version document would fall back to an older active one; no revoke path exists yet.Verification (head
6e39233)cargo fmt --checkandcargo clippy --workspace --all-targets --locked -- -D warningsclean;cargo test --workspace --locked136 passed, 0 failed;bash scripts/test-postgres.sh --localall 13 suites pass (new suite registered there and inscripts/coverage.sh). The coverage script was not run locally; CI will run it.Synthetic data only; no production, assurance or approval claims.
🤖 Generated with Claude Code