The bus account has JetStream, and the control plane's client has its own inbox
Two refusals the first live connections met. A user in the MESH account was told "JetStream not enabled for account" the first time it bound a consumer: with accounts defined, JetStream is enabled per account, not only globally — the account's setting, which the mesh owns, not the server's block, which it does not. And the control plane's client used a random inbox prefix where it is granted exactly _INBOX.<its user>.>, so the server's first answer could not reach it. The prefix now follows from the user in the URL, for every principal that dials so.
This commit is contained in:
@@ -42,6 +42,12 @@ func Dial(url string, opts ...nats.Option) (*JetStream, error) {
|
||||
}
|
||||
opts = append(opts, nats.Secure(pinned))
|
||||
}
|
||||
// **Its own inbox, and nothing wider.** Every principal is granted `_INBOX.<its user>.>` and
|
||||
// no other inbox; the client's default prefix is random, and the server refused the first
|
||||
// subscription to it (2026-09-28). The user is in the URL, so the prefix follows from it.
|
||||
if user, _, _ := CredentialIn(url); user != "" {
|
||||
opts = append(opts, nats.CustomInboxPrefix("_INBOX."+user))
|
||||
}
|
||||
// The address in an error is the address alone. The URL carries this controller's password,
|
||||
// and an error here is written on the assumption it will be logged.
|
||||
where := BareAddress(url)
|
||||
|
||||
Reference in New Issue
Block a user