Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions deploy/chart/thump/templates/rbac-rook-ceph-read.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Gated on domains.rookCeph.enabled: the rook-ceph namespace doesn't exist
# on the dev cluster profile (docs/dev-environment.md) — see values.yaml's
# domains comment.
#
# configmaps is required alongside pods/deployments/replicasets: the kube
# evidence tool's KubeChangeSource unions every subject namespace on every
# reasoning run, not just the namespace of the fingerprint being reasoned
# about (internal/evidence/kube_change.go), so any run on a rig with this
# domain enabled needs the grant regardless of which fingerprint fired. Same
# gap as rbac-acme-read.yaml, found live 2026-08-19 dead-lettering
# slo_burn:argocd via thump.detections.
{{- if .Values.domains.rookCeph.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand All @@ -14,6 +22,9 @@ rules:
- apiGroups: ["apps"]
resources: ["deployments", "replicasets"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
19 changes: 19 additions & 0 deletions internal/broker/grants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,22 @@ func TestNATSConfig_GrantsHissTheRebuildHoldsEphemeralConsumer(t *testing.T) {
}
}
}

func TestNATSConfig_GrantsClankTheRebuildLedgerEphemeralConsumers(t *testing.T) {
t.Parallel()
// rebuildLedger (internal/clank/rebuild.go) mints fresh ephemeral
// consumers across proposals, outcomes, and declines on every startup to
// replay the in-memory ledger and casebase.
users := parseNATSUsers(t, renderNATSConf(t))
for _, want := range []string{
"$JS.API.CONSUMER.CREATE.THUMP.*.thump.proposals",
"$JS.API.CONSUMER.CREATE.THUMP.*.thump.outcomes",
"$JS.API.CONSUMER.CREATE.THUMP.*.thump.declines",
"$JS.API.CONSUMER.MSG.NEXT.THUMP.*",
"$JS.ACK.THUMP.*.>",
} {
if !slices.Contains(users["clank@thump.svc"].Publish, want) {
t.Errorf("clank@thump.svc does not hold %q — rebuildLedger's ephemeral consumer replay cannot create/fetch/ack without it", want)
}
}
}
1 change: 1 addition & 0 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ func TestEveryBrokerLoader_RequiresSealKeyNotJustClanks(t *testing.T) {
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
tc.env(t)
t.Setenv("THUMP_SEAL_KEY", "")
if err := tc.load(true); err == nil || !strings.Contains(err.Error(), "THUMP_SEAL_KEY") {
t.Error("every beat seals its WAL segments — hardening one loader and not the rest is a hole with a test in front of it")
}
Expand Down