https://github.com/ad/nsqauth
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ad/nsqauth
- Owner: ad
- License: mit
- Created: 2021-08-08T08:59:52.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T17:15:07.000Z (about 1 year ago)
- Last Synced: 2025-03-20T23:28:37.214Z (about 1 year ago)
- Language: Go
- Size: 122 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nsqauth
https://nsq.io/components/nsqd.html#auth
To configure nsqd to require authorization you need to specify the --auth-http-address=host:port flag with an Auth Server that conforms to the Auth HTTP protocol.
*NOTE:* It is expected when using authorization that only the nsqd TCP protocol is exposed to external clients, not the HTTP(S) endpoints. See the note below about exposing stats and lookup to clients with auth.
The Auth Server must accept an HTTP request on:
```
/auth?remote_ip=...&tls=...&secret=...
```
And return a response in the following format:
```
{
"ttl": 3600,
"identity": "username",
"identity_url": "https://....",
"authorizations": [
{
"permissions": [
"subscribe",
"publish"
],
"topic": ".*",
"channels": [
".*"
]
}
]
}
```
# RUN
```
$ go run . --file=demoauth.csv --log=error
```