{"action":"created","comment":{"url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/comments/214118118","pull_request_review_id":151089716,"id":214118118,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDExODExOA==","diff_hunk":"@@ -470,6 +554,7 @@ def callback():\n @app.route('/logout')\n @login_required\n def logout():\n+    User().logout()","path":"app.py","position":359,"original_position":359,"commit_id":"82125c3e4b0164236aa16d2d8a388049a8b156c1","original_commit_id":"82125c3e4b0164236aa16d2d8a388049a8b156c1","user":{"login":"coverbeck","id":1049340,"node_id":"MDQ6VXNlcjEwNDkzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1049340?v=4","gravatar_id":"","url":"https://api.github.com/users/coverbeck","html_url":"https://github.com/coverbeck","followers_url":"https://api.github.com/users/coverbeck/followers","following_url":"https://api.github.com/users/coverbeck/following{/other_user}","gists_url":"https://api.github.com/users/coverbeck/gists{/gist_id}","starred_url":"https://api.github.com/users/coverbeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coverbeck/subscriptions","organizations_url":"https://api.github.com/users/coverbeck/orgs","repos_url":"https://api.github.com/users/coverbeck/repos","events_url":"https://api.github.com/users/coverbeck/events{/privacy}","received_events_url":"https://api.github.com/users/coverbeck/received_events","type":"User","site_admin":false},"body":"Can you not use current_user here? It has the `@login_required` annotation.","created_at":"2018-08-30T17:35:52Z","updated_at":"2018-08-30T17:38:23Z","html_url":"https://github.com/DataBiosphere/cgp-dashboard/pull/58#discussion_r214118118","pull_request_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/58","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/comments/214118118"},"html":{"href":"https://github.com/DataBiosphere/cgp-dashboard/pull/58#discussion_r214118118"},"pull_request":{"href":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/58","id":212029514,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyMDI5NTE0","html_url":"https://github.com/DataBiosphere/cgp-dashboard/pull/58","diff_url":"https://github.com/DataBiosphere/cgp-dashboard/pull/58.diff","patch_url":"https://github.com/DataBiosphere/cgp-dashboard/pull/58.patch","issue_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues/58","number":58,"state":"open","locked":false,"title":"Add support for whitelist (resolves #10, #53)","user":{"login":"jessebrennan","id":10734740,"node_id":"MDQ6VXNlcjEwNzM0NzQw","avatar_url":"https://avatars1.githubusercontent.com/u/10734740?v=4","gravatar_id":"","url":"https://api.github.com/users/jessebrennan","html_url":"https://github.com/jessebrennan","followers_url":"https://api.github.com/users/jessebrennan/followers","following_url":"https://api.github.com/users/jessebrennan/following{/other_user}","gists_url":"https://api.github.com/users/jessebrennan/gists{/gist_id}","starred_url":"https://api.github.com/users/jessebrennan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessebrennan/subscriptions","organizations_url":"https://api.github.com/users/jessebrennan/orgs","repos_url":"https://api.github.com/users/jessebrennan/repos","events_url":"https://api.github.com/users/jessebrennan/events{/privacy}","received_events_url":"https://api.github.com/users/jessebrennan/received_events","type":"User","site_admin":false},"body":"This adds whitelist support for the dashboard.\r\n\r\n**Note**: This depends on a https://github.com/DataBiosphere/cgp-deployment/pull/59\r\n\r\nThere are several sets of changes in this PR that got it to this stage.\r\n\r\n1. First the database dependency was removed. Instead most of the important information that was previously there is now stored in the session cookie.\r\n\r\n   a. The username, name, and avatar (picture) are still stored here even though @coverbeck suggested I remove them. I reasoning for keeping them was that their used in the view and still necessary (at least the avatar is, it's used to show the picture once you're logged in). I kept them all for consistency but we can take away if deemed necessary.\r\n\r\n   b. The refresh token is now stored in the session cookie. It is encrypted. You gave a link for how to encrypt it, but I ended up taking a different path. I used AES encryption from the pycrypto library. This seems secure to me. My **only** security concern has to do with deployment. I'm not sure if by default the value from the previous deployment of is used again for the encryption key. My guess is that it's overwritten, in which case we're fine. But I haven't checked yet. Anyway if this *is* a vulnerability it would apply to any keys generated in deployment.\r\n\r\n2. Support for a whitelist using bouncer is added!\r\n\r\nOther stuff: \r\n- The weird and pointless get_logged_user code is removed\r\n- unused imports are removed\r\n- I had to require a more up to date version of urllib3 to avoid some weird errors from the default old version","created_at":"2018-08-30T10:24:58Z","updated_at":"2018-08-30T17:38:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"977d8bcb30fc8e6b029e0b72057532e2d040a56f","assignee":{"login":"jessebrennan","id":10734740,"node_id":"MDQ6VXNlcjEwNzM0NzQw","avatar_url":"https://avatars1.githubusercontent.com/u/10734740?v=4","gravatar_id":"","url":"https://api.github.com/users/jessebrennan","html_url":"https://github.com/jessebrennan","followers_url":"https://api.github.com/users/jessebrennan/followers","following_url":"https://api.github.com/users/jessebrennan/following{/other_user}","gists_url":"https://api.github.com/users/jessebrennan/gists{/gist_id}","starred_url":"https://api.github.com/users/jessebrennan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessebrennan/subscriptions","organizations_url":"https://api.github.com/users/jessebrennan/orgs","repos_url":"https://api.github.com/users/jessebrennan/repos","events_url":"https://api.github.com/users/jessebrennan/events{/privacy}","received_events_url":"https://api.github.com/users/jessebrennan/received_events","type":"User","site_admin":false},"assignees":[{"login":"jessebrennan","id":10734740,"node_id":"MDQ6VXNlcjEwNzM0NzQw","avatar_url":"https://avatars1.githubusercontent.com/u/10734740?v=4","gravatar_id":"","url":"https://api.github.com/users/jessebrennan","html_url":"https://github.com/jessebrennan","followers_url":"https://api.github.com/users/jessebrennan/followers","following_url":"https://api.github.com/users/jessebrennan/following{/other_user}","gists_url":"https://api.github.com/users/jessebrennan/gists{/gist_id}","starred_url":"https://api.github.com/users/jessebrennan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessebrennan/subscriptions","organizations_url":"https://api.github.com/users/jessebrennan/orgs","repos_url":"https://api.github.com/users/jessebrennan/repos","events_url":"https://api.github.com/users/jessebrennan/events{/privacy}","received_events_url":"https://api.github.com/users/jessebrennan/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":719156011,"node_id":"MDU6TGFiZWw3MTkxNTYwMTE=","url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/58/commits","review_comments_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/58/comments","review_comment_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues/58/comments","statuses_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/statuses/82125c3e4b0164236aa16d2d8a388049a8b156c1","head":{"label":"DataBiosphere:feature/DASH-4-auth","ref":"feature/DASH-4-auth","sha":"82125c3e4b0164236aa16d2d8a388049a8b156c1","user":{"login":"DataBiosphere","id":32805087,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODA1MDg3","avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":72685696,"node_id":"MDEwOlJlcG9zaXRvcnk3MjY4NTY5Ng==","name":"cgp-dashboard","full_name":"DataBiosphere/cgp-dashboard","owner":{"login":"DataBiosphere","id":32805087,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODA1MDg3","avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataBiosphere/cgp-dashboard","description":"The Core's web dashboard including a faceted file browser","fork":false,"url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard","forks_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/forks","keys_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/teams","hooks_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/hooks","issue_events_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/events","assignees_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/tags","blobs_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/languages","stargazers_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/stargazers","contributors_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/contributors","subscribers_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/subscribers","subscription_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/subscription","commits_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/merges","archive_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/downloads","issues_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/releases{/id}","deployments_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/deployments","created_at":"2016-11-02T22:10:23Z","updated_at":"2018-07-09T16:21:29Z","pushed_at":"2018-08-30T10:24:59Z","git_url":"git://github.com/DataBiosphere/cgp-dashboard.git","ssh_url":"git@github.com:DataBiosphere/cgp-dashboard.git","clone_url":"https://github.com/DataBiosphere/cgp-dashboard.git","svn_url":"https://github.com/DataBiosphere/cgp-dashboard","homepage":null,"size":3290,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":5,"open_issues":21,"watchers":1,"default_branch":"develop"}},"base":{"label":"DataBiosphere:feature/commons","ref":"feature/commons","sha":"f06b421bc1bbd59c1a395a3c0d93613e16d0715f","user":{"login":"DataBiosphere","id":32805087,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODA1MDg3","avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":72685696,"node_id":"MDEwOlJlcG9zaXRvcnk3MjY4NTY5Ng==","name":"cgp-dashboard","full_name":"DataBiosphere/cgp-dashboard","owner":{"login":"DataBiosphere","id":32805087,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODA1MDg3","avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataBiosphere/cgp-dashboard","description":"The Core's web dashboard including a faceted file browser","fork":false,"url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard","forks_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/forks","keys_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/teams","hooks_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/hooks","issue_events_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/events","assignees_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/tags","blobs_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/languages","stargazers_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/stargazers","contributors_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/contributors","subscribers_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/subscribers","subscription_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/subscription","commits_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/merges","archive_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/downloads","issues_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/releases{/id}","deployments_url":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/deployments","created_at":"2016-11-02T22:10:23Z","updated_at":"2018-07-09T16:21:29Z","pushed_at":"2018-08-30T10:24:59Z","git_url":"git://github.com/DataBiosphere/cgp-dashboard.git","ssh_url":"git@github.com:DataBiosphere/cgp-dashboard.git","clone_url":"https://github.com/DataBiosphere/cgp-dashboard.git","svn_url":"https://github.com/DataBiosphere/cgp-dashboard","homepage":null,"size":3290,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":5,"open_issues":21,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/58"},"html":{"href":"https://github.com/DataBiosphere/cgp-dashboard/pull/58"},"issue":{"href":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues/58"},"comments":{"href":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/DataBiosphere/cgp-dashboard/statuses/82125c3e4b0164236aa16d2d8a388049a8b156c1"}},"author_association":"NONE"}}
{"actor":{"display_login":"coverbeck"}}