{"action":"created","comment":{"url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/comments/24559722","id":24559722,"diff_hunk":"@@ -55,7 +55,9 @@ def self.from_request(request, *methods)\n \n       def self.authenticate(request, *methods)\n         if token = from_request(request, *methods)\n-          AccessToken.by_token(token)\n+          access_token = AccessToken.by_token(token)\n+          access_token.revoke_previous_refresh_token! if access_token && Doorkeeper.configuration.refresh_token_revoked_on_use","path":"lib/doorkeeper/oauth/token.rb","position":6,"original_position":6,"commit_id":"94d38a4cab37ba2ec3bd92cfd24e4f99a0d69b25","original_commit_id":"94d38a4cab37ba2ec3bd92cfd24e4f99a0d69b25","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [126/80]","created_at":"2015-02-12T05:39:10Z","updated_at":"2015-02-12T05:39:10Z","html_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/578#discussion_r24559722","pull_request_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/578","_links":{"self":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/comments/24559722"},"html":{"href":"https://github.com/doorkeeper-gem/doorkeeper/pull/578#discussion_r24559722"},"pull_request":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/578"}}},"pull_request":{"url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/578","id":29154244,"html_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/578","diff_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/578.diff","patch_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/578.patch","issue_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/578","number":578,"state":"open","locked":false,"title":"Revoke Refresh Token on access token use","user":{"login":"rsharrott","id":513814,"avatar_url":"https://avatars.githubusercontent.com/u/513814?v=3","gravatar_id":"","url":"https://api.github.com/users/rsharrott","html_url":"https://github.com/rsharrott","followers_url":"https://api.github.com/users/rsharrott/followers","following_url":"https://api.github.com/users/rsharrott/following{/other_user}","gists_url":"https://api.github.com/users/rsharrott/gists{/gist_id}","starred_url":"https://api.github.com/users/rsharrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsharrott/subscriptions","organizations_url":"https://api.github.com/users/rsharrott/orgs","repos_url":"https://api.github.com/users/rsharrott/repos","events_url":"https://api.github.com/users/rsharrott/events{/privacy}","received_events_url":"https://api.github.com/users/rsharrott/received_events","type":"User","site_admin":false},"body":"This PR allows refresh tokens to not either revoke at some point in the future (if you want to allow some wiggle room for network failures, etc) set refresh_token_revoked_in to some number of seconds in the future.\r\n\r\nAlso allows for refresh tokens to not be revoked until an access token created with that refresh token is successfully used once. Set refresh_token_revoked_on_use to true.\r\n\r\nBoth are off by default.\r\n\r\nI made this work with ActiveRecord and it is passing test but no work was done for Mongoid.","created_at":"2015-02-12T05:39:05Z","updated_at":"2015-02-12T05:39:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"316f289bad0d3e0799d6c2f1a0fc3aa85e6cb394","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/578/commits","review_comments_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/578/comments","review_comment_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/comments/{number}","comments_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/578/comments","statuses_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/statuses/94d38a4cab37ba2ec3bd92cfd24e4f99a0d69b25","head":{"label":"moneytree:feature/revoke-on-use","ref":"feature/revoke-on-use","sha":"94d38a4cab37ba2ec3bd92cfd24e4f99a0d69b25","user":{"login":"moneytree","id":1421669,"avatar_url":"https://avatars.githubusercontent.com/u/1421669?v=3","gravatar_id":"","url":"https://api.github.com/users/moneytree","html_url":"https://github.com/moneytree","followers_url":"https://api.github.com/users/moneytree/followers","following_url":"https://api.github.com/users/moneytree/following{/other_user}","gists_url":"https://api.github.com/users/moneytree/gists{/gist_id}","starred_url":"https://api.github.com/users/moneytree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneytree/subscriptions","organizations_url":"https://api.github.com/users/moneytree/orgs","repos_url":"https://api.github.com/users/moneytree/repos","events_url":"https://api.github.com/users/moneytree/events{/privacy}","received_events_url":"https://api.github.com/users/moneytree/received_events","type":"Organization","site_admin":false},"repo":{"id":23532246,"name":"doorkeeper","full_name":"moneytree/doorkeeper","owner":{"login":"moneytree","id":1421669,"avatar_url":"https://avatars.githubusercontent.com/u/1421669?v=3","gravatar_id":"","url":"https://api.github.com/users/moneytree","html_url":"https://github.com/moneytree","followers_url":"https://api.github.com/users/moneytree/followers","following_url":"https://api.github.com/users/moneytree/following{/other_user}","gists_url":"https://api.github.com/users/moneytree/gists{/gist_id}","starred_url":"https://api.github.com/users/moneytree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneytree/subscriptions","organizations_url":"https://api.github.com/users/moneytree/orgs","repos_url":"https://api.github.com/users/moneytree/repos","events_url":"https://api.github.com/users/moneytree/events{/privacy}","received_events_url":"https://api.github.com/users/moneytree/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moneytree/doorkeeper","description":"Doorkeeper is an OAuth 2 provider for Rails.","fork":true,"url":"https://api.github.com/repos/moneytree/doorkeeper","forks_url":"https://api.github.com/repos/moneytree/doorkeeper/forks","keys_url":"https://api.github.com/repos/moneytree/doorkeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneytree/doorkeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneytree/doorkeeper/teams","hooks_url":"https://api.github.com/repos/moneytree/doorkeeper/hooks","issue_events_url":"https://api.github.com/repos/moneytree/doorkeeper/issues/events{/number}","events_url":"https://api.github.com/repos/moneytree/doorkeeper/events","assignees_url":"https://api.github.com/repos/moneytree/doorkeeper/assignees{/user}","branches_url":"https://api.github.com/repos/moneytree/doorkeeper/branches{/branch}","tags_url":"https://api.github.com/repos/moneytree/doorkeeper/tags","blobs_url":"https://api.github.com/repos/moneytree/doorkeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneytree/doorkeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneytree/doorkeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneytree/doorkeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneytree/doorkeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/moneytree/doorkeeper/languages","stargazers_url":"https://api.github.com/repos/moneytree/doorkeeper/stargazers","contributors_url":"https://api.github.com/repos/moneytree/doorkeeper/contributors","subscribers_url":"https://api.github.com/repos/moneytree/doorkeeper/subscribers","subscription_url":"https://api.github.com/repos/moneytree/doorkeeper/subscription","commits_url":"https://api.github.com/repos/moneytree/doorkeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneytree/doorkeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneytree/doorkeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneytree/doorkeeper/issues/comments/{number}","contents_url":"https://api.github.com/repos/moneytree/doorkeeper/contents/{+path}","compare_url":"https://api.github.com/repos/moneytree/doorkeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneytree/doorkeeper/merges","archive_url":"https://api.github.com/repos/moneytree/doorkeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneytree/doorkeeper/downloads","issues_url":"https://api.github.com/repos/moneytree/doorkeeper/issues{/number}","pulls_url":"https://api.github.com/repos/moneytree/doorkeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/moneytree/doorkeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/moneytree/doorkeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneytree/doorkeeper/labels{/name}","releases_url":"https://api.github.com/repos/moneytree/doorkeeper/releases{/id}","created_at":"2014-09-01T06:02:26Z","updated_at":"2015-02-12T05:21:02Z","pushed_at":"2015-02-12T05:21:02Z","git_url":"git://github.com/moneytree/doorkeeper.git","ssh_url":"git@github.com:moneytree/doorkeeper.git","clone_url":"https://github.com/moneytree/doorkeeper.git","svn_url":"https://github.com/moneytree/doorkeeper","homepage":"https://github.com/doorkeeper-gem/doorkeeper","size":2400,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"doorkeeper-gem:master","ref":"master","sha":"e33343965dbba7db7d1252a71ddd7b85a27c5fa7","user":{"login":"doorkeeper-gem","id":7275750,"avatar_url":"https://avatars.githubusercontent.com/u/7275750?v=3","gravatar_id":"","url":"https://api.github.com/users/doorkeeper-gem","html_url":"https://github.com/doorkeeper-gem","followers_url":"https://api.github.com/users/doorkeeper-gem/followers","following_url":"https://api.github.com/users/doorkeeper-gem/following{/other_user}","gists_url":"https://api.github.com/users/doorkeeper-gem/gists{/gist_id}","starred_url":"https://api.github.com/users/doorkeeper-gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doorkeeper-gem/subscriptions","organizations_url":"https://api.github.com/users/doorkeeper-gem/orgs","repos_url":"https://api.github.com/users/doorkeeper-gem/repos","events_url":"https://api.github.com/users/doorkeeper-gem/events{/privacy}","received_events_url":"https://api.github.com/users/doorkeeper-gem/received_events","type":"Organization","site_admin":false},"repo":{"id":2802565,"name":"doorkeeper","full_name":"doorkeeper-gem/doorkeeper","owner":{"login":"doorkeeper-gem","id":7275750,"avatar_url":"https://avatars.githubusercontent.com/u/7275750?v=3","gravatar_id":"","url":"https://api.github.com/users/doorkeeper-gem","html_url":"https://github.com/doorkeeper-gem","followers_url":"https://api.github.com/users/doorkeeper-gem/followers","following_url":"https://api.github.com/users/doorkeeper-gem/following{/other_user}","gists_url":"https://api.github.com/users/doorkeeper-gem/gists{/gist_id}","starred_url":"https://api.github.com/users/doorkeeper-gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doorkeeper-gem/subscriptions","organizations_url":"https://api.github.com/users/doorkeeper-gem/orgs","repos_url":"https://api.github.com/users/doorkeeper-gem/repos","events_url":"https://api.github.com/users/doorkeeper-gem/events{/privacy}","received_events_url":"https://api.github.com/users/doorkeeper-gem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doorkeeper-gem/doorkeeper","description":"Doorkeeper is an OAuth 2 provider for Rails.","fork":false,"url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper","forks_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/forks","keys_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/teams","hooks_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/hooks","issue_events_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/events{/number}","events_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/events","assignees_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/assignees{/user}","branches_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/branches{/branch}","tags_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/tags","blobs_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/languages","stargazers_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/stargazers","contributors_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/contributors","subscribers_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/subscribers","subscription_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/subscription","commits_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/comments/{number}","contents_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/contents/{+path}","compare_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/merges","archive_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/downloads","issues_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues{/number}","pulls_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/labels{/name}","releases_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/releases{/id}","created_at":"2011-11-18T13:02:01Z","updated_at":"2015-02-11T22:00:43Z","pushed_at":"2015-02-11T15:16:17Z","git_url":"git://github.com/doorkeeper-gem/doorkeeper.git","ssh_url":"git@github.com:doorkeeper-gem/doorkeeper.git","clone_url":"https://github.com/doorkeeper-gem/doorkeeper.git","svn_url":"https://github.com/doorkeeper-gem/doorkeeper","homepage":"https://github.com/doorkeeper-gem/doorkeeper","size":4884,"stargazers_count":2042,"watchers_count":2042,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":431,"mirror_url":null,"open_issues_count":16,"forks":431,"open_issues":16,"watchers":2042,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/578"},"html":{"href":"https://github.com/doorkeeper-gem/doorkeeper/pull/578"},"issue":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/578"},"comments":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/578/comments"},"review_comments":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/578/comments"},"review_comment":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/578/commits"},"statuses":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/statuses/94d38a4cab37ba2ec3bd92cfd24e4f99a0d69b25"}}}}