a0fa81b3
refactor(authn): one Principal.CanRead() for the read-plane ACL (spec-ejq.1)
graph's gate, web's mayRead and mcpsrv's Gate each hand-spelled 'IsOwner() || IsAgent()' — three copies of the read ACL, which graph's own comment warned is how a corpus leaks when they drift. Define it once as authn.Principal.CanRead and route all three through it. coreauth.Derive keeps its own owner||agent test on purpose: it answers a different question (is this an owner-backed identity to bridge to AUTH_INTERNAL), and coupling it to the read ACL would misroute a future read-only viewer kind to the owner's UserID. Closes spec-ejq.1
Eugene Blikh <bigbes@gmail.com> — 2026-07-24 16:59:33 UTC
Commit a0fa81b359bd57c82b22ff0148cde77f24ba70e5 —
view raw patch
Parent(s):
865a21fa
| File | Status | + | − |
|---|---|---|---|
authn/principal.go
|
M | +8 | |
authn/principal_test.go
|
A | +27 | |
graph/server.go
|
M | +4 | -7 |
mcpsrv/mcpsrv.go
|
M | +5 | -6 |
web/handlers.go
|
M | +4 | -7 |