v0.6.16: audit logging runtime admin toggle (#186) #204

Merged
Cordy merged 4 commits from ship-v0.6.16 into main 2026-08-12 21:25:39 +00:00
Owner

Closes #186 — audit logging moves from a boot-time config flag to an admin Settings toggle, persisted in the state-backend (same pattern as peering-enable and the v0.6.15 quotas).

Mechanism: the audit Logger gains a live enabled() predicate that gates Append at its single chokepoint (the audit driver calls it on every op), so no call sites change. The logger is now always constructed and wrapped around the store (previously skipped when audit.enabled was false), so it can start logging the instant it's switched on — no restart. Wired via auditLog.SetEnabled(func() bool { return settingsStore.Get().AuditEnabled || cfg.Audit.Enabled }).

Config audit.enabled is a floor: a deployment can still mandate audit on (an admin can't switch below it); otherwise it's a pure admin toggle. Historical events stay queryable regardless.

UI: an "Enable access audit logging" checkbox in Settings; the audit-log viewer is always available (querying past events). go vet, go test ./..., node-check, dual-arch build green.

Closes #186 — audit logging moves from a boot-time config flag to an admin Settings toggle, persisted in the state-backend (same pattern as peering-enable and the v0.6.15 quotas). **Mechanism:** the audit `Logger` gains a live `enabled()` predicate that gates `Append` at its single chokepoint (the audit driver calls it on every op), so no call sites change. The logger is now **always constructed and wrapped** around the store (previously skipped when `audit.enabled` was false), so it can start logging the instant it's switched on — no restart. Wired via `auditLog.SetEnabled(func() bool { return settingsStore.Get().AuditEnabled || cfg.Audit.Enabled })`. **Config `audit.enabled` is a floor:** a deployment can still mandate audit on (an admin can't switch below it); otherwise it's a pure admin toggle. Historical events stay queryable regardless. **UI:** an "Enable access audit logging" checkbox in Settings; the audit-log viewer is always available (querying past events). `go vet`, `go test ./...`, node-check, dual-arch build green.
ci: scout main.go audit construction (temp)
All checks were successful
scout / scout (push) Successful in 0s
dfc297612e
ci: v0.6.16 edit script (#186 audit runtime toggle)
All checks were successful
scout / scout (push) Successful in 0s
82da82830f
ci: v0.6.16 ship workflow (#186)
All checks were successful
ship-v0616 / ship (push) Successful in 37s
5624ea3d7e
v0.6.16: audit logging runtime admin toggle (#186)
All checks were successful
ci / test-and-build (pull_request) Successful in 35s
401f9c92ed
Cordy merged commit a15e9c11ce into main 2026-08-12 21:25:39 +00:00
Cordy deleted branch ship-v0.6.16 2026-08-12 21:25:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#204
No description provided.