From 2379027ceca56c0deaef5c40e6b4828495e36ed8 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 21 Oct 2026 09:56:15 +0200 Subject: [PATCH] Propose mesh-issues' owners: take the SDK that reads names with digits as names (issue 1439) mesh-config refused every owners proposal as carrying a secret, because the SDK's CheckSecret took modules/asus-zephyrus-g14, i3status-rust and powerlevel10k for random strings. The SDK at feat/1439-name-runs judges such a lowercase name piece by piece; this moves mesh-config to it and proves the catalogue's own owners list plus okioki is put to the operator. --- .gitignore | 1 + .../cmd/mesh-config/proposals_test.go | 23 +++ .../cmd/mesh-config/testdata/owners-1439.json | 137 ++++++++++++++++++ modules/mesh-config/go.mod | 4 +- modules/mesh-config/go.sum | 2 + 5 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 modules/mesh-config/cmd/mesh-config/testdata/owners-1439.json diff --git a/.gitignore b/.gitignore index 9a589bdf..843fce8e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ modules/mesh-files/cmd/mesh-files/mesh-files modules/mesh-provisioner-client/cmd/mesh-provisioner-client/mesh-provisioner-client modules/brother/cmd/brother/brother modules/mesh-build-go/cmd/mesh-build-go/mesh-build-go +modules/mesh-config/mesh-config diff --git a/modules/mesh-config/cmd/mesh-config/proposals_test.go b/modules/mesh-config/cmd/mesh-config/proposals_test.go index 7ebe7825..85da677a 100644 --- a/modules/mesh-config/cmd/mesh-config/proposals_test.go +++ b/modules/mesh-config/cmd/mesh-config/proposals_test.go @@ -3,6 +3,8 @@ package main import ( "encoding/json" "errors" + "os" + "path/filepath" "strings" "sync" "testing" @@ -566,3 +568,24 @@ func TestTheProposalArgumentsAreReadStrictly(t *testing.T) { t.Errorf("a proposal with no channel: %v", err) } } + +// 1439/AC3: mesh-issues' owners, the catalogue's 134 defaults plus okioki, are proposed to the operator and +// not refused as carrying a secret: modules/asus-zephyrus-g14, i3status-rust and powerlevel10k are names. +func TestAnOwnersListOfNamesWithDigitsIsProposed(t *testing.T) { + c, m, r := aProposingMesh(t) + m.mirror(t, DeclaredConfigRead, "mesh-issues", `{"module":"mesh-issues","settings":{ + "owners":{"kind":"","default":[],"why":"","type":"list","description":"owners","trusted":true}}}`) + m.assign(t, "novox", "mesh-issues") + raw, err := os.ReadFile(filepath.Join("testdata", "owners-1439.json")) + if err != nil { + t.Fatal(err) + } + var owners []any + if err := json.Unmarshal(raw, &owners); err != nil || len(owners) != 135 { + t.Fatalf("testdata holds %d owners (%v), want the 134 defaults plus okioki", len(owners), err) + } + a := propose(t, c, Call{Key: "owners", Value: owners, Node: "novox", Module: "mesh-issues"}) + if a.Proposal == "" || len(r.subjects) != 1 { + t.Fatalf("the owners were not put to the operator: %+v, asked on %v", a, r.subjects) + } +} diff --git a/modules/mesh-config/cmd/mesh-config/testdata/owners-1439.json b/modules/mesh-config/cmd/mesh-config/testdata/owners-1439.json new file mode 100644 index 00000000..df394f21 --- /dev/null +++ b/modules/mesh-config/cmd/mesh-config/testdata/owners-1439.json @@ -0,0 +1,137 @@ +[ +"hq", +"mesh-catalog", +"mesh-catalog modules/adwaita", +"mesh-catalog modules/artifact-store-tools", +"mesh-catalog modules/asus-zephyrus-g14", +"mesh-catalog modules/audit-logger", +"mesh-catalog modules/avahi", +"mesh-catalog modules/baserow", +"mesh-catalog modules/betterbird", +"mesh-catalog modules/blueman", +"mesh-catalog modules/bluetooth", +"mesh-catalog modules/ca-trust", +"mesh-catalog modules/claude-code", +"mesh-catalog modules/claude-licence-manager", +"mesh-catalog modules/clipmenu", +"mesh-catalog modules/confluence", +"mesh-catalog modules/cups", +"mesh-catalog modules/dbus", +"mesh-catalog modules/desk-channel", +"mesh-catalog modules/disk-load", +"mesh-catalog modules/distribution", +"mesh-catalog modules/dmenu", +"mesh-catalog modules/dnsmasq", +"mesh-catalog modules/docker", +"mesh-catalog modules/docker-compose", +"mesh-catalog modules/dunst", +"mesh-catalog modules/fail2ban", +"mesh-catalog modules/feh", +"mesh-catalog modules/flatpak", +"mesh-catalog modules/fonts", +"mesh-catalog modules/forticlient", +"mesh-catalog modules/gitea", +"mesh-catalog modules/gitlab", +"mesh-catalog modules/gnome-keyring", +"mesh-catalog modules/grafana", +"mesh-catalog modules/hello-web", +"mesh-catalog modules/home-assistant", +"mesh-catalog modules/hostname", +"mesh-catalog modules/i3", +"mesh-catalog modules/i3status-rust", +"mesh-catalog modules/icecast", +"mesh-catalog modules/influxdb", +"mesh-catalog modules/invoicing", +"mesh-catalog modules/jira", +"mesh-catalog modules/keycloak", +"mesh-catalog modules/lab", +"mesh-catalog modules/lemurs", +"mesh-catalog modules/letta", +"mesh-catalog modules/local-model-consumer", +"mesh-catalog modules/localization", +"mesh-catalog modules/logrotate", +"mesh-catalog modules/mailu", +"mesh-catalog modules/marrytts", +"mesh-catalog modules/matrix", +"mesh-catalog modules/memory-pressure", +"mesh-catalog modules/mesh-catalog", +"mesh-catalog modules/mesh-cli", +"mesh-catalog modules/mesh-delivery", +"mesh-catalog modules/mesh-delivery-gate", +"mesh-catalog modules/mesh-issues", +"mesh-catalog modules/mesh-vault", +"mesh-catalog modules/mesh-watcher", +"mesh-catalog modules/messenger", +"mesh-catalog modules/minio", +"mesh-catalog modules/model-usage", +"mesh-catalog modules/mongodb", +"mesh-catalog modules/mosquitto", +"mesh-catalog modules/mounts", +"mesh-catalog modules/mssql", +"mesh-catalog modules/n8n", +"mesh-catalog modules/nats", +"mesh-catalog modules/netcheck", +"mesh-catalog modules/networkmanager", +"mesh-catalog modules/nextcloud", +"mesh-catalog modules/nextcloud-client", +"mesh-catalog modules/nfs-server", +"mesh-catalog modules/nftables", +"mesh-catalog modules/nm-applet", +"mesh-catalog modules/node-env", +"mesh-catalog modules/nodered", +"mesh-catalog modules/ollama", +"mesh-catalog modules/only-office", +"mesh-catalog modules/openai-consumer", +"mesh-catalog modules/openrazer", +"mesh-catalog modules/pacman", +"mesh-catalog modules/photos-eef", +"mesh-catalog modules/photos-filip", +"mesh-catalog modules/picom", +"mesh-catalog modules/polychromatic", +"mesh-catalog modules/postgres", +"mesh-catalog modules/power", +"mesh-catalog modules/powerlevel10k", +"mesh-catalog modules/records", +"mesh-catalog modules/redis", +"mesh-catalog modules/restic", +"mesh-catalog modules/rofi", +"mesh-catalog modules/route-adapter", +"mesh-catalog modules/screen-lock", +"mesh-catalog modules/searxng", +"mesh-catalog modules/sensors", +"mesh-catalog modules/showcase", +"mesh-catalog modules/slack", +"mesh-catalog modules/snapd", +"mesh-catalog modules/ssh-client", +"mesh-catalog modules/sshd", +"mesh-catalog modules/step-ca", +"mesh-catalog modules/sudo", +"mesh-catalog modules/supabase", +"mesh-catalog modules/systemd", +"mesh-catalog modules/systemd-networkd", +"mesh-catalog modules/systemd-resolved", +"mesh-catalog modules/telegram", +"mesh-catalog modules/time-sync", +"mesh-catalog modules/triggerhappy", +"mesh-catalog modules/umami", +"mesh-catalog modules/unifi", +"mesh-catalog modules/website", +"mesh-catalog modules/xclip", +"mesh-catalog modules/xdg", +"mesh-catalog modules/xorg", +"mesh-catalog modules/xterm", +"mesh-catalog modules/zfs", +"mesh-catalog modules/zsh", +"mesh-catalog modules/zsh-autosuggestions", +"mesh-catalog modules/zsh-syntax-highlighting", +"mesh-controller", +"mesh-controller modules/build-agent", +"mesh-controller modules/route-proxy", +"mesh-delivery", +"mesh-host", +"mesh-lab", +"mesh-media-catalog", +"mesh-sdk", +"mesh-tools", +"okioki" +] \ No newline at end of file diff --git a/modules/mesh-config/go.mod b/modules/mesh-config/go.mod index 42fbeb9d..c027e91b 100644 --- a/modules/mesh-config/go.mod +++ b/modules/mesh-config/go.mod @@ -1,5 +1,5 @@ module mesh-config -go 1.25.0 +go 1.26.0 -require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261013235212-c8b07242a009 +require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261021075504-7bf4a8053a49 diff --git a/modules/mesh-config/go.sum b/modules/mesh-config/go.sum index 7e6c029b..b21c9645 100644 --- a/modules/mesh-config/go.sum +++ b/modules/mesh-config/go.sum @@ -1,2 +1,4 @@ git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261013235212-c8b07242a009 h1:I9rm8HhYRJ0+mzQQz+VAH0kgv2YJWkvctEc67Yd0PX8= git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261013235212-c8b07242a009/go.mod h1:GFuZUElBZ9A++mxgIKo97aXXo+kV0uJ/UkbhQPPIbrY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261021075504-7bf4a8053a49 h1:h1hE+H1TzmeWNFP3EnfhUXTZq2gyiyeND32Tsg83ygY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261021075504-7bf4a8053a49/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY=