{"action":"created","issue":{"url":"https://api.github.com/repos/lukasmartinelli/nigit/issues/1","labels_url":"https://api.github.com/repos/lukasmartinelli/nigit/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/lukasmartinelli/nigit/issues/1/comments","events_url":"https://api.github.com/repos/lukasmartinelli/nigit/issues/1/events","html_url":"https://github.com/lukasmartinelli/nigit/pull/1","id":125734016,"number":1,"title":"Authentication and https","user":{"login":"pdxjohnny","id":5950433,"avatar_url":"https://avatars.githubusercontent.com/u/5950433?v=3","gravatar_id":"","url":"https://api.github.com/users/pdxjohnny","html_url":"https://github.com/pdxjohnny","followers_url":"https://api.github.com/users/pdxjohnny/followers","following_url":"https://api.github.com/users/pdxjohnny/following{/other_user}","gists_url":"https://api.github.com/users/pdxjohnny/gists{/gist_id}","starred_url":"https://api.github.com/users/pdxjohnny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdxjohnny/subscriptions","organizations_url":"https://api.github.com/users/pdxjohnny/orgs","repos_url":"https://api.github.com/users/pdxjohnny/repos","events_url":"https://api.github.com/users/pdxjohnny/events{/privacy}","received_events_url":"https://api.github.com/users/pdxjohnny/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-09T03:19:41Z","updated_at":"2016-01-09T16:42:30Z","closed_at":"2016-01-09T10:39:21Z","pull_request":{"url":"https://api.github.com/repos/lukasmartinelli/nigit/pulls/1","html_url":"https://github.com/lukasmartinelli/nigit/pull/1","diff_url":"https://github.com/lukasmartinelli/nigit/pull/1.diff","patch_url":"https://github.com/lukasmartinelli/nigit/pull/1.patch"},"body":"I added some access control.\r\n\r\n\r\n`nigit` has authorization middleware which allows you to call an executable\r\nto approve requests. The Authorization http header gets passed as the AUTH\r\nenv variable.\r\n\r\n\r\n```bash\r\n./nigit --auth ./auth.py ./echo.sh\r\n```\r\n\r\nExample auth.sh\r\n```bash\r\n#!/bin/bash\r\necho $AUTH\r\nexit $AUTH\r\n```\r\n\r\nIf it exits non-zero then the client with receive a http.Unauthorized and the\r\nstdout of auth.sh will be printed to nigit stdout.\r\n\r\n```bash\r\ncurl -H \"Authorization: 1\" http://localhost:8000/echo?say=hi\r\n```\r\n> Output: {\"Error\":\"Unauthorized\"}\r\n\r\n```bash\r\ncurl -H \"Authorization: 0\" http://localhost:8000/echo?say=hi\r\n```\r\n> Output: hi\r\n\r\nSigned-off-by: John Andersen <johnandersenpdx@gmail.com>"},"comment":{"url":"https://api.github.com/repos/lukasmartinelli/nigit/issues/comments/170258738","html_url":"https://github.com/lukasmartinelli/nigit/pull/1#issuecomment-170258738","issue_url":"https://api.github.com/repos/lukasmartinelli/nigit/issues/1","id":170258738,"user":{"login":"pdxjohnny","id":5950433,"avatar_url":"https://avatars.githubusercontent.com/u/5950433?v=3","gravatar_id":"","url":"https://api.github.com/users/pdxjohnny","html_url":"https://github.com/pdxjohnny","followers_url":"https://api.github.com/users/pdxjohnny/followers","following_url":"https://api.github.com/users/pdxjohnny/following{/other_user}","gists_url":"https://api.github.com/users/pdxjohnny/gists{/gist_id}","starred_url":"https://api.github.com/users/pdxjohnny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdxjohnny/subscriptions","organizations_url":"https://api.github.com/users/pdxjohnny/orgs","repos_url":"https://api.github.com/users/pdxjohnny/repos","events_url":"https://api.github.com/users/pdxjohnny/events{/privacy}","received_events_url":"https://api.github.com/users/pdxjohnny/received_events","type":"User","site_admin":false},"created_at":"2016-01-09T16:42:30Z","updated_at":"2016-01-09T16:42:30Z","body":"Sweet! Thanks man!\nOn Jan 9, 2016 2:46 AM, \"Lukas Martinelli\" <notifications@github.com> wrote:\n\n> Rhanks alot @pdxjohnny <https://github.com/pdxjohnny>. I created a new\n> release including your changes.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/lukasmartinelli/nigit/pull/1#issuecomment-170224925>.\n>\n"}}