{"action":"created","comment":{"url":"https://api.github.com/repos/scitran/api/pulls/comments/35017031","id":35017031,"diff_hunk":"@@ -24,85 +28,96 @@ ap.add_argument('--api_uri', help='api uri, with https:// prefix')\n ap.add_argument('--site_id', help='site ID for Scitran Central [local]', default='local')\n ap.add_argument('--site_name', help='site name', nargs='*', default=['Local'])  # hack for uwsgi --pyargv\n ap.add_argument('--oauth2_id_endpoint', help='OAuth2 provider ID endpoint', default='https://www.googleapis.com/plus/v1/people/me/openIdConnect')\n-ap.add_argument('--demo', help='enable automatic user creation', action='store_true', default=False)\n ap.add_argument('--insecure', help='allow user info as urlencoded param', action='store_true', default=False)\n ap.add_argument('--central_uri', help='scitran central api', default='https://sdmc.scitran.io/api')\n ap.add_argument('--log_level', help='log level [info]', default='info')\n+ap.add_argument('--drone_secret', help='shared drone secret')\n+\n+if __name__ == '__main__':\n+    import paste.httpserver\n+    logging.getLogger('paste.httpserver').setLevel(logging.WARNING) # silence paste logging\n+\n+    ap.add_argument('--host', default='127.0.0.1', help='IP address to bind to [127.0.0.1]')\n+    ap.add_argument('--port', default='8080', help='TCP port to listen on [8080]')","path":"api.wsgi","position":48,"original_position":48,"commit_id":"023f78ad8bc220317be2af30138d1c3851545dc4","original_commit_id":"b5b5bf507a9b5c8b91ae3e09699f294c3493e797","user":{"login":"gsfr","id":712594,"avatar_url":"https://avatars.githubusercontent.com/u/712594?v=3","gravatar_id":"","url":"https://api.github.com/users/gsfr","html_url":"https://github.com/gsfr","followers_url":"https://api.github.com/users/gsfr/followers","following_url":"https://api.github.com/users/gsfr/following{/other_user}","gists_url":"https://api.github.com/users/gsfr/gists{/gist_id}","starred_url":"https://api.github.com/users/gsfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsfr/subscriptions","organizations_url":"https://api.github.com/users/gsfr/orgs","repos_url":"https://api.github.com/users/gsfr/repos","events_url":"https://api.github.com/users/gsfr/events{/privacy}","received_events_url":"https://api.github.com/users/gsfr/received_events","type":"User","site_admin":false},"body":"Yup.","created_at":"2015-07-20T16:56:47Z","updated_at":"2015-07-20T16:56:47Z","html_url":"https://github.com/scitran/api/pull/26#discussion_r35017031","pull_request_url":"https://api.github.com/repos/scitran/api/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/scitran/api/pulls/comments/35017031"},"html":{"href":"https://github.com/scitran/api/pull/26#discussion_r35017031"},"pull_request":{"href":"https://api.github.com/repos/scitran/api/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/scitran/api/pulls/26","id":40250712,"html_url":"https://github.com/scitran/api/pull/26","diff_url":"https://github.com/scitran/api/pull/26.diff","patch_url":"https://github.com/scitran/api/pull/26.patch","issue_url":"https://api.github.com/repos/scitran/api/issues/26","number":26,"state":"open","locked":false,"title":"Discussion: Auth changes","user":{"login":"kofalt","id":265071,"avatar_url":"https://avatars.githubusercontent.com/u/265071?v=3","gravatar_id":"","url":"https://api.github.com/users/kofalt","html_url":"https://github.com/kofalt","followers_url":"https://api.github.com/users/kofalt/followers","following_url":"https://api.github.com/users/kofalt/following{/other_user}","gists_url":"https://api.github.com/users/kofalt/gists{/gist_id}","starred_url":"https://api.github.com/users/kofalt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kofalt/subscriptions","organizations_url":"https://api.github.com/users/kofalt/orgs","repos_url":"https://api.github.com/users/kofalt/repos","events_url":"https://api.github.com/users/kofalt/events{/privacy}","received_events_url":"https://api.github.com/users/kofalt/received_events","type":"User","site_admin":false},"body":"From our notes regarding placeholder device authentication:\r\n\r\n* Eliminating the drone port, rootCA keys, and drone keys.\r\n* Automated authorization will be via a single shared secret stored in config.toml.\r\n* Automated calls must set their user agent header to 'SciTran Drone NAME', where NAME can be anything (possibly ‘reaper’ or ‘engine’).\r\n* Automated calls must send the shared secret in the X-SciTran-Auth header.\r\n* Drone listing in the database will be completely ignored and have no effect.\r\n* All drones will operate at the same permission level and have the same capabilities.\r\n\r\nThis adds the ability to authenticate with a shared secret via the above spec.\r\n\r\nDoes not use constant-time string compare and is thus vulnerable to [timing attacks](https://en.wikipedia.org/wiki/Timing_attack).\r\n\r\nRequires scitran/scitran#40.","created_at":"2015-07-17T16:58:12Z","updated_at":"2015-07-20T16:56:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8dceb0ef4f617fb57a90b26a601729a98d7cd416","assignee":{"login":"gsfr","id":712594,"avatar_url":"https://avatars.githubusercontent.com/u/712594?v=3","gravatar_id":"","url":"https://api.github.com/users/gsfr","html_url":"https://github.com/gsfr","followers_url":"https://api.github.com/users/gsfr/followers","following_url":"https://api.github.com/users/gsfr/following{/other_user}","gists_url":"https://api.github.com/users/gsfr/gists{/gist_id}","starred_url":"https://api.github.com/users/gsfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsfr/subscriptions","organizations_url":"https://api.github.com/users/gsfr/orgs","repos_url":"https://api.github.com/users/gsfr/repos","events_url":"https://api.github.com/users/gsfr/events{/privacy}","received_events_url":"https://api.github.com/users/gsfr/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/scitran/api/pulls/26/commits","review_comments_url":"https://api.github.com/repos/scitran/api/pulls/26/comments","review_comment_url":"https://api.github.com/repos/scitran/api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scitran/api/issues/26/comments","statuses_url":"https://api.github.com/repos/scitran/api/statuses/023f78ad8bc220317be2af30138d1c3851545dc4","head":{"label":"scitran:auth-changes","ref":"auth-changes","sha":"023f78ad8bc220317be2af30138d1c3851545dc4","user":{"login":"scitran","id":7379762,"avatar_url":"https://avatars.githubusercontent.com/u/7379762?v=3","gravatar_id":"","url":"https://api.github.com/users/scitran","html_url":"https://github.com/scitran","followers_url":"https://api.github.com/users/scitran/followers","following_url":"https://api.github.com/users/scitran/following{/other_user}","gists_url":"https://api.github.com/users/scitran/gists{/gist_id}","starred_url":"https://api.github.com/users/scitran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scitran/subscriptions","organizations_url":"https://api.github.com/users/scitran/orgs","repos_url":"https://api.github.com/users/scitran/repos","events_url":"https://api.github.com/users/scitran/events{/privacy}","received_events_url":"https://api.github.com/users/scitran/received_events","type":"Organization","site_admin":false},"repo":{"id":16557832,"name":"api","full_name":"scitran/api","owner":{"login":"scitran","id":7379762,"avatar_url":"https://avatars.githubusercontent.com/u/7379762?v=3","gravatar_id":"","url":"https://api.github.com/users/scitran","html_url":"https://github.com/scitran","followers_url":"https://api.github.com/users/scitran/followers","following_url":"https://api.github.com/users/scitran/following{/other_user}","gists_url":"https://api.github.com/users/scitran/gists{/gist_id}","starred_url":"https://api.github.com/users/scitran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scitran/subscriptions","organizations_url":"https://api.github.com/users/scitran/orgs","repos_url":"https://api.github.com/users/scitran/repos","events_url":"https://api.github.com/users/scitran/events{/privacy}","received_events_url":"https://api.github.com/users/scitran/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scitran/api","description":"RESTful API","fork":false,"url":"https://api.github.com/repos/scitran/api","forks_url":"https://api.github.com/repos/scitran/api/forks","keys_url":"https://api.github.com/repos/scitran/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scitran/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scitran/api/teams","hooks_url":"https://api.github.com/repos/scitran/api/hooks","issue_events_url":"https://api.github.com/repos/scitran/api/issues/events{/number}","events_url":"https://api.github.com/repos/scitran/api/events","assignees_url":"https://api.github.com/repos/scitran/api/assignees{/user}","branches_url":"https://api.github.com/repos/scitran/api/branches{/branch}","tags_url":"https://api.github.com/repos/scitran/api/tags","blobs_url":"https://api.github.com/repos/scitran/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scitran/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scitran/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/scitran/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scitran/api/statuses/{sha}","languages_url":"https://api.github.com/repos/scitran/api/languages","stargazers_url":"https://api.github.com/repos/scitran/api/stargazers","contributors_url":"https://api.github.com/repos/scitran/api/contributors","subscribers_url":"https://api.github.com/repos/scitran/api/subscribers","subscription_url":"https://api.github.com/repos/scitran/api/subscription","commits_url":"https://api.github.com/repos/scitran/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/scitran/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/scitran/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/scitran/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/scitran/api/contents/{+path}","compare_url":"https://api.github.com/repos/scitran/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scitran/api/merges","archive_url":"https://api.github.com/repos/scitran/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scitran/api/downloads","issues_url":"https://api.github.com/repos/scitran/api/issues{/number}","pulls_url":"https://api.github.com/repos/scitran/api/pulls{/number}","milestones_url":"https://api.github.com/repos/scitran/api/milestones{/number}","notifications_url":"https://api.github.com/repos/scitran/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scitran/api/labels{/name}","releases_url":"https://api.github.com/repos/scitran/api/releases{/id}","created_at":"2014-02-05T20:48:50Z","updated_at":"2015-05-01T22:02:15Z","pushed_at":"2015-07-20T15:56:25Z","git_url":"git://github.com/scitran/api.git","ssh_url":"git@github.com:scitran/api.git","clone_url":"https://github.com/scitran/api.git","svn_url":"https://github.com/scitran/api","homepage":"","size":1329,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":3,"default_branch":"master"}},"base":{"label":"scitran:master","ref":"master","sha":"c38e41f265118fb3c09a51040d6e7bd6b8b7cc30","user":{"login":"scitran","id":7379762,"avatar_url":"https://avatars.githubusercontent.com/u/7379762?v=3","gravatar_id":"","url":"https://api.github.com/users/scitran","html_url":"https://github.com/scitran","followers_url":"https://api.github.com/users/scitran/followers","following_url":"https://api.github.com/users/scitran/following{/other_user}","gists_url":"https://api.github.com/users/scitran/gists{/gist_id}","starred_url":"https://api.github.com/users/scitran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scitran/subscriptions","organizations_url":"https://api.github.com/users/scitran/orgs","repos_url":"https://api.github.com/users/scitran/repos","events_url":"https://api.github.com/users/scitran/events{/privacy}","received_events_url":"https://api.github.com/users/scitran/received_events","type":"Organization","site_admin":false},"repo":{"id":16557832,"name":"api","full_name":"scitran/api","owner":{"login":"scitran","id":7379762,"avatar_url":"https://avatars.githubusercontent.com/u/7379762?v=3","gravatar_id":"","url":"https://api.github.com/users/scitran","html_url":"https://github.com/scitran","followers_url":"https://api.github.com/users/scitran/followers","following_url":"https://api.github.com/users/scitran/following{/other_user}","gists_url":"https://api.github.com/users/scitran/gists{/gist_id}","starred_url":"https://api.github.com/users/scitran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scitran/subscriptions","organizations_url":"https://api.github.com/users/scitran/orgs","repos_url":"https://api.github.com/users/scitran/repos","events_url":"https://api.github.com/users/scitran/events{/privacy}","received_events_url":"https://api.github.com/users/scitran/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scitran/api","description":"RESTful API","fork":false,"url":"https://api.github.com/repos/scitran/api","forks_url":"https://api.github.com/repos/scitran/api/forks","keys_url":"https://api.github.com/repos/scitran/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scitran/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scitran/api/teams","hooks_url":"https://api.github.com/repos/scitran/api/hooks","issue_events_url":"https://api.github.com/repos/scitran/api/issues/events{/number}","events_url":"https://api.github.com/repos/scitran/api/events","assignees_url":"https://api.github.com/repos/scitran/api/assignees{/user}","branches_url":"https://api.github.com/repos/scitran/api/branches{/branch}","tags_url":"https://api.github.com/repos/scitran/api/tags","blobs_url":"https://api.github.com/repos/scitran/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scitran/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scitran/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/scitran/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scitran/api/statuses/{sha}","languages_url":"https://api.github.com/repos/scitran/api/languages","stargazers_url":"https://api.github.com/repos/scitran/api/stargazers","contributors_url":"https://api.github.com/repos/scitran/api/contributors","subscribers_url":"https://api.github.com/repos/scitran/api/subscribers","subscription_url":"https://api.github.com/repos/scitran/api/subscription","commits_url":"https://api.github.com/repos/scitran/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/scitran/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/scitran/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/scitran/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/scitran/api/contents/{+path}","compare_url":"https://api.github.com/repos/scitran/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scitran/api/merges","archive_url":"https://api.github.com/repos/scitran/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scitran/api/downloads","issues_url":"https://api.github.com/repos/scitran/api/issues{/number}","pulls_url":"https://api.github.com/repos/scitran/api/pulls{/number}","milestones_url":"https://api.github.com/repos/scitran/api/milestones{/number}","notifications_url":"https://api.github.com/repos/scitran/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scitran/api/labels{/name}","releases_url":"https://api.github.com/repos/scitran/api/releases{/id}","created_at":"2014-02-05T20:48:50Z","updated_at":"2015-05-01T22:02:15Z","pushed_at":"2015-07-20T15:56:25Z","git_url":"git://github.com/scitran/api.git","ssh_url":"git@github.com:scitran/api.git","clone_url":"https://github.com/scitran/api.git","svn_url":"https://github.com/scitran/api","homepage":"","size":1329,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scitran/api/pulls/26"},"html":{"href":"https://github.com/scitran/api/pull/26"},"issue":{"href":"https://api.github.com/repos/scitran/api/issues/26"},"comments":{"href":"https://api.github.com/repos/scitran/api/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/scitran/api/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/scitran/api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scitran/api/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/scitran/api/statuses/023f78ad8bc220317be2af30138d1c3851545dc4"}}}}