From 4f9376f2373f9377a2522df4d51fb4be3d139388 Mon Sep 17 00:00:00 2001 From: Dudley Carr Date: Sat, 20 Sep 2014 15:17:36 -0700 Subject: [PATCH] Update README * Correct CSV format * Add additional details to working with the default Bitly OAuth API. --- README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 028e49d..7efc632 100644 --- a/README.md +++ b/README.md @@ -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 +johndoe,127.0.0.1,true,test_topic,test_channnel,subscribe, ``` Typical usage will be like this: @@ -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 +,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 +```