The connections request asks for user names, which the server leaves out otherwise (issue 1147)

This commit is contained in:
2026-10-18 19:27:12 +02:00
parent eba864dc5f
commit 0520773412
+4 -2
View File
@@ -116,8 +116,10 @@ func TestNatsTheSystemAccountsExportsReachMeshOnAReload(t *testing.T) { // 1147/
}
}
hears(connects, "connect")
// The answer to the connections request lists the open connections, the shop's among them.
reply, err := watchman.Request(BusConnzSubject, []byte(`{}`), 5*time.Second)
// The answer to the connections request lists the open connections, the shop's among them. The server names the
// account from the subject the export clamps (MESH), but leaves the user's name out unless the request asks for it
// with "auth": true (monitor.go ConnzOptions.Username), so the watchman asks so.
reply, err := watchman.Request(BusConnzSubject, []byte(`{"auth":true}`), 5*time.Second)
if err != nil {
t.Fatalf("mesh.bus.connz is not answered: %v", err)
}