feat(access): denial retention knob, State Store sweep and dashboard denials page (#1842)

Add [access].denial_retention (default 90 days, matching the audit-retention
seed) wired through config defaults and validation; the State Store sweeps
denial records older than the configured age hourly via the new
access.DenialPruner / PruneDenials store query. The dashboard gains
GET /api/access/denials (read_audit-gated, so org admins/owners see their
org's records; the store scopes by the credential's org) and an
/org/denials page backed by a Pinia store.
This commit is contained in:
sam committed 2026-10-31 14:23:31 +11:00
1 parent 369e741df1
commit da01f2cbe1
28 files changed
+625 -116

No files matched your search

+4
View File
@@ -117,6 +117,9 @@ type Server struct {
// Policies is the stored access policy chain, behind the policies page.
// Nil answers 503.
Policies access.PolicyStore
// DenialLister lists the caller's org's recorded denials, behind the
// denials page. Nil answers 503.
DenialLister access.DenialStore
// Audit is the org-scoped audit feed, behind the audit page and the live
// tail. Nil answers 503 on every audit route.
Audit audit.Store
@@ -379,6 +382,7 @@ func (s *Server) registerConfigAndLogRoutes(mux *http.ServeMux) {
mux.HandleFunc("GET /api/access/policies", s.handleListPolicies)
mux.HandleFunc("PUT /api/access/policies", s.handlePutPolicy)
mux.HandleFunc("DELETE /api/access/policies", s.handleDeletePolicy)
mux.HandleFunc("GET /api/access/denials", s.handleListDenials)
mux.HandleFunc("GET /api/control-plane/resources/{kind}", s.handleControlPlaneQuery)
mux.HandleFunc("GET /api/control-plane/resources/{kind}/history", s.handleControlPlaneHistory)
mux.HandleFunc("POST /api/control-plane/resources/{kind}/commands/{command}", s.handleControlPlaneCommand)