package inventory import ( "strings" "testing" "github.com/novox/mesh-controller/internal/catalogue" ) // `give` takes only a value nobody but a person has (the review of 2026-10-09, M4): never the module's bus // account, which `issue` mints, nor a secret the mesh may make itself. func TestOnlyASecretThePersonHoldsIsGivenAtTheDesk(t *testing.T) { m := catalogue.Manifest{Module: "telegram", OwnSecrets: catalogue.OwnSecrets{ "telegram-token": {Path: "/s/telegram-token"}, "broker": {Path: "/s/broker"}, "session": {Path: "/s/session", Taken: catalogue.TakenAtStart}, }} if err := GivableAtDesk(m, "telegram-token"); err != nil { t.Errorf("the bot token was refused: %v", err) } for _, name := range []string{"broker", "session", "chat-id"} { if err := GivableAtDesk(m, name); err == nil { t.Errorf("%s was givable", name) } else if name != "chat-id" && !strings.Contains(err.Error(), "the mesh makes") { t.Errorf("%s: %v", name, err) } } }