简体   繁体   中英

How to pass token to NATS server using nats-pub.py script

I am new in NATS.
Please can you provide how to pass token to NATS server using nats-pub.py script.
python /tmp/nats-pub.py --creds ? -s nats://eventbus-default-stan-svc:4222 {label} -d '{json}'
I can get NATS access configuration

"config": {
    "nats": {
        "accessSecret": {
            "key": "client-auth",
            "name": "eventbus-default-client"
        },
        "auth": "token",
        "clusterID": "eventbus-default",
        "url": "nats://eventbus-default-stan-svc:4222"
    }
}

How to configure request to pass authorization because now I get Error: nats: 'Authorization Violation'.

This is not possible in current version of nats-pub.py because this is not implemented there. I have commited new version of nats-pub.py . There is implemented --token switch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM