{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/helios/pulls/comments/40601607","id":40601607,"diff_hunk":"@@ -311,7 +410,7 @@ func (storage *RedisStorage) SetExpirableKey(key string, value []byte, expireInS\n }\n \n func (storage *RedisStorage) DeleteKey(key string) error {\n-\tpool, err := storage.getPoolForRead()\n+\tpool, err := storage.getPoolForWrite()","path":"storage/redis_storage.go","position":200,"original_position":197,"commit_id":"db10a57701080fe546e7f52851e08867fc1a02fe","original_commit_id":"3a4a55fc055dcd0fa5de4dda9b1ead009493b4ad","user":{"login":"ArturKlajnerok","id":1889095,"avatar_url":"https://avatars.githubusercontent.com/u/1889095?v=3","gravatar_id":"","url":"https://api.github.com/users/ArturKlajnerok","html_url":"https://github.com/ArturKlajnerok","followers_url":"https://api.github.com/users/ArturKlajnerok/followers","following_url":"https://api.github.com/users/ArturKlajnerok/following{/other_user}","gists_url":"https://api.github.com/users/ArturKlajnerok/gists{/gist_id}","starred_url":"https://api.github.com/users/ArturKlajnerok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArturKlajnerok/subscriptions","organizations_url":"https://api.github.com/users/ArturKlajnerok/orgs","repos_url":"https://api.github.com/users/ArturKlajnerok/repos","events_url":"https://api.github.com/users/ArturKlajnerok/events{/privacy}","received_events_url":"https://api.github.com/users/ArturKlajnerok/received_events","type":"User","site_admin":false},"body":"`read operations on the read pool and write operations on the write pool` this is correct, and delete also should be done on `getPoolForWrite()` so this is a good catch. As far I remember  @jcellary  introduced that to have a possibility to switch to slave when master if master is down with `forceUseSlave` config flag. But for now both methods are using master instance, I think we should change that and serve all reads from slave.","created_at":"2015-09-28T20:32:35Z","updated_at":"2015-09-28T20:32:35Z","html_url":"https://github.com/Wikia/helios/pull/121#discussion_r40601607","pull_request_url":"https://api.github.com/repos/Wikia/helios/pulls/121","_links":{"self":{"href":"https://api.github.com/repos/Wikia/helios/pulls/comments/40601607"},"html":{"href":"https://github.com/Wikia/helios/pull/121#discussion_r40601607"},"pull_request":{"href":"https://api.github.com/repos/Wikia/helios/pulls/121"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/helios/pulls/121","id":46053697,"html_url":"https://github.com/Wikia/helios/pull/121","diff_url":"https://github.com/Wikia/helios/pull/121.diff","patch_url":"https://github.com/Wikia/helios/pull/121.patch","issue_url":"https://api.github.com/repos/Wikia/helios/issues/121","number":121,"state":"open","locked":false,"title":"Create an auth interface for purging all of a users access tokens","user":{"login":"drsnyder","id":21621,"avatar_url":"https://avatars.githubusercontent.com/u/21621?v=3","gravatar_id":"","url":"https://api.github.com/users/drsnyder","html_url":"https://github.com/drsnyder","followers_url":"https://api.github.com/users/drsnyder/followers","following_url":"https://api.github.com/users/drsnyder/following{/other_user}","gists_url":"https://api.github.com/users/drsnyder/gists{/gist_id}","starred_url":"https://api.github.com/users/drsnyder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drsnyder/subscriptions","organizations_url":"https://api.github.com/users/drsnyder/orgs","repos_url":"https://api.github.com/users/drsnyder/repos","events_url":"https://api.github.com/users/drsnyder/events{/privacy}","received_events_url":"https://api.github.com/users/drsnyder/received_events","type":"User","site_admin":false},"body":"This PR creates an `auth` interface with `PurgeAllUserAccessTokens` that when called should effectively log the user out of all of their sessions. This is accomplished by deleting their session token set and all of the keys associated with their tokens.\r\n\r\nAlong with this PR, I'm adding an interface to the redis storage implementation so that its functionality can be mocked in the auth service tests. With this interface we might want to also change the call signatures of some of the auth methods since they are currently accepting a concrete implementation of the redis client as a parameter. I'm going to capture that in another ticket.\r\n\r\nhttps://wikia-inc.atlassian.net/browse/SERVICES-826\r\n\r\nTODO\r\n* [x] integration tests for the new redis command\r\n* [x] fix the initialization of the auth service in the controllers","created_at":"2015-09-25T20:19:14Z","updated_at":"2015-09-28T20:32:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f46047917468bd53b51ef5e1b2abe7a4225e8a60","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/helios/pulls/121/commits","review_comments_url":"https://api.github.com/repos/Wikia/helios/pulls/121/comments","review_comment_url":"https://api.github.com/repos/Wikia/helios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/helios/issues/121/comments","statuses_url":"https://api.github.com/repos/Wikia/helios/statuses/db10a57701080fe546e7f52851e08867fc1a02fe","head":{"label":"Wikia:SERVICES-826","ref":"SERVICES-826","sha":"db10a57701080fe546e7f52851e08867fc1a02fe","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26176918,"name":"helios","full_name":"Wikia/helios","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/helios","description":"Provides user authentication and account creation","fork":false,"url":"https://api.github.com/repos/Wikia/helios","forks_url":"https://api.github.com/repos/Wikia/helios/forks","keys_url":"https://api.github.com/repos/Wikia/helios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/helios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/helios/teams","hooks_url":"https://api.github.com/repos/Wikia/helios/hooks","issue_events_url":"https://api.github.com/repos/Wikia/helios/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/helios/events","assignees_url":"https://api.github.com/repos/Wikia/helios/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/helios/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/helios/tags","blobs_url":"https://api.github.com/repos/Wikia/helios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/helios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/helios/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/helios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/helios/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/helios/languages","stargazers_url":"https://api.github.com/repos/Wikia/helios/stargazers","contributors_url":"https://api.github.com/repos/Wikia/helios/contributors","subscribers_url":"https://api.github.com/repos/Wikia/helios/subscribers","subscription_url":"https://api.github.com/repos/Wikia/helios/subscription","commits_url":"https://api.github.com/repos/Wikia/helios/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/helios/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/helios/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/helios/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/helios/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/helios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/helios/merges","archive_url":"https://api.github.com/repos/Wikia/helios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/helios/downloads","issues_url":"https://api.github.com/repos/Wikia/helios/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/helios/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/helios/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/helios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/helios/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/helios/releases{/id}","created_at":"2014-11-04T16:12:05Z","updated_at":"2015-09-04T22:49:33Z","pushed_at":"2015-09-28T18:24:30Z","git_url":"git://github.com/Wikia/helios.git","ssh_url":"git@github.com:Wikia/helios.git","clone_url":"https://github.com/Wikia/helios.git","svn_url":"https://github.com/Wikia/helios","homepage":"","size":3379,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":7,"default_branch":"master"}},"base":{"label":"Wikia:master","ref":"master","sha":"def584cb28cba05ce63c15c6d3ea69bcd7f8e81c","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26176918,"name":"helios","full_name":"Wikia/helios","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/helios","description":"Provides user authentication and account creation","fork":false,"url":"https://api.github.com/repos/Wikia/helios","forks_url":"https://api.github.com/repos/Wikia/helios/forks","keys_url":"https://api.github.com/repos/Wikia/helios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/helios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/helios/teams","hooks_url":"https://api.github.com/repos/Wikia/helios/hooks","issue_events_url":"https://api.github.com/repos/Wikia/helios/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/helios/events","assignees_url":"https://api.github.com/repos/Wikia/helios/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/helios/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/helios/tags","blobs_url":"https://api.github.com/repos/Wikia/helios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/helios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/helios/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/helios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/helios/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/helios/languages","stargazers_url":"https://api.github.com/repos/Wikia/helios/stargazers","contributors_url":"https://api.github.com/repos/Wikia/helios/contributors","subscribers_url":"https://api.github.com/repos/Wikia/helios/subscribers","subscription_url":"https://api.github.com/repos/Wikia/helios/subscription","commits_url":"https://api.github.com/repos/Wikia/helios/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/helios/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/helios/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/helios/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/helios/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/helios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/helios/merges","archive_url":"https://api.github.com/repos/Wikia/helios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/helios/downloads","issues_url":"https://api.github.com/repos/Wikia/helios/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/helios/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/helios/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/helios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/helios/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/helios/releases{/id}","created_at":"2014-11-04T16:12:05Z","updated_at":"2015-09-04T22:49:33Z","pushed_at":"2015-09-28T18:24:30Z","git_url":"git://github.com/Wikia/helios.git","ssh_url":"git@github.com:Wikia/helios.git","clone_url":"https://github.com/Wikia/helios.git","svn_url":"https://github.com/Wikia/helios","homepage":"","size":3379,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/helios/pulls/121"},"html":{"href":"https://github.com/Wikia/helios/pull/121"},"issue":{"href":"https://api.github.com/repos/Wikia/helios/issues/121"},"comments":{"href":"https://api.github.com/repos/Wikia/helios/issues/121/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/helios/pulls/121/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/helios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/helios/pulls/121/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/helios/statuses/db10a57701080fe546e7f52851e08867fc1a02fe"}}}}