Refuse a credential in a log entry and take a full 256 KiB value with its expect header (ADR 0297 review)
mesh/merge-gate pass: builds mesh-tools, node-tools → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of …
mesh/repo-check pass: THE CHANGE ALTERS ITS OWN CHECK (merge-check.sh): main's version judged it; the change's judges the pull requests after it merges; it…
mesh/delivery delivered

A log keeps what it is given for good, so the state guard against secrets
applies to it too; the stream holds 260 KiB a message so the headers an
append carries never push a 256 KiB value over.
This commit is contained in:
jochen
2026-10-11 19:20:31 +02:00
parent d535dd5322
commit 82aefe1988
4 changed files with 30 additions and 6 deletions
+2 -2
View File
@@ -234,7 +234,7 @@ func (m *Mesh) Bucket(t *testing.T, name string) nats.KeyValue {
// Log makes a module's log afresh as the controller does from the catalogue (novox/hq ADR 0297): a file
// stream named LOG_<module>_<name> on mesh.log.<module>.<name>.>, limits retention, no age, no cap per
// key, the declared cap, 256 KiB an entry, refusing new entries when full, direct get, no delete or
// key, the declared cap, 260 KiB a message (a 256 KiB value and its headers), refusing new entries when full, direct get, no delete or
// purge. It answers the membership entry the controller issues for it.
func (m *Mesh) Log(t *testing.T, module, name string, maxBytes int64) bus.LogIssued {
t.Helper()
@@ -243,7 +243,7 @@ func (m *Mesh) Log(t *testing.T, module, name string, maxBytes int64) bus.LogIss
_ = m.js.DeleteStream(stream)
if _, err := m.js.AddStream(&nats.StreamConfig{Name: stream, Subjects: []string{subject + ".>"},
Storage: nats.FileStorage, Retention: nats.LimitsPolicy, MaxAge: 0, MaxMsgsPerSubject: -1,
MaxBytes: maxBytes, MaxMsgSize: 256 * 1024, Discard: nats.DiscardNew, AllowDirect: true,
MaxBytes: maxBytes, MaxMsgSize: 260 * 1024, Discard: nats.DiscardNew, AllowDirect: true,
DenyDelete: true, DenyPurge: true, Replicas: 1,
Description: module + "'s log " + name + ", kept as its record (novox/hq ADR 0297)"}); err != nil {
t.Fatal(err)