{"action":"closed","number":190,"pull_request":{"url":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls/190","id":75726351,"html_url":"https://github.com/sourcegraph/sourcegraph/pull/190","diff_url":"https://github.com/sourcegraph/sourcegraph/pull/190.diff","patch_url":"https://github.com/sourcegraph/sourcegraph/pull/190.patch","issue_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/190","number":190,"state":"closed","locked":false,"title":"Grouped PR for email reset token changes and password brute-forcing changes ","user":{"login":"ggilmore","id":9022011,"avatar_url":"https://avatars.githubusercontent.com/u/9022011?v=3","gravatar_id":"","url":"https://api.github.com/users/ggilmore","html_url":"https://github.com/ggilmore","followers_url":"https://api.github.com/users/ggilmore/followers","following_url":"https://api.github.com/users/ggilmore/following{/other_user}","gists_url":"https://api.github.com/users/ggilmore/gists{/gist_id}","starred_url":"https://api.github.com/users/ggilmore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggilmore/subscriptions","organizations_url":"https://api.github.com/users/ggilmore/orgs","repos_url":"https://api.github.com/users/ggilmore/repos","events_url":"https://api.github.com/users/ggilmore/events{/privacy}","received_events_url":"https://api.github.com/users/ggilmore/received_events","type":"User","site_admin":false},"body":"New SQL: \r\n\r\nEmail Tokens\r\n```sql\r\nALTER TABLE password_reset_requests ADD COLUMN expires_at timestamp;\r\nUPDATE password_reset_requests SET expires_at = now() + '4 hours';\r\nALTER TABLE password_reset_requests ALTER COLUMN expires_at SET NOT NULL;\r\n```\r\n\r\nPassword Throttling\r\n```sql\r\nALTER TABLE passwords ADD COLUMN consecutive_fails int;\r\nALTER TABLE passwords ADD COLUMN last_fail timestamp;\r\nUPDATE passwords SET consecutive_fails = 0, last_fail = now();\r\nALTER TABLE passwords ALTER COLUMN last_fail SET NOT NULL;\r\nALTER TABLE passwords ALTER COLUMN consecutive_fails SET NOT NULL;\r\n```\r\n\r\nNew table for storing blacklisted session tokens\r\nNote: As this code change is the critical path it's being pushed separate from the ddl change\r\n          so it can be rolled back easily in the event of issues.\r\n\r\n```sql\r\n\r\n\r\n-- Session blacklist\r\nCREATE TABLE blacklisted_session_token\r\n(\r\n    uid integer NOT NULL,\r\n    token text NOT NULL,\r\n    blacklist_util timestamp NOT NULL\r\n)\r\nWITH (\r\n    OIDS = FALSE\r\n);\r\nALTER TABLE blacklisted_session_token OWNER TO sg;\r\n\r\n-- Index: blacklisted_session_token_idx\r\n\r\n-- DROP INDEX blacklisted_session_token_idx;\r\n\r\nCREATE INDEX blacklisted_session_token_idx\r\n    ON blacklisted_session_token USING btree\r\n    (uid DESC, token);\r\n\r\nCREATE INDEX blacklisted_session_blacklist_until_idx\r\n    ON blacklisted_session_token USING btree\r\n    (blacklist_util DESC NULLS LAST);\r\n\r\n\r\n```","created_at":"2016-06-29T21:39:01Z","updated_at":"2016-06-30T18:34:52Z","closed_at":"2016-06-30T18:34:52Z","merged_at":"2016-06-30T18:34:52Z","merge_commit_sha":"a846e8e46f5b0c8cb4b5a7b1f9007affd1bb699d","assignee":{"login":"sqs","id":1976,"avatar_url":"https://avatars.githubusercontent.com/u/1976?v=3","gravatar_id":"","url":"https://api.github.com/users/sqs","html_url":"https://github.com/sqs","followers_url":"https://api.github.com/users/sqs/followers","following_url":"https://api.github.com/users/sqs/following{/other_user}","gists_url":"https://api.github.com/users/sqs/gists{/gist_id}","starred_url":"https://api.github.com/users/sqs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqs/subscriptions","organizations_url":"https://api.github.com/users/sqs/orgs","repos_url":"https://api.github.com/users/sqs/repos","events_url":"https://api.github.com/users/sqs/events{/privacy}","received_events_url":"https://api.github.com/users/sqs/received_events","type":"User","site_admin":false},"assignees":[{"login":"sqs","id":1976,"avatar_url":"https://avatars.githubusercontent.com/u/1976?v=3","gravatar_id":"","url":"https://api.github.com/users/sqs","html_url":"https://github.com/sqs","followers_url":"https://api.github.com/users/sqs/followers","following_url":"https://api.github.com/users/sqs/following{/other_user}","gists_url":"https://api.github.com/users/sqs/gists{/gist_id}","starred_url":"https://api.github.com/users/sqs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqs/subscriptions","organizations_url":"https://api.github.com/users/sqs/orgs","repos_url":"https://api.github.com/users/sqs/repos","events_url":"https://api.github.com/users/sqs/events{/privacy}","received_events_url":"https://api.github.com/users/sqs/received_events","type":"User","site_admin":false},{"login":"samlavery","id":717772,"avatar_url":"https://avatars.githubusercontent.com/u/717772?v=3","gravatar_id":"","url":"https://api.github.com/users/samlavery","html_url":"https://github.com/samlavery","followers_url":"https://api.github.com/users/samlavery/followers","following_url":"https://api.github.com/users/samlavery/following{/other_user}","gists_url":"https://api.github.com/users/samlavery/gists{/gist_id}","starred_url":"https://api.github.com/users/samlavery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samlavery/subscriptions","organizations_url":"https://api.github.com/users/samlavery/orgs","repos_url":"https://api.github.com/users/samlavery/repos","events_url":"https://api.github.com/users/samlavery/events{/privacy}","received_events_url":"https://api.github.com/users/samlavery/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls/190/commits","review_comments_url":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls/190/comments","review_comment_url":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/190/comments","statuses_url":"https://api.github.com/repos/sourcegraph/sourcegraph/statuses/7245e986d487f52badb12222e4253ecbe6ef793b","head":{"label":"sourcegraph:schema-change","ref":"schema-change","sha":"7245e986d487f52badb12222e4253ecbe6ef793b","user":{"login":"sourcegraph","id":3979584,"avatar_url":"https://avatars.githubusercontent.com/u/3979584?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcegraph","html_url":"https://github.com/sourcegraph","followers_url":"https://api.github.com/users/sourcegraph/followers","following_url":"https://api.github.com/users/sourcegraph/following{/other_user}","gists_url":"https://api.github.com/users/sourcegraph/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcegraph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcegraph/subscriptions","organizations_url":"https://api.github.com/users/sourcegraph/orgs","repos_url":"https://api.github.com/users/sourcegraph/repos","events_url":"https://api.github.com/users/sourcegraph/events{/privacy}","received_events_url":"https://api.github.com/users/sourcegraph/received_events","type":"Organization","site_admin":false},"repo":{"id":60245511,"name":"sourcegraph","full_name":"sourcegraph/sourcegraph","owner":{"login":"sourcegraph","id":3979584,"avatar_url":"https://avatars.githubusercontent.com/u/3979584?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcegraph","html_url":"https://github.com/sourcegraph","followers_url":"https://api.github.com/users/sourcegraph/followers","following_url":"https://api.github.com/users/sourcegraph/following{/other_user}","gists_url":"https://api.github.com/users/sourcegraph/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcegraph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcegraph/subscriptions","organizations_url":"https://api.github.com/users/sourcegraph/orgs","repos_url":"https://api.github.com/users/sourcegraph/repos","events_url":"https://api.github.com/users/sourcegraph/events{/privacy}","received_events_url":"https://api.github.com/users/sourcegraph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sourcegraph/sourcegraph","description":"Fast, global, semantic code search & cross-reference engine for developers.","fork":false,"url":"https://api.github.com/repos/sourcegraph/sourcegraph","forks_url":"https://api.github.com/repos/sourcegraph/sourcegraph/forks","keys_url":"https://api.github.com/repos/sourcegraph/sourcegraph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourcegraph/sourcegraph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourcegraph/sourcegraph/teams","hooks_url":"https://api.github.com/repos/sourcegraph/sourcegraph/hooks","issue_events_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/events{/number}","events_url":"https://api.github.com/repos/sourcegraph/sourcegraph/events","assignees_url":"https://api.github.com/repos/sourcegraph/sourcegraph/assignees{/user}","branches_url":"https://api.github.com/repos/sourcegraph/sourcegraph/branches{/branch}","tags_url":"https://api.github.com/repos/sourcegraph/sourcegraph/tags","blobs_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourcegraph/sourcegraph/statuses/{sha}","languages_url":"https://api.github.com/repos/sourcegraph/sourcegraph/languages","stargazers_url":"https://api.github.com/repos/sourcegraph/sourcegraph/stargazers","contributors_url":"https://api.github.com/repos/sourcegraph/sourcegraph/contributors","subscribers_url":"https://api.github.com/repos/sourcegraph/sourcegraph/subscribers","subscription_url":"https://api.github.com/repos/sourcegraph/sourcegraph/subscription","commits_url":"https://api.github.com/repos/sourcegraph/sourcegraph/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourcegraph/sourcegraph/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourcegraph/sourcegraph/contents/{+path}","compare_url":"https://api.github.com/repos/sourcegraph/sourcegraph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourcegraph/sourcegraph/merges","archive_url":"https://api.github.com/repos/sourcegraph/sourcegraph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourcegraph/sourcegraph/downloads","issues_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues{/number}","pulls_url":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls{/number}","milestones_url":"https://api.github.com/repos/sourcegraph/sourcegraph/milestones{/number}","notifications_url":"https://api.github.com/repos/sourcegraph/sourcegraph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourcegraph/sourcegraph/labels{/name}","releases_url":"https://api.github.com/repos/sourcegraph/sourcegraph/releases{/id}","deployments_url":"https://api.github.com/repos/sourcegraph/sourcegraph/deployments","created_at":"2016-06-02T08:17:03Z","updated_at":"2016-06-29T20:06:53Z","pushed_at":"2016-06-30T18:34:52Z","git_url":"git://github.com/sourcegraph/sourcegraph.git","ssh_url":"git@github.com:sourcegraph/sourcegraph.git","clone_url":"https://github.com/sourcegraph/sourcegraph.git","svn_url":"https://github.com/sourcegraph/sourcegraph","homepage":"https://sourcegraph.com","size":114524,"stargazers_count":104,"watchers_count":104,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":13,"forks":7,"open_issues":13,"watchers":104,"default_branch":"master"}},"base":{"label":"sourcegraph:master","ref":"master","sha":"7f8d267e8e535822a37db5b347df3e6ed5df9eda","user":{"login":"sourcegraph","id":3979584,"avatar_url":"https://avatars.githubusercontent.com/u/3979584?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcegraph","html_url":"https://github.com/sourcegraph","followers_url":"https://api.github.com/users/sourcegraph/followers","following_url":"https://api.github.com/users/sourcegraph/following{/other_user}","gists_url":"https://api.github.com/users/sourcegraph/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcegraph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcegraph/subscriptions","organizations_url":"https://api.github.com/users/sourcegraph/orgs","repos_url":"https://api.github.com/users/sourcegraph/repos","events_url":"https://api.github.com/users/sourcegraph/events{/privacy}","received_events_url":"https://api.github.com/users/sourcegraph/received_events","type":"Organization","site_admin":false},"repo":{"id":60245511,"name":"sourcegraph","full_name":"sourcegraph/sourcegraph","owner":{"login":"sourcegraph","id":3979584,"avatar_url":"https://avatars.githubusercontent.com/u/3979584?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcegraph","html_url":"https://github.com/sourcegraph","followers_url":"https://api.github.com/users/sourcegraph/followers","following_url":"https://api.github.com/users/sourcegraph/following{/other_user}","gists_url":"https://api.github.com/users/sourcegraph/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcegraph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcegraph/subscriptions","organizations_url":"https://api.github.com/users/sourcegraph/orgs","repos_url":"https://api.github.com/users/sourcegraph/repos","events_url":"https://api.github.com/users/sourcegraph/events{/privacy}","received_events_url":"https://api.github.com/users/sourcegraph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sourcegraph/sourcegraph","description":"Fast, global, semantic code search & cross-reference engine for developers.","fork":false,"url":"https://api.github.com/repos/sourcegraph/sourcegraph","forks_url":"https://api.github.com/repos/sourcegraph/sourcegraph/forks","keys_url":"https://api.github.com/repos/sourcegraph/sourcegraph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourcegraph/sourcegraph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourcegraph/sourcegraph/teams","hooks_url":"https://api.github.com/repos/sourcegraph/sourcegraph/hooks","issue_events_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/events{/number}","events_url":"https://api.github.com/repos/sourcegraph/sourcegraph/events","assignees_url":"https://api.github.com/repos/sourcegraph/sourcegraph/assignees{/user}","branches_url":"https://api.github.com/repos/sourcegraph/sourcegraph/branches{/branch}","tags_url":"https://api.github.com/repos/sourcegraph/sourcegraph/tags","blobs_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourcegraph/sourcegraph/statuses/{sha}","languages_url":"https://api.github.com/repos/sourcegraph/sourcegraph/languages","stargazers_url":"https://api.github.com/repos/sourcegraph/sourcegraph/stargazers","contributors_url":"https://api.github.com/repos/sourcegraph/sourcegraph/contributors","subscribers_url":"https://api.github.com/repos/sourcegraph/sourcegraph/subscribers","subscription_url":"https://api.github.com/repos/sourcegraph/sourcegraph/subscription","commits_url":"https://api.github.com/repos/sourcegraph/sourcegraph/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourcegraph/sourcegraph/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourcegraph/sourcegraph/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourcegraph/sourcegraph/contents/{+path}","compare_url":"https://api.github.com/repos/sourcegraph/sourcegraph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourcegraph/sourcegraph/merges","archive_url":"https://api.github.com/repos/sourcegraph/sourcegraph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourcegraph/sourcegraph/downloads","issues_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues{/number}","pulls_url":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls{/number}","milestones_url":"https://api.github.com/repos/sourcegraph/sourcegraph/milestones{/number}","notifications_url":"https://api.github.com/repos/sourcegraph/sourcegraph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourcegraph/sourcegraph/labels{/name}","releases_url":"https://api.github.com/repos/sourcegraph/sourcegraph/releases{/id}","deployments_url":"https://api.github.com/repos/sourcegraph/sourcegraph/deployments","created_at":"2016-06-02T08:17:03Z","updated_at":"2016-06-29T20:06:53Z","pushed_at":"2016-06-30T18:34:52Z","git_url":"git://github.com/sourcegraph/sourcegraph.git","ssh_url":"git@github.com:sourcegraph/sourcegraph.git","clone_url":"https://github.com/sourcegraph/sourcegraph.git","svn_url":"https://github.com/sourcegraph/sourcegraph","homepage":"https://sourcegraph.com","size":114524,"stargazers_count":104,"watchers_count":104,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":13,"forks":7,"open_issues":13,"watchers":104,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls/190"},"html":{"href":"https://github.com/sourcegraph/sourcegraph/pull/190"},"issue":{"href":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/190"},"comments":{"href":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/sourcegraph/sourcegraph/statuses/7245e986d487f52badb12222e4253ecbe6ef793b"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"ggilmore","id":9022011,"avatar_url":"https://avatars.githubusercontent.com/u/9022011?v=3","gravatar_id":"","url":"https://api.github.com/users/ggilmore","html_url":"https://github.com/ggilmore","followers_url":"https://api.github.com/users/ggilmore/followers","following_url":"https://api.github.com/users/ggilmore/following{/other_user}","gists_url":"https://api.github.com/users/ggilmore/gists{/gist_id}","starred_url":"https://api.github.com/users/ggilmore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggilmore/subscriptions","organizations_url":"https://api.github.com/users/ggilmore/orgs","repos_url":"https://api.github.com/users/ggilmore/repos","events_url":"https://api.github.com/users/ggilmore/events{/privacy}","received_events_url":"https://api.github.com/users/ggilmore/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":2,"additions":355,"deletions":39,"changed_files":8}}
{"actor":{"display_login":"ggilmore"}}