{"action":"closed","number":92,"pull_request":{"url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/92","id":69311802,"html_url":"https://github.com/alphagov/pay-publicapi/pull/92","diff_url":"https://github.com/alphagov/pay-publicapi/pull/92.diff","patch_url":"https://github.com/alphagov/pay-publicapi/pull/92.patch","issue_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/92","number":92,"state":"closed","locked":false,"title":"PP-571 Authorization check - Rate Limiter - depends on publicauth","user":{"login":"rauligs","id":17246560,"avatar_url":"https://avatars.githubusercontent.com/u/17246560?v=3","gravatar_id":"","url":"https://api.github.com/users/rauligs","html_url":"https://github.com/rauligs","followers_url":"https://api.github.com/users/rauligs/followers","following_url":"https://api.github.com/users/rauligs/following{/other_user}","gists_url":"https://api.github.com/users/rauligs/gists{/gist_id}","starred_url":"https://api.github.com/users/rauligs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rauligs/subscriptions","organizations_url":"https://api.github.com/users/rauligs/orgs","repos_url":"https://api.github.com/users/rauligs/repos","events_url":"https://api.github.com/users/rauligs/events{/privacy}","received_events_url":"https://api.github.com/users/rauligs/received_events","type":"User","site_admin":false},"body":"# WHAT \r\nSo far, Authorization headers were non validated values, provoking for every single request, no matter the Authorization header value (as long it had one), a query into the database.\r\n-  Added an Authorization filter that checks the Authorization header format and also validates that the token is valid by re-creating its Hash value and check the provided Hash being _API Key = Token + Hash_\r\n- Added a Rate Limiter filter after the Authorization validation by limiting the number of requests per a period of time (configurable), current default is 3 requests per second per Authorization (hence a client service).\r\n# WHO\r\nAny dev ","created_at":"2016-05-09T08:38:46Z","updated_at":"2016-05-11T08:37:08Z","closed_at":"2016-05-11T08:37:08Z","merged_at":"2016-05-11T08:37:08Z","merge_commit_sha":"98cf5bf3c71659e4f2b7f9927884b2e241994d9e","assignee":{"login":"kakumara","id":6473228,"avatar_url":"https://avatars.githubusercontent.com/u/6473228?v=3","gravatar_id":"","url":"https://api.github.com/users/kakumara","html_url":"https://github.com/kakumara","followers_url":"https://api.github.com/users/kakumara/followers","following_url":"https://api.github.com/users/kakumara/following{/other_user}","gists_url":"https://api.github.com/users/kakumara/gists{/gist_id}","starred_url":"https://api.github.com/users/kakumara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakumara/subscriptions","organizations_url":"https://api.github.com/users/kakumara/orgs","repos_url":"https://api.github.com/users/kakumara/repos","events_url":"https://api.github.com/users/kakumara/events{/privacy}","received_events_url":"https://api.github.com/users/kakumara/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/92/commits","review_comments_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/92/comments","review_comment_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/92/comments","statuses_url":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/507178ff64b446d1e8e6a57b82051e4ee9709c04","head":{"label":"alphagov:PP-571-Rate-Limiter-Filter","ref":"PP-571-Rate-Limiter-Filter","sha":"507178ff64b446d1e8e6a57b82051e4ee9709c04","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":39890205,"name":"pay-publicapi","full_name":"alphagov/pay-publicapi","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/pay-publicapi","description":"The Payments Public API in Java (Dropwizard)","fork":false,"url":"https://api.github.com/repos/alphagov/pay-publicapi","forks_url":"https://api.github.com/repos/alphagov/pay-publicapi/forks","keys_url":"https://api.github.com/repos/alphagov/pay-publicapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/pay-publicapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/pay-publicapi/teams","hooks_url":"https://api.github.com/repos/alphagov/pay-publicapi/hooks","issue_events_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/pay-publicapi/events","assignees_url":"https://api.github.com/repos/alphagov/pay-publicapi/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/pay-publicapi/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/pay-publicapi/tags","blobs_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/pay-publicapi/languages","stargazers_url":"https://api.github.com/repos/alphagov/pay-publicapi/stargazers","contributors_url":"https://api.github.com/repos/alphagov/pay-publicapi/contributors","subscribers_url":"https://api.github.com/repos/alphagov/pay-publicapi/subscribers","subscription_url":"https://api.github.com/repos/alphagov/pay-publicapi/subscription","commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/pay-publicapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/pay-publicapi/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/pay-publicapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/pay-publicapi/merges","archive_url":"https://api.github.com/repos/alphagov/pay-publicapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/pay-publicapi/downloads","issues_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/pay-publicapi/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/pay-publicapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/pay-publicapi/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/pay-publicapi/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/pay-publicapi/deployments","created_at":"2015-07-29T11:37:37Z","updated_at":"2016-03-31T08:49:56Z","pushed_at":"2016-05-11T08:37:08Z","git_url":"git://github.com/alphagov/pay-publicapi.git","ssh_url":"git@github.com:alphagov/pay-publicapi.git","clone_url":"https://github.com/alphagov/pay-publicapi.git","svn_url":"https://github.com/alphagov/pay-publicapi","homepage":null,"size":8046,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"fd7fa0ff3b0cca0d7ff20df72d2ba75403be3c2c","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":39890205,"name":"pay-publicapi","full_name":"alphagov/pay-publicapi","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/pay-publicapi","description":"The Payments Public API in Java (Dropwizard)","fork":false,"url":"https://api.github.com/repos/alphagov/pay-publicapi","forks_url":"https://api.github.com/repos/alphagov/pay-publicapi/forks","keys_url":"https://api.github.com/repos/alphagov/pay-publicapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/pay-publicapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/pay-publicapi/teams","hooks_url":"https://api.github.com/repos/alphagov/pay-publicapi/hooks","issue_events_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/pay-publicapi/events","assignees_url":"https://api.github.com/repos/alphagov/pay-publicapi/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/pay-publicapi/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/pay-publicapi/tags","blobs_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/pay-publicapi/languages","stargazers_url":"https://api.github.com/repos/alphagov/pay-publicapi/stargazers","contributors_url":"https://api.github.com/repos/alphagov/pay-publicapi/contributors","subscribers_url":"https://api.github.com/repos/alphagov/pay-publicapi/subscribers","subscription_url":"https://api.github.com/repos/alphagov/pay-publicapi/subscription","commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/pay-publicapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/pay-publicapi/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/pay-publicapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/pay-publicapi/merges","archive_url":"https://api.github.com/repos/alphagov/pay-publicapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/pay-publicapi/downloads","issues_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/pay-publicapi/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/pay-publicapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/pay-publicapi/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/pay-publicapi/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/pay-publicapi/deployments","created_at":"2015-07-29T11:37:37Z","updated_at":"2016-03-31T08:49:56Z","pushed_at":"2016-05-11T08:37:08Z","git_url":"git://github.com/alphagov/pay-publicapi.git","ssh_url":"git@github.com:alphagov/pay-publicapi.git","clone_url":"https://github.com/alphagov/pay-publicapi.git","svn_url":"https://github.com/alphagov/pay-publicapi","homepage":null,"size":8046,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/92"},"html":{"href":"https://github.com/alphagov/pay-publicapi/pull/92"},"issue":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/issues/92"},"comments":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/issues/92/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/92/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/92/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/507178ff64b446d1e8e6a57b82051e4ee9709c04"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"kakumara","id":6473228,"avatar_url":"https://avatars.githubusercontent.com/u/6473228?v=3","gravatar_id":"","url":"https://api.github.com/users/kakumara","html_url":"https://github.com/kakumara","followers_url":"https://api.github.com/users/kakumara/followers","following_url":"https://api.github.com/users/kakumara/following{/other_user}","gists_url":"https://api.github.com/users/kakumara/gists{/gist_id}","starred_url":"https://api.github.com/users/kakumara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakumara/subscriptions","organizations_url":"https://api.github.com/users/kakumara/orgs","repos_url":"https://api.github.com/users/kakumara/repos","events_url":"https://api.github.com/users/kakumara/events{/privacy}","received_events_url":"https://api.github.com/users/kakumara/received_events","type":"User","site_admin":false},"comments":1,"review_comments":4,"commits":2,"additions":1040,"deletions":104,"changed_files":31}}