{"action":"closed","number":685,"pull_request":{"url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/685","id":39381889,"html_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/685","diff_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/685.diff","patch_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/685.patch","issue_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/685","number":685,"state":"closed","locked":false,"title":"add support for specifying an alternative class for preauthorization","user":{"login":"redterror","id":131319,"avatar_url":"https://avatars.githubusercontent.com/u/131319?v=3","gravatar_id":"","url":"https://api.github.com/users/redterror","html_url":"https://github.com/redterror","followers_url":"https://api.github.com/users/redterror/followers","following_url":"https://api.github.com/users/redterror/following{/other_user}","gists_url":"https://api.github.com/users/redterror/gists{/gist_id}","starred_url":"https://api.github.com/users/redterror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redterror/subscriptions","organizations_url":"https://api.github.com/users/redterror/orgs","repos_url":"https://api.github.com/users/redterror/repos","events_url":"https://api.github.com/users/redterror/events{/privacy}","received_events_url":"https://api.github.com/users/redterror/received_events","type":"User","site_admin":false},"body":"I'm submitting this PR mostly to follow up on #667 with what I'm using in my project right now.  I was hoping we could resume discussion and find a way to add a supported hook of some kind for users to control preauthorization behavior.\r\n\r\nWhat do you think?  The crux of my argument is that doorkeeper lacks a few key control loci (this PR addresses just one) that are required to implement various policies beyond the current one where all users can access all scopes.  Monkey patching is one way to go, but it seems cleaner to provide a way that users can rely on.  With the current implementation in this PR, I can build a class that takes the user, application, and scopes in the auth request and apply whatever logic is appropriate to my company to decide if it should be approved.","created_at":"2015-07-07T15:19:22Z","updated_at":"2016-04-30T16:22:06Z","closed_at":"2016-04-30T16:22:06Z","merged_at":null,"merge_commit_sha":"24be750883dfbbe64ba2a2af5305b2e6f839a0c2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/685/commits","review_comments_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/685/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/685/comments","statuses_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/statuses/ac838c87b36351b4680c6cb81391ec9efabf70b7","head":{"label":"redterror:feature/alt_preauth","ref":"feature/alt_preauth","sha":"ac838c87b36351b4680c6cb81391ec9efabf70b7","user":{"login":"redterror","id":131319,"avatar_url":"https://avatars.githubusercontent.com/u/131319?v=3","gravatar_id":"","url":"https://api.github.com/users/redterror","html_url":"https://github.com/redterror","followers_url":"https://api.github.com/users/redterror/followers","following_url":"https://api.github.com/users/redterror/following{/other_user}","gists_url":"https://api.github.com/users/redterror/gists{/gist_id}","starred_url":"https://api.github.com/users/redterror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redterror/subscriptions","organizations_url":"https://api.github.com/users/redterror/orgs","repos_url":"https://api.github.com/users/redterror/repos","events_url":"https://api.github.com/users/redterror/events{/privacy}","received_events_url":"https://api.github.com/users/redterror/received_events","type":"User","site_admin":false},"repo":{"id":36528606,"name":"doorkeeper","full_name":"redterror/doorkeeper","owner":{"login":"redterror","id":131319,"avatar_url":"https://avatars.githubusercontent.com/u/131319?v=3","gravatar_id":"","url":"https://api.github.com/users/redterror","html_url":"https://github.com/redterror","followers_url":"https://api.github.com/users/redterror/followers","following_url":"https://api.github.com/users/redterror/following{/other_user}","gists_url":"https://api.github.com/users/redterror/gists{/gist_id}","starred_url":"https://api.github.com/users/redterror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redterror/subscriptions","organizations_url":"https://api.github.com/users/redterror/orgs","repos_url":"https://api.github.com/users/redterror/repos","events_url":"https://api.github.com/users/redterror/events{/privacy}","received_events_url":"https://api.github.com/users/redterror/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/redterror/doorkeeper","description":"Doorkeeper is an OAuth 2 provider for Rails and Grape","fork":true,"url":"https://api.github.com/repos/redterror/doorkeeper","forks_url":"https://api.github.com/repos/redterror/doorkeeper/forks","keys_url":"https://api.github.com/repos/redterror/doorkeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redterror/doorkeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redterror/doorkeeper/teams","hooks_url":"https://api.github.com/repos/redterror/doorkeeper/hooks","issue_events_url":"https://api.github.com/repos/redterror/doorkeeper/issues/events{/number}","events_url":"https://api.github.com/repos/redterror/doorkeeper/events","assignees_url":"https://api.github.com/repos/redterror/doorkeeper/assignees{/user}","branches_url":"https://api.github.com/repos/redterror/doorkeeper/branches{/branch}","tags_url":"https://api.github.com/repos/redterror/doorkeeper/tags","blobs_url":"https://api.github.com/repos/redterror/doorkeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redterror/doorkeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redterror/doorkeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/redterror/doorkeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redterror/doorkeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/redterror/doorkeeper/languages","stargazers_url":"https://api.github.com/repos/redterror/doorkeeper/stargazers","contributors_url":"https://api.github.com/repos/redterror/doorkeeper/contributors","subscribers_url":"https://api.github.com/repos/redterror/doorkeeper/subscribers","subscription_url":"https://api.github.com/repos/redterror/doorkeeper/subscription","commits_url":"https://api.github.com/repos/redterror/doorkeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/redterror/doorkeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/redterror/doorkeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/redterror/doorkeeper/issues/comments{/number}","contents_url":"https://api.github.com/repos/redterror/doorkeeper/contents/{+path}","compare_url":"https://api.github.com/repos/redterror/doorkeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redterror/doorkeeper/merges","archive_url":"https://api.github.com/repos/redterror/doorkeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redterror/doorkeeper/downloads","issues_url":"https://api.github.com/repos/redterror/doorkeeper/issues{/number}","pulls_url":"https://api.github.com/repos/redterror/doorkeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/redterror/doorkeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/redterror/doorkeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redterror/doorkeeper/labels{/name}","releases_url":"https://api.github.com/repos/redterror/doorkeeper/releases{/id}","deployments_url":"https://api.github.com/repos/redterror/doorkeeper/deployments","created_at":"2015-05-29T20:55:27Z","updated_at":"2015-05-29T20:55:29Z","pushed_at":"2015-07-07T14:45:51Z","git_url":"git://github.com/redterror/doorkeeper.git","ssh_url":"git@github.com:redterror/doorkeeper.git","clone_url":"https://github.com/redterror/doorkeeper.git","svn_url":"https://github.com/redterror/doorkeeper","homepage":"","size":2124,"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":"bba8c5ef6a529478cc06d8a1ac9ad38b9bb3ac3a","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}","deployments_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/deployments","created_at":"2011-11-18T13:02:01Z","updated_at":"2016-04-30T15:18:29Z","pushed_at":"2016-04-30T16:20:29Z","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":"","size":3178,"stargazers_count":2973,"watchers_count":2973,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":600,"mirror_url":null,"open_issues_count":17,"forks":600,"open_issues":17,"watchers":2973,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/685"},"html":{"href":"https://github.com/doorkeeper-gem/doorkeeper/pull/685"},"issue":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/685"},"comments":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/685/comments"},"review_comments":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/685/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/685/commits"},"statuses":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/statuses/ac838c87b36351b4680c6cb81391ec9efabf70b7"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":4,"review_comments":7,"commits":1,"additions":10,"deletions":3,"changed_files":2}}