{"action":"opened","number":21,"pull_request":{"url":"https://api.github.com/repos/Commonfare-net/just-auth/pulls/21","id":198348411,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4MzQ4NDEx","html_url":"https://github.com/Commonfare-net/just-auth/pull/21","diff_url":"https://github.com/Commonfare-net/just-auth/pull/21.diff","patch_url":"https://github.com/Commonfare-net/just-auth/pull/21.patch","issue_url":"https://api.github.com/repos/Commonfare-net/just-auth/issues/21","number":21,"state":"open","locked":false,"title":"Feature/bruteforce rebased 2","user":{"login":"aspasia","id":514783,"node_id":"MDQ6VXNlcjUxNDc4Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/514783?v=4","gravatar_id":"","url":"https://api.github.com/users/aspasia","html_url":"https://github.com/aspasia","followers_url":"https://api.github.com/users/aspasia/followers","following_url":"https://api.github.com/users/aspasia/following{/other_user}","gists_url":"https://api.github.com/users/aspasia/gists{/gist_id}","starred_url":"https://api.github.com/users/aspasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspasia/subscriptions","organizations_url":"https://api.github.com/users/aspasia/orgs","repos_url":"https://api.github.com/users/aspasia/repos","events_url":"https://api.github.com/users/aspasia/events{/privacy}","received_events_url":"https://api.github.com/users/aspasia/received_events","type":"User","site_admin":false},"body":"@jaromil this is the PR about throttling. For most things I m happy with the design but I have a main uncertainty which I would like your opinion about:\r\n\r\nLet me explain first: a config is needed to define the throttling behaviour. An example config like https://github.com/Commonfare-net/just-auth/blob/feature/bruteforce-rebased-2/test/just_auth/test/integration.clj#L44. The :criteria checks which criteria will be checked. It can be just email, just ip-address, both in the same time or none (any attempt). The type can be either :block or :delay. Then there is a time window where the criteria reaches and finally what is the attack threshold.  \r\nATM when one tries to login it is checked whether a block or delay is reached. Then what happens is that a Failjure is returned with the equivalent message: block message for blocks and the seconds of recommended delay for delays. However the lib does not really keep a state of which ips are blocked but it does an event based calculation on the fly. The reason why I chose this implementation is that I think the handling of that could be done on a higher level. The advantage of this for the lib is that it does not have a state, but instead returns every time the 'truth'. What is your take on this? ","created_at":"2018-06-29T15:18:13Z","updated_at":"2018-06-29T15:18:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Commonfare-net/just-auth/pulls/21/commits","review_comments_url":"https://api.github.com/repos/Commonfare-net/just-auth/pulls/21/comments","review_comment_url":"https://api.github.com/repos/Commonfare-net/just-auth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Commonfare-net/just-auth/issues/21/comments","statuses_url":"https://api.github.com/repos/Commonfare-net/just-auth/statuses/dc14607ad51317fdc1ae027fbff586be14a49844","head":{"label":"Commonfare-net:feature/bruteforce-rebased-2","ref":"feature/bruteforce-rebased-2","sha":"dc14607ad51317fdc1ae027fbff586be14a49844","user":{"login":"Commonfare-net","id":22371153,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzcxMTUz","avatar_url":"https://avatars1.githubusercontent.com/u/22371153?v=4","gravatar_id":"","url":"https://api.github.com/users/Commonfare-net","html_url":"https://github.com/Commonfare-net","followers_url":"https://api.github.com/users/Commonfare-net/followers","following_url":"https://api.github.com/users/Commonfare-net/following{/other_user}","gists_url":"https://api.github.com/users/Commonfare-net/gists{/gist_id}","starred_url":"https://api.github.com/users/Commonfare-net/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Commonfare-net/subscriptions","organizations_url":"https://api.github.com/users/Commonfare-net/orgs","repos_url":"https://api.github.com/users/Commonfare-net/repos","events_url":"https://api.github.com/users/Commonfare-net/events{/privacy}","received_events_url":"https://api.github.com/users/Commonfare-net/received_events","type":"Organization","site_admin":false},"repo":{"id":104221328,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQyMjEzMjg=","name":"just-auth","full_name":"Commonfare-net/just-auth","owner":{"login":"Commonfare-net","id":22371153,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzcxMTUz","avatar_url":"https://avatars1.githubusercontent.com/u/22371153?v=4","gravatar_id":"","url":"https://api.github.com/users/Commonfare-net","html_url":"https://github.com/Commonfare-net","followers_url":"https://api.github.com/users/Commonfare-net/followers","following_url":"https://api.github.com/users/Commonfare-net/following{/other_user}","gists_url":"https://api.github.com/users/Commonfare-net/gists{/gist_id}","starred_url":"https://api.github.com/users/Commonfare-net/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Commonfare-net/subscriptions","organizations_url":"https://api.github.com/users/Commonfare-net/orgs","repos_url":"https://api.github.com/users/Commonfare-net/repos","events_url":"https://api.github.com/users/Commonfare-net/events{/privacy}","received_events_url":"https://api.github.com/users/Commonfare-net/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Commonfare-net/just-auth","description":"A simple two factor authentication library","fork":false,"url":"https://api.github.com/repos/Commonfare-net/just-auth","forks_url":"https://api.github.com/repos/Commonfare-net/just-auth/forks","keys_url":"https://api.github.com/repos/Commonfare-net/just-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Commonfare-net/just-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Commonfare-net/just-auth/teams","hooks_url":"https://api.github.com/repos/Commonfare-net/just-auth/hooks","issue_events_url":"https://api.github.com/repos/Commonfare-net/just-auth/issues/events{/number}","events_url":"https://api.github.com/repos/Commonfare-net/just-auth/events","assignees_url":"https://api.github.com/repos/Commonfare-net/just-auth/assignees{/user}","branches_url":"https://api.github.com/repos/Commonfare-net/just-auth/branches{/branch}","tags_url":"https://api.github.com/repos/Commonfare-net/just-auth/tags","blobs_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Commonfare-net/just-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/Commonfare-net/just-auth/languages","stargazers_url":"https://api.github.com/repos/Commonfare-net/just-auth/stargazers","contributors_url":"https://api.github.com/repos/Commonfare-net/just-auth/contributors","subscribers_url":"https://api.github.com/repos/Commonfare-net/just-auth/subscribers","subscription_url":"https://api.github.com/repos/Commonfare-net/just-auth/subscription","commits_url":"https://api.github.com/repos/Commonfare-net/just-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/Commonfare-net/just-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/Commonfare-net/just-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/Commonfare-net/just-auth/contents/{+path}","compare_url":"https://api.github.com/repos/Commonfare-net/just-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Commonfare-net/just-auth/merges","archive_url":"https://api.github.com/repos/Commonfare-net/just-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Commonfare-net/just-auth/downloads","issues_url":"https://api.github.com/repos/Commonfare-net/just-auth/issues{/number}","pulls_url":"https://api.github.com/repos/Commonfare-net/just-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/Commonfare-net/just-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/Commonfare-net/just-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Commonfare-net/just-auth/labels{/name}","releases_url":"https://api.github.com/repos/Commonfare-net/just-auth/releases{/id}","deployments_url":"https://api.github.com/repos/Commonfare-net/just-auth/deployments","created_at":"2017-09-20T13:48:27Z","updated_at":"2018-06-08T11:48:11Z","pushed_at":"2018-06-22T16:22:14Z","git_url":"git://github.com/Commonfare-net/just-auth.git","ssh_url":"git@github.com:Commonfare-net/just-auth.git","clone_url":"https://github.com/Commonfare-net/just-auth.git","svn_url":"https://github.com/Commonfare-net/just-auth","homepage":null,"size":135,"stargazers_count":1,"watchers_count":1,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":8,"watchers":1,"default_branch":"master"}},"base":{"label":"Commonfare-net:develop","ref":"develop","sha":"ee46f76391f262b22f280ae9c0590ff6998ccddd","user":{"login":"Commonfare-net","id":22371153,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzcxMTUz","avatar_url":"https://avatars1.githubusercontent.com/u/22371153?v=4","gravatar_id":"","url":"https://api.github.com/users/Commonfare-net","html_url":"https://github.com/Commonfare-net","followers_url":"https://api.github.com/users/Commonfare-net/followers","following_url":"https://api.github.com/users/Commonfare-net/following{/other_user}","gists_url":"https://api.github.com/users/Commonfare-net/gists{/gist_id}","starred_url":"https://api.github.com/users/Commonfare-net/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Commonfare-net/subscriptions","organizations_url":"https://api.github.com/users/Commonfare-net/orgs","repos_url":"https://api.github.com/users/Commonfare-net/repos","events_url":"https://api.github.com/users/Commonfare-net/events{/privacy}","received_events_url":"https://api.github.com/users/Commonfare-net/received_events","type":"Organization","site_admin":false},"repo":{"id":104221328,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQyMjEzMjg=","name":"just-auth","full_name":"Commonfare-net/just-auth","owner":{"login":"Commonfare-net","id":22371153,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzcxMTUz","avatar_url":"https://avatars1.githubusercontent.com/u/22371153?v=4","gravatar_id":"","url":"https://api.github.com/users/Commonfare-net","html_url":"https://github.com/Commonfare-net","followers_url":"https://api.github.com/users/Commonfare-net/followers","following_url":"https://api.github.com/users/Commonfare-net/following{/other_user}","gists_url":"https://api.github.com/users/Commonfare-net/gists{/gist_id}","starred_url":"https://api.github.com/users/Commonfare-net/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Commonfare-net/subscriptions","organizations_url":"https://api.github.com/users/Commonfare-net/orgs","repos_url":"https://api.github.com/users/Commonfare-net/repos","events_url":"https://api.github.com/users/Commonfare-net/events{/privacy}","received_events_url":"https://api.github.com/users/Commonfare-net/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Commonfare-net/just-auth","description":"A simple two factor authentication library","fork":false,"url":"https://api.github.com/repos/Commonfare-net/just-auth","forks_url":"https://api.github.com/repos/Commonfare-net/just-auth/forks","keys_url":"https://api.github.com/repos/Commonfare-net/just-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Commonfare-net/just-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Commonfare-net/just-auth/teams","hooks_url":"https://api.github.com/repos/Commonfare-net/just-auth/hooks","issue_events_url":"https://api.github.com/repos/Commonfare-net/just-auth/issues/events{/number}","events_url":"https://api.github.com/repos/Commonfare-net/just-auth/events","assignees_url":"https://api.github.com/repos/Commonfare-net/just-auth/assignees{/user}","branches_url":"https://api.github.com/repos/Commonfare-net/just-auth/branches{/branch}","tags_url":"https://api.github.com/repos/Commonfare-net/just-auth/tags","blobs_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Commonfare-net/just-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/Commonfare-net/just-auth/languages","stargazers_url":"https://api.github.com/repos/Commonfare-net/just-auth/stargazers","contributors_url":"https://api.github.com/repos/Commonfare-net/just-auth/contributors","subscribers_url":"https://api.github.com/repos/Commonfare-net/just-auth/subscribers","subscription_url":"https://api.github.com/repos/Commonfare-net/just-auth/subscription","commits_url":"https://api.github.com/repos/Commonfare-net/just-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/Commonfare-net/just-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/Commonfare-net/just-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/Commonfare-net/just-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/Commonfare-net/just-auth/contents/{+path}","compare_url":"https://api.github.com/repos/Commonfare-net/just-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Commonfare-net/just-auth/merges","archive_url":"https://api.github.com/repos/Commonfare-net/just-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Commonfare-net/just-auth/downloads","issues_url":"https://api.github.com/repos/Commonfare-net/just-auth/issues{/number}","pulls_url":"https://api.github.com/repos/Commonfare-net/just-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/Commonfare-net/just-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/Commonfare-net/just-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Commonfare-net/just-auth/labels{/name}","releases_url":"https://api.github.com/repos/Commonfare-net/just-auth/releases{/id}","deployments_url":"https://api.github.com/repos/Commonfare-net/just-auth/deployments","created_at":"2017-09-20T13:48:27Z","updated_at":"2018-06-08T11:48:11Z","pushed_at":"2018-06-22T16:22:14Z","git_url":"git://github.com/Commonfare-net/just-auth.git","ssh_url":"git@github.com:Commonfare-net/just-auth.git","clone_url":"https://github.com/Commonfare-net/just-auth.git","svn_url":"https://github.com/Commonfare-net/just-auth","homepage":null,"size":135,"stargazers_count":1,"watchers_count":1,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":8,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Commonfare-net/just-auth/pulls/21"},"html":{"href":"https://github.com/Commonfare-net/just-auth/pull/21"},"issue":{"href":"https://api.github.com/repos/Commonfare-net/just-auth/issues/21"},"comments":{"href":"https://api.github.com/repos/Commonfare-net/just-auth/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/Commonfare-net/just-auth/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/Commonfare-net/just-auth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Commonfare-net/just-auth/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/Commonfare-net/just-auth/statuses/dc14607ad51317fdc1ae027fbff586be14a49844"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":9,"additions":640,"deletions":89,"changed_files":13}}
{"actor":{"display_login":"aspasia"}}