I want to set auth permission, but it seems different when using request-reply mode. Here is my setting:
values.yaml
users:
-user: test
password: testtest
permissions:
subcribe: ["test"]
pulbish: ["test"]
python code
nc = await nats.connect("nats://test:testtest@jetstream-nats:4222")
js = nc.jetstream()
await js.add_stream(name="test", subjects=["test"]
Error message:
nats.errors.Error: nats: permissions violation for subscription to "_inbox.xxxxxxxxxxxx.*"
nats.errors.Error: nats: permissions violation for publish to "$js.api.stream.create.test"
If I change value.yaml to this, it would not show any error and still can't publish to stream "test".
users:
-user: test
password: testtest
permissions:
subcribe: ["_INBOX.>"]
pulbish: ["$JS.API.STREAM.CREATE.>"]
But if I change value.yaml to this, it would occur the same error message
users:
-user: test
password: testtest
permissions:
subcribe: ["_INBOX.>"]
pulbish: ["$JS.API.STREAM.CREATE.test.>"]
========================================================================================
nats.errors.Error: nats: permissions violation for subscription to "_inbox.xxxxxxxxxxxx.*"
nats.errors.Error: nats: permissions violation for publish to "$js.api.stream.create.test"
My question is HOW TO set the subscribe and publish permission when using request-reply?
If i want to set user "testuser" only can publish to stream "test" and subscribe "test", how to set my yaml file?