{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/formplayer/pulls/comments/198476387","pull_request_review_id":132411807,"id":198476387,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODQ3NjM4Nw==","diff_hunk":"@@ -96,16 +96,15 @@ public void closeRestoreFactory(JoinPoint joinPoint) throws Throwable {\n         restoreFactory.getSQLiteDB().closeConnection();\n     }\n \n-    private HqAuth getAuthHeaders(String domain, String username, String sessionToken) {\n-        HqAuth auth;\n-        if (sessionToken != null && sessionToken.equals(authKey)) {\n-            auth = new BasicAuth(touchformsUsername, touchformsPassword);\n-        } else if (UserUtils.isAnonymous(domain, username)) {\n+    private HqAuth getHqAuth(String domain, String username, String sessionToken) {\n+        HqAuth auth = null;\n+        if (UserUtils.isAnonymous(domain, username)) {\n             PostgresUser postgresUser = postgresUserRepo.getUserByUsername(username);\n             auth = new TokenAuth(postgresUser.getAuthToken());\n-        } else {\n+        } else if (sessionToken != null) {\n             auth = new DjangoAuth(sessionToken);\n         }\n+        // Null auth expected for SMS requests","path":"src/main/java/aspects/UserRestoreAspect.java","position":null,"original_position":41,"commit_id":"dffaabbf49a402153387f9fd70bfe9f7a365e5b2","original_commit_id":"fdc9845eea9ced51602cfeba508a6c590bda0f90","user":{"login":"wpride","id":2293064,"node_id":"MDQ6VXNlcjIyOTMwNjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2293064?v=4","gravatar_id":"","url":"https://api.github.com/users/wpride","html_url":"https://github.com/wpride","followers_url":"https://api.github.com/users/wpride/followers","following_url":"https://api.github.com/users/wpride/following{/other_user}","gists_url":"https://api.github.com/users/wpride/gists{/gist_id}","starred_url":"https://api.github.com/users/wpride/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpride/subscriptions","organizations_url":"https://api.github.com/users/wpride/orgs","repos_url":"https://api.github.com/users/wpride/repos","events_url":"https://api.github.com/users/wpride/events{/privacy}","received_events_url":"https://api.github.com/users/wpride/received_events","type":"User","site_admin":false},"body":"That happens here https://github.com/dimagi/formplayer/blob/2fde9891f8bc8ea047c140447ffaff7d57740a8a/src/main/java/application/FormplayerAuthFilter.java#L56-L56","created_at":"2018-06-27T12:34:20Z","updated_at":"2018-06-27T12:34:21Z","html_url":"https://github.com/dimagi/formplayer/pull/661#discussion_r198476387","pull_request_url":"https://api.github.com/repos/dimagi/formplayer/pulls/661","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dimagi/formplayer/pulls/comments/198476387"},"html":{"href":"https://github.com/dimagi/formplayer/pull/661#discussion_r198476387"},"pull_request":{"href":"https://api.github.com/repos/dimagi/formplayer/pulls/661"}},"in_reply_to_id":198447318},"pull_request":{"url":"https://api.github.com/repos/dimagi/formplayer/pulls/661","id":196918891,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2OTE4ODkx","html_url":"https://github.com/dimagi/formplayer/pull/661","diff_url":"https://github.com/dimagi/formplayer/pull/661.diff","patch_url":"https://github.com/dimagi/formplayer/pull/661.patch","issue_url":"https://api.github.com/repos/dimagi/formplayer/issues/661","number":661,"state":"open","locked":false,"title":"Add HMAC auth to case restores","user":{"login":"wpride","id":2293064,"node_id":"MDQ6VXNlcjIyOTMwNjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2293064?v=4","gravatar_id":"","url":"https://api.github.com/users/wpride","html_url":"https://github.com/wpride","followers_url":"https://api.github.com/users/wpride/followers","following_url":"https://api.github.com/users/wpride/following{/other_user}","gists_url":"https://api.github.com/users/wpride/gists{/gist_id}","starred_url":"https://api.github.com/users/wpride/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpride/subscriptions","organizations_url":"https://api.github.com/users/wpride/orgs","repos_url":"https://api.github.com/users/wpride/repos","events_url":"https://api.github.com/users/wpride/events{/privacy}","received_events_url":"https://api.github.com/users/wpride/received_events","type":"User","site_admin":false},"body":"@gcapalbo @snopoke ","created_at":"2018-06-23T20:17:26Z","updated_at":"2018-06-27T12:34:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"beddc0b0bb3a5b1a0208d8170dfcbaf276078f52","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":728695938,"node_id":"MDU6TGFiZWw3Mjg2OTU5Mzg=","url":"https://api.github.com/repos/dimagi/formplayer/labels/product/invisible","name":"product/invisible","color":"cfd2d6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/formplayer/pulls/661/commits","review_comments_url":"https://api.github.com/repos/dimagi/formplayer/pulls/661/comments","review_comment_url":"https://api.github.com/repos/dimagi/formplayer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/formplayer/issues/661/comments","statuses_url":"https://api.github.com/repos/dimagi/formplayer/statuses/dffaabbf49a402153387f9fd70bfe9f7a365e5b2","head":{"label":"dimagi:hmac-restore-auth","ref":"hmac-restore-auth","sha":"dffaabbf49a402153387f9fd70bfe9f7a365e5b2","user":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":49518941,"node_id":"MDEwOlJlcG9zaXRvcnk0OTUxODk0MQ==","name":"formplayer","full_name":"dimagi/formplayer","owner":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/formplayer","description":null,"fork":false,"url":"https://api.github.com/repos/dimagi/formplayer","forks_url":"https://api.github.com/repos/dimagi/formplayer/forks","keys_url":"https://api.github.com/repos/dimagi/formplayer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/formplayer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/formplayer/teams","hooks_url":"https://api.github.com/repos/dimagi/formplayer/hooks","issue_events_url":"https://api.github.com/repos/dimagi/formplayer/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/formplayer/events","assignees_url":"https://api.github.com/repos/dimagi/formplayer/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/formplayer/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/formplayer/tags","blobs_url":"https://api.github.com/repos/dimagi/formplayer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/formplayer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/formplayer/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/formplayer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/formplayer/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/formplayer/languages","stargazers_url":"https://api.github.com/repos/dimagi/formplayer/stargazers","contributors_url":"https://api.github.com/repos/dimagi/formplayer/contributors","subscribers_url":"https://api.github.com/repos/dimagi/formplayer/subscribers","subscription_url":"https://api.github.com/repos/dimagi/formplayer/subscription","commits_url":"https://api.github.com/repos/dimagi/formplayer/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/formplayer/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/formplayer/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/formplayer/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/formplayer/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/formplayer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/formplayer/merges","archive_url":"https://api.github.com/repos/dimagi/formplayer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/formplayer/downloads","issues_url":"https://api.github.com/repos/dimagi/formplayer/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/formplayer/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/formplayer/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/formplayer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/formplayer/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/formplayer/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/formplayer/deployments","created_at":"2016-01-12T18:04:32Z","updated_at":"2018-06-27T12:03:36Z","pushed_at":"2018-06-27T12:16:32Z","git_url":"git://github.com/dimagi/formplayer.git","ssh_url":"git@github.com:dimagi/formplayer.git","clone_url":"https://github.com/dimagi/formplayer.git","svn_url":"https://github.com/dimagi/formplayer","homepage":null,"size":161144,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":18,"license":null,"forks":3,"open_issues":18,"watchers":1,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"3d54fe0c7a8000a3808cd22b9e85be0a0a3d0a91","user":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":49518941,"node_id":"MDEwOlJlcG9zaXRvcnk0OTUxODk0MQ==","name":"formplayer","full_name":"dimagi/formplayer","owner":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/formplayer","description":null,"fork":false,"url":"https://api.github.com/repos/dimagi/formplayer","forks_url":"https://api.github.com/repos/dimagi/formplayer/forks","keys_url":"https://api.github.com/repos/dimagi/formplayer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/formplayer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/formplayer/teams","hooks_url":"https://api.github.com/repos/dimagi/formplayer/hooks","issue_events_url":"https://api.github.com/repos/dimagi/formplayer/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/formplayer/events","assignees_url":"https://api.github.com/repos/dimagi/formplayer/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/formplayer/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/formplayer/tags","blobs_url":"https://api.github.com/repos/dimagi/formplayer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/formplayer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/formplayer/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/formplayer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/formplayer/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/formplayer/languages","stargazers_url":"https://api.github.com/repos/dimagi/formplayer/stargazers","contributors_url":"https://api.github.com/repos/dimagi/formplayer/contributors","subscribers_url":"https://api.github.com/repos/dimagi/formplayer/subscribers","subscription_url":"https://api.github.com/repos/dimagi/formplayer/subscription","commits_url":"https://api.github.com/repos/dimagi/formplayer/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/formplayer/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/formplayer/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/formplayer/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/formplayer/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/formplayer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/formplayer/merges","archive_url":"https://api.github.com/repos/dimagi/formplayer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/formplayer/downloads","issues_url":"https://api.github.com/repos/dimagi/formplayer/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/formplayer/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/formplayer/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/formplayer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/formplayer/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/formplayer/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/formplayer/deployments","created_at":"2016-01-12T18:04:32Z","updated_at":"2018-06-27T12:03:36Z","pushed_at":"2018-06-27T12:16:32Z","git_url":"git://github.com/dimagi/formplayer.git","ssh_url":"git@github.com:dimagi/formplayer.git","clone_url":"https://github.com/dimagi/formplayer.git","svn_url":"https://github.com/dimagi/formplayer","homepage":null,"size":161144,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":18,"license":null,"forks":3,"open_issues":18,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/formplayer/pulls/661"},"html":{"href":"https://github.com/dimagi/formplayer/pull/661"},"issue":{"href":"https://api.github.com/repos/dimagi/formplayer/issues/661"},"comments":{"href":"https://api.github.com/repos/dimagi/formplayer/issues/661/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/formplayer/pulls/661/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/formplayer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/formplayer/pulls/661/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/formplayer/statuses/dffaabbf49a402153387f9fd70bfe9f7a365e5b2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"wpride"}}