Enforce central authorization with group ancestry and bounded revocation (#10) #44
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!44
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?
Implements issue #10 (F05): one deny-by-default authorization path, including group ancestry, at the request boundary, with freshness read on every call so revocation takes effect on the next call. Follows the plan and the identity design.
This does not authorize operational or classified data. The revocation ceiling (OD-14), behavior after revocation (OD-12) and the other open decisions in the decision register are still proposals. Synthetic labels and test routes only.
What it adds
GroupGraphinrag-domain: validated, bounded, cycle-free, same-organization. A document is readable only via the subject's direct groups and their ancestors, never descendants, siblings or other organizations. Documents carry an optional group in the marking.rag-authorization, still pure, no I/O): the group rule,permitted_groupsfor SQL and Qdrant prefilters, andUnexpectedGroup(a conversation marking that carries a group is denied).PolicySource,StaticPolicySource,GroupSourceand a PostgreSQL group source read in oneREPEATABLE READ, READ ONLYsnapshot. Errors, timeouts and inconsistent graphs never yield a permit.Enforcerinrag-api: re-reads session, policy and groups on every call (no cache) and answers permit, hidden or unavailable. Absent, forbidden, cross-organization and unauthenticated requests get byte-identical 404s; dependency failures get a uniform 503.SearchGrantcarries a scope plus matching contexts for adapters.ResourceLoaderreceives the verified subject so a conversation loader can enforce ownership.docs/operations/authorization.md; OD-14 evidence line in the register (status unchanged).Verification (this branch, local PostgreSQL 17)
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo test --workspace --locked: 68 passed, 0 failed, 75 ignored (the PostgreSQL suites).bash scripts/test-postgres.sh --local: admin 4, authz 10, identity 30, policy 1, foundation 15, recovery 9, revocation 6, all passing.Known gaps and open decisions
identity_groupstable and the 10,000-node cap is global (fail-closed); scoping per organization is a follow-up.ActiveSubject.ResourceLoadercontract must forbid id-dependent errors before the first real loader (#17).SearchGrantcannot carry cancellation yet (#19/#20); decision audit and metrics belong to #11 and O02.postgres.rscan flake under--test-threads=4.Refs #10, #2, #9.
🤖 Generated with Claude Code