Skip to content

Authorization on _INBOX.> #192

@ramasa

Description

@ramasa

We are using nats as a channel for JSON-RPC and exposed it to our client so that they can invoke our API using Message reply = nc.request("req.foo", request)
How do I prevent our client from subscribing to '_INBOX.>' and read other's response?

authorization {
CLIENT = {
publish = ["req.foo", "req.bar"]
subscribe = "_INBOX.>"
}

Only way I see now is to mimic NatsConnection.request method to use a custom inbox like _INBOX.clientid.*

and set client specific rule as below
authorization {
CLIENT1 = {
publish = ["req.foo", "req.bar"]
subscribe = "_INBOX.client1.>"
}

Exposing NatsConnection.INBOX_PREFIX might help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions