{"action":"created","comment":{"url":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/comments/75364296","id":75364296,"diff_hunk":"@@ -317,6 +325,11 @@ private function addResourceOwnersConfiguration(ArrayNodeDefinition $node)\n                                     return false;\n                                 }\n \n+                                // skip if this contains a class\n+                                if (isset($c['class'])) {","path":"DependencyInjection/Configuration.php","position":20,"original_position":20,"commit_id":"db32f14aab0f0d73fe0aaa193442937ed2b85b90","original_commit_id":"db32f14aab0f0d73fe0aaa193442937ed2b85b90","user":{"login":"stloyd","id":67402,"avatar_url":"https://avatars.githubusercontent.com/u/67402?v=3","gravatar_id":"","url":"https://api.github.com/users/stloyd","html_url":"https://github.com/stloyd","followers_url":"https://api.github.com/users/stloyd/followers","following_url":"https://api.github.com/users/stloyd/following{/other_user}","gists_url":"https://api.github.com/users/stloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/stloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stloyd/subscriptions","organizations_url":"https://api.github.com/users/stloyd/orgs","repos_url":"https://api.github.com/users/stloyd/repos","events_url":"https://api.github.com/users/stloyd/events{/privacy}","received_events_url":"https://api.github.com/users/stloyd/received_events","type":"User","site_admin":false},"body":"IMO this could be merged into `if` before.","created_at":"2016-08-18T18:37:24Z","updated_at":"2016-08-18T18:37:24Z","html_url":"https://github.com/hwi/HWIOAuthBundle/pull/1077#discussion_r75364296","pull_request_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/1077","_links":{"self":{"href":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/comments/75364296"},"html":{"href":"https://github.com/hwi/HWIOAuthBundle/pull/1077#discussion_r75364296"},"pull_request":{"href":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/1077"}}},"pull_request":{"url":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/1077","id":81807089,"html_url":"https://github.com/hwi/HWIOAuthBundle/pull/1077","diff_url":"https://github.com/hwi/HWIOAuthBundle/pull/1077.diff","patch_url":"https://github.com/hwi/HWIOAuthBundle/pull/1077.patch","issue_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/issues/1077","number":1077,"state":"open","locked":false,"title":"External ResourceOwner configuration","user":{"login":"guillaumepotier","id":496234,"avatar_url":"https://avatars.githubusercontent.com/u/496234?v=3","gravatar_id":"","url":"https://api.github.com/users/guillaumepotier","html_url":"https://github.com/guillaumepotier","followers_url":"https://api.github.com/users/guillaumepotier/followers","following_url":"https://api.github.com/users/guillaumepotier/following{/other_user}","gists_url":"https://api.github.com/users/guillaumepotier/gists{/gist_id}","starred_url":"https://api.github.com/users/guillaumepotier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillaumepotier/subscriptions","organizations_url":"https://api.github.com/users/guillaumepotier/orgs","repos_url":"https://api.github.com/users/guillaumepotier/repos","events_url":"https://api.github.com/users/guillaumepotier/events{/privacy}","received_events_url":"https://api.github.com/users/guillaumepotier/received_events","type":"User","site_admin":false},"body":"This PR is related to #1069.\r\n\r\nI planned on having heavy refacto to do especially with service definition but after some digging, I found that we could already use a `service` option to give an external service class to do the work. (Might be used by FOSUB, but nowhere in the documentation). This is a good first step, but defining a full service is IMO not the best option, we cannot benefit from existing generic OAuth1 and OAuth2 providers and must re-implement all the stuff.\r\n\r\nThe proposal below is following: we add a new option, `class` that allows us to give an external resource owner class to the bundle. That class **must extend** `GenericOAuth1ResourceOwner` or `GenericOAuth2ResourceOwner`, and **must be given along** `type` option (either `oauth1` or `oauth2` value).\r\n\r\nAn exemple (for our Evernote needs in #732) would be:\r\n\r\n```yaml\r\n    resource_owners:\r\n        evernote:\r\n            type: oauth2\r\n            class: Wisembly\\UserBundle\\OAuth\\ResourceOwner\\EvernoteResourceOwner\r\n            client_id:           %oauth.evernote.client_id%\r\n            client_secret:       %oauth.evernote.client_secret%\r\n\r\n            options:\r\n              sandbox: %oauth.evernote.sandbox%\r\n\r\n            user_response_class: Wisembly\\UserBundle\\OAuth\\OAuthUserResponse\r\n```\r\n\r\nThat way we have a simple class `EvernoteResourceOwner` in our bundle that inherit from all the `GenericOAuth2ResourceOwner` good work (and upcoming good work too), and add its external deps.\r\n\r\nDoes that sounds good to you? If so, I'll add **some tests and documentation** for that.\r\n\r\nThanks\r\n","created_at":"2016-08-18T12:28:42Z","updated_at":"2016-08-18T18:37:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dc4516dc97df6294a31396b891f2710e378f7b90","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hwi/HWIOAuthBundle/milestones/4","html_url":"https://github.com/hwi/HWIOAuthBundle/milestones/Release%200.6","labels_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/milestones/4/labels","id":1911488,"number":4,"title":"Release 0.6","description":"","creator":{"login":"stloyd","id":67402,"avatar_url":"https://avatars.githubusercontent.com/u/67402?v=3","gravatar_id":"","url":"https://api.github.com/users/stloyd","html_url":"https://github.com/stloyd","followers_url":"https://api.github.com/users/stloyd/followers","following_url":"https://api.github.com/users/stloyd/following{/other_user}","gists_url":"https://api.github.com/users/stloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/stloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stloyd/subscriptions","organizations_url":"https://api.github.com/users/stloyd/orgs","repos_url":"https://api.github.com/users/stloyd/repos","events_url":"https://api.github.com/users/stloyd/events{/privacy}","received_events_url":"https://api.github.com/users/stloyd/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":0,"state":"open","created_at":"2016-07-29T11:37:35Z","updated_at":"2016-08-18T13:30:49Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/1077/commits","review_comments_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/1077/comments","review_comment_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/issues/1077/comments","statuses_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/statuses/db32f14aab0f0d73fe0aaa193442937ed2b85b90","head":{"label":"guillaumepotier:external-resourceowner","ref":"external-resourceowner","sha":"db32f14aab0f0d73fe0aaa193442937ed2b85b90","user":{"login":"guillaumepotier","id":496234,"avatar_url":"https://avatars.githubusercontent.com/u/496234?v=3","gravatar_id":"","url":"https://api.github.com/users/guillaumepotier","html_url":"https://github.com/guillaumepotier","followers_url":"https://api.github.com/users/guillaumepotier/followers","following_url":"https://api.github.com/users/guillaumepotier/following{/other_user}","gists_url":"https://api.github.com/users/guillaumepotier/gists{/gist_id}","starred_url":"https://api.github.com/users/guillaumepotier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillaumepotier/subscriptions","organizations_url":"https://api.github.com/users/guillaumepotier/orgs","repos_url":"https://api.github.com/users/guillaumepotier/repos","events_url":"https://api.github.com/users/guillaumepotier/events{/privacy}","received_events_url":"https://api.github.com/users/guillaumepotier/received_events","type":"User","site_admin":false},"repo":{"id":65977606,"name":"HWIOAuthBundle","full_name":"guillaumepotier/HWIOAuthBundle","owner":{"login":"guillaumepotier","id":496234,"avatar_url":"https://avatars.githubusercontent.com/u/496234?v=3","gravatar_id":"","url":"https://api.github.com/users/guillaumepotier","html_url":"https://github.com/guillaumepotier","followers_url":"https://api.github.com/users/guillaumepotier/followers","following_url":"https://api.github.com/users/guillaumepotier/following{/other_user}","gists_url":"https://api.github.com/users/guillaumepotier/gists{/gist_id}","starred_url":"https://api.github.com/users/guillaumepotier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillaumepotier/subscriptions","organizations_url":"https://api.github.com/users/guillaumepotier/orgs","repos_url":"https://api.github.com/users/guillaumepotier/repos","events_url":"https://api.github.com/users/guillaumepotier/events{/privacy}","received_events_url":"https://api.github.com/users/guillaumepotier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guillaumepotier/HWIOAuthBundle","description":"OAuth client integration for Symfony. Supports both OAuth1.0a and OAuth2.","fork":true,"url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle","forks_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/forks","keys_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/teams","hooks_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/hooks","issue_events_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/issues/events{/number}","events_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/events","assignees_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/assignees{/user}","branches_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/branches{/branch}","tags_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/tags","blobs_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/languages","stargazers_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/stargazers","contributors_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/contributors","subscribers_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/subscribers","subscription_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/subscription","commits_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/contents/{+path}","compare_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/merges","archive_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/downloads","issues_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/issues{/number}","pulls_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/labels{/name}","releases_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/releases{/id}","deployments_url":"https://api.github.com/repos/guillaumepotier/HWIOAuthBundle/deployments","created_at":"2016-08-18T08:01:50Z","updated_at":"2016-08-18T08:01:52Z","pushed_at":"2016-08-18T14:32:02Z","git_url":"git://github.com/guillaumepotier/HWIOAuthBundle.git","ssh_url":"git@github.com:guillaumepotier/HWIOAuthBundle.git","clone_url":"https://github.com/guillaumepotier/HWIOAuthBundle.git","svn_url":"https://github.com/guillaumepotier/HWIOAuthBundle","homepage":"","size":1736,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"hwi:master","ref":"master","sha":"4f531b3643a4ab038dd1e84b4b13f34db804cddb","user":{"login":"hwi","id":1150427,"avatar_url":"https://avatars.githubusercontent.com/u/1150427?v=3","gravatar_id":"","url":"https://api.github.com/users/hwi","html_url":"https://github.com/hwi","followers_url":"https://api.github.com/users/hwi/followers","following_url":"https://api.github.com/users/hwi/following{/other_user}","gists_url":"https://api.github.com/users/hwi/gists{/gist_id}","starred_url":"https://api.github.com/users/hwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hwi/subscriptions","organizations_url":"https://api.github.com/users/hwi/orgs","repos_url":"https://api.github.com/users/hwi/repos","events_url":"https://api.github.com/users/hwi/events{/privacy}","received_events_url":"https://api.github.com/users/hwi/received_events","type":"Organization","site_admin":false},"repo":{"id":3601728,"name":"HWIOAuthBundle","full_name":"hwi/HWIOAuthBundle","owner":{"login":"hwi","id":1150427,"avatar_url":"https://avatars.githubusercontent.com/u/1150427?v=3","gravatar_id":"","url":"https://api.github.com/users/hwi","html_url":"https://github.com/hwi","followers_url":"https://api.github.com/users/hwi/followers","following_url":"https://api.github.com/users/hwi/following{/other_user}","gists_url":"https://api.github.com/users/hwi/gists{/gist_id}","starred_url":"https://api.github.com/users/hwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hwi/subscriptions","organizations_url":"https://api.github.com/users/hwi/orgs","repos_url":"https://api.github.com/users/hwi/repos","events_url":"https://api.github.com/users/hwi/events{/privacy}","received_events_url":"https://api.github.com/users/hwi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hwi/HWIOAuthBundle","description":"OAuth client integration for Symfony. Supports both OAuth1.0a and OAuth2.","fork":false,"url":"https://api.github.com/repos/hwi/HWIOAuthBundle","forks_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/forks","keys_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/teams","hooks_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/hooks","issue_events_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/issues/events{/number}","events_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/events","assignees_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/assignees{/user}","branches_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/branches{/branch}","tags_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/tags","blobs_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/languages","stargazers_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/stargazers","contributors_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/contributors","subscribers_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/subscribers","subscription_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/subscription","commits_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/contents/{+path}","compare_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/merges","archive_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/downloads","issues_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/issues{/number}","pulls_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/labels{/name}","releases_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/releases{/id}","deployments_url":"https://api.github.com/repos/hwi/HWIOAuthBundle/deployments","created_at":"2012-03-02T11:56:40Z","updated_at":"2016-08-18T03:34:27Z","pushed_at":"2016-08-18T16:27:07Z","git_url":"git://github.com/hwi/HWIOAuthBundle.git","ssh_url":"git@github.com:hwi/HWIOAuthBundle.git","clone_url":"https://github.com/hwi/HWIOAuthBundle.git","svn_url":"https://github.com/hwi/HWIOAuthBundle","homepage":"","size":3398,"stargazers_count":1250,"watchers_count":1250,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":539,"mirror_url":null,"open_issues_count":200,"forks":539,"open_issues":200,"watchers":1250,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/1077"},"html":{"href":"https://github.com/hwi/HWIOAuthBundle/pull/1077"},"issue":{"href":"https://api.github.com/repos/hwi/HWIOAuthBundle/issues/1077"},"comments":{"href":"https://api.github.com/repos/hwi/HWIOAuthBundle/issues/1077/comments"},"review_comments":{"href":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/1077/comments"},"review_comment":{"href":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hwi/HWIOAuthBundle/pulls/1077/commits"},"statuses":{"href":"https://api.github.com/repos/hwi/HWIOAuthBundle/statuses/db32f14aab0f0d73fe0aaa193442937ed2b85b90"}}}}
{"actor":{"display_login":"stloyd"}}