Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CSV format issue and add additional details about authenticating against Bitly #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ To use validating a secret as an access token against the bitly API, use the fol
The datafile is a csv format like this.

```
login,ip,tls,topic,channel,subscribe,publish
johndoe,127.0.0.1,both,test_topic,test_channnel,subscribe,
login,ip,tls_required,topic,channel,subscribe,publish
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops thanks for catching this; it got out of sync from changes early on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries!

johndoe,127.0.0.1,true,test_topic,test_channnel,subscribe,
```

Typical usage will be like this:
Expand All @@ -50,3 +50,29 @@ Typical usage will be like this:
--oauth2-echo-endpoint=https://api-ssl.bitly.com/v3/user/info \
--oauth2-response-path=data.login

#### Authenticating against the Bitly API

Get your access token here:
[https://bitly.com/a/oauth_apps](https://bitly.com/a/oauth_apps)

Permissions.csv:
```
login,ip,tls_required,topic,channel,subscribe,publish
<your bitly username>,127.0.0.1,true,test_topic,test_channnel,subscribe,publish
```
> TLS is required. Your username can both subscribe and publish.

Starting nsqd:
```
nsqd -tls-cert=cert.pem -tls-key=key.pem -auth-http-address=127.0.0.1:4181
```

Starting `pynsqdauthd`:
```
python pynsqauthd.py \
--data_file=permissions.csv \
--http_address=0.0.0.0:4181 \
--ttl=3600 \
--oauth2-echo-endpoint=https://api-ssl.bitly.com/v3/user/info \
--oauth2-response-path=data.login
```