Announce only on the subjects the grants allow (hq ADR 0197)
Both runtimes subscribed $SRV.<verb>.> as a wildcard; the grants allow the bare question and the service's own name and instance. The bus refused the wildcard, and the TypeScript runtime treats a refused subscription as fatal, so every per-module container crash-looped after the image rolled. They now subscribe exactly $SRV.<verb>, $SRV.<verb>.<name> and $SRV.<verb>.<name>.<id>.
This commit is contained in:
@@ -158,7 +158,9 @@ func Serve(conn *bus.Conn, s Service, current func() []Endpoint) (func(), error)
|
||||
}
|
||||
var stops []func()
|
||||
for _, verb := range []string{"PING", "INFO", "STATS"} {
|
||||
for _, subject := range []string{"$SRV." + verb, "$SRV." + verb + ".>"} {
|
||||
// Exactly the questions asked of every service and of this one by name and instance — what the
|
||||
// grants allow (novox/hq ADR 0197). A wildcard is refused by the bus.
|
||||
for _, subject := range []string{"$SRV." + verb, "$SRV." + verb + "." + s.Name, "$SRV." + verb + "." + s.Name + "." + s.ID} {
|
||||
stop, err := conn.Raw(subject, answer)
|
||||
if err != nil {
|
||||
for _, st := range stops {
|
||||
|
||||
Reference in New Issue
Block a user