{"action":"created","comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/comments/65323078","id":65323078,"diff_hunk":"@@ -0,0 +1,57 @@\n+package <%=packageName%>.config;\n+\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;\n+import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;\n+import org.springframework.stereotype.Component;\n+\n+import java.net.URI;\n+import java.net.URISyntaxException;\n+\n+\n+@Component\n+public class LoadBalancedResourceDetails extends ClientCredentialsResourceDetails {\n+\n+    @Autowired\n+    public LoadBalancedResourceDetails(JHipsterProperties jHipsterProperties) {\n+        this.jHipsterProperties = jHipsterProperties;\n+\n+        setAccessTokenUri(jHipsterProperties.getSecurity().getClientAuthorization().getTokenUrl());\n+        setClientId(jHipsterProperties.getSecurity().getClientAuthorization().getClientId());\n+        setClientSecret(jHipsterProperties.getSecurity().getClientAuthorization().getClientSecret());\n+        setGrantType(\"client_credentials\");\n+\n+    }\n+\n+    private LoadBalancerClient loadBalancerClient;\n+\n+    private JHipsterProperties jHipsterProperties;\n+\n+\n+    @Autowired(required = false)\n+    public void setLoadBalancerClient(LoadBalancerClient loadBalancerClient) {\n+        this.loadBalancerClient = loadBalancerClient;\n+    }\n+\n+    @Override\n+    public String getAccessTokenUri() {\n+        String serviceName = jHipsterProperties.getSecurity().getClientAuthorization().getTokenServiceId();\n+        if (loadBalancerClient != null && !serviceName.isEmpty()) {\n+            String newUrl;\n+            try {\n+                newUrl = loadBalancerClient.reconstructURI(\n+                    loadBalancerClient.choose(serviceName),\n+                    new URI(super.getAccessTokenUri())\n+                ).toString();\n+\n+                return newUrl;\n+            } catch (URISyntaxException e) {\n+                e.printStackTrace();","path":"generators/server/templates/src/main/java/package/config/_LoadBalancedResourceDetails.java","position":49,"original_position":49,"commit_id":"b553669a33eeac45042fc07235c669f5a5d9b66b","original_commit_id":"4c3fff0bbe2e32e58ab216c54b6e1feeecb95f4b","user":{"login":"PierreBesson","id":513471,"avatar_url":"https://avatars.githubusercontent.com/u/513471?v=3","gravatar_id":"","url":"https://api.github.com/users/PierreBesson","html_url":"https://github.com/PierreBesson","followers_url":"https://api.github.com/users/PierreBesson/followers","following_url":"https://api.github.com/users/PierreBesson/following{/other_user}","gists_url":"https://api.github.com/users/PierreBesson/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreBesson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreBesson/subscriptions","organizations_url":"https://api.github.com/users/PierreBesson/orgs","repos_url":"https://api.github.com/users/PierreBesson/repos","events_url":"https://api.github.com/users/PierreBesson/events{/privacy}","received_events_url":"https://api.github.com/users/PierreBesson/received_events","type":"User","site_admin":false},"body":"Please use a logger call here instead of printStackTrace.","created_at":"2016-06-01T08:44:10Z","updated_at":"2016-06-01T08:44:10Z","html_url":"https://github.com/jhipster/generator-jhipster/pull/3662#discussion_r65323078","pull_request_url":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/3662","_links":{"self":{"href":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/comments/65323078"},"html":{"href":"https://github.com/jhipster/generator-jhipster/pull/3662#discussion_r65323078"},"pull_request":{"href":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/3662"}}},"pull_request":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/3662","id":71835858,"html_url":"https://github.com/jhipster/generator-jhipster/pull/3662","diff_url":"https://github.com/jhipster/generator-jhipster/pull/3662.diff","patch_url":"https://github.com/jhipster/generator-jhipster/pull/3662.patch","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/3662","number":3662,"state":"open","locked":false,"title":"enables support for feign clients using OAuth2 client credentials grant","user":{"login":"xetys","id":2758003,"avatar_url":"https://avatars.githubusercontent.com/u/2758003?v=3","gravatar_id":"","url":"https://api.github.com/users/xetys","html_url":"https://github.com/xetys","followers_url":"https://api.github.com/users/xetys/followers","following_url":"https://api.github.com/users/xetys/following{/other_user}","gists_url":"https://api.github.com/users/xetys/gists{/gist_id}","starred_url":"https://api.github.com/users/xetys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xetys/subscriptions","organizations_url":"https://api.github.com/users/xetys/orgs","repos_url":"https://api.github.com/users/xetys/repos","events_url":"https://api.github.com/users/xetys/events{/privacy}","received_events_url":"https://api.github.com/users/xetys/received_events","type":"User","site_admin":false},"body":"so feign clients can be added declarative to. This is a requirement for the next step of a JHipster feign client subgenerator.\r\n\r\n## contents of this PR\r\n\r\n* adds dependencies to microservice applications\r\n* extends JHipster properties to configure client credentials for internal communications\r\n* replaces hardcoded internal client with above configuration in UAA\r\n* configures a OAuth2ProtectedRessourceDetails based on new configuration and declares a OAuth2RequestInterceptor bean\r\n* enables with ```@EnableFeignClients``` the usage of feign clients in microservice applications\r\n\r\nso far this gets merged, I am going to proceed with the feign client generators","created_at":"2016-05-29T19:53:01Z","updated_at":"2016-06-01T08:44:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ab0779beaa77b2d36b90701861e5acf0e54e680","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/3662/commits","review_comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/3662/comments","review_comment_url":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/3662/comments","statuses_url":"https://api.github.com/repos/jhipster/generator-jhipster/statuses/b553669a33eeac45042fc07235c669f5a5d9b66b","head":{"label":"xetys:feign-clients","ref":"feign-clients","sha":"b553669a33eeac45042fc07235c669f5a5d9b66b","user":{"login":"xetys","id":2758003,"avatar_url":"https://avatars.githubusercontent.com/u/2758003?v=3","gravatar_id":"","url":"https://api.github.com/users/xetys","html_url":"https://github.com/xetys","followers_url":"https://api.github.com/users/xetys/followers","following_url":"https://api.github.com/users/xetys/following{/other_user}","gists_url":"https://api.github.com/users/xetys/gists{/gist_id}","starred_url":"https://api.github.com/users/xetys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xetys/subscriptions","organizations_url":"https://api.github.com/users/xetys/orgs","repos_url":"https://api.github.com/users/xetys/repos","events_url":"https://api.github.com/users/xetys/events{/privacy}","received_events_url":"https://api.github.com/users/xetys/received_events","type":"User","site_admin":false},"repo":{"id":55014916,"name":"generator-jhipster","full_name":"xetys/generator-jhipster","owner":{"login":"xetys","id":2758003,"avatar_url":"https://avatars.githubusercontent.com/u/2758003?v=3","gravatar_id":"","url":"https://api.github.com/users/xetys","html_url":"https://github.com/xetys","followers_url":"https://api.github.com/users/xetys/followers","following_url":"https://api.github.com/users/xetys/following{/other_user}","gists_url":"https://api.github.com/users/xetys/gists{/gist_id}","starred_url":"https://api.github.com/users/xetys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xetys/subscriptions","organizations_url":"https://api.github.com/users/xetys/orgs","repos_url":"https://api.github.com/users/xetys/repos","events_url":"https://api.github.com/users/xetys/events{/privacy}","received_events_url":"https://api.github.com/users/xetys/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xetys/generator-jhipster","description":"Hipster stack for Java developers. Spring Boot + AngularJS in one handy generator.","fork":true,"url":"https://api.github.com/repos/xetys/generator-jhipster","forks_url":"https://api.github.com/repos/xetys/generator-jhipster/forks","keys_url":"https://api.github.com/repos/xetys/generator-jhipster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xetys/generator-jhipster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xetys/generator-jhipster/teams","hooks_url":"https://api.github.com/repos/xetys/generator-jhipster/hooks","issue_events_url":"https://api.github.com/repos/xetys/generator-jhipster/issues/events{/number}","events_url":"https://api.github.com/repos/xetys/generator-jhipster/events","assignees_url":"https://api.github.com/repos/xetys/generator-jhipster/assignees{/user}","branches_url":"https://api.github.com/repos/xetys/generator-jhipster/branches{/branch}","tags_url":"https://api.github.com/repos/xetys/generator-jhipster/tags","blobs_url":"https://api.github.com/repos/xetys/generator-jhipster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xetys/generator-jhipster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xetys/generator-jhipster/git/refs{/sha}","trees_url":"https://api.github.com/repos/xetys/generator-jhipster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xetys/generator-jhipster/statuses/{sha}","languages_url":"https://api.github.com/repos/xetys/generator-jhipster/languages","stargazers_url":"https://api.github.com/repos/xetys/generator-jhipster/stargazers","contributors_url":"https://api.github.com/repos/xetys/generator-jhipster/contributors","subscribers_url":"https://api.github.com/repos/xetys/generator-jhipster/subscribers","subscription_url":"https://api.github.com/repos/xetys/generator-jhipster/subscription","commits_url":"https://api.github.com/repos/xetys/generator-jhipster/commits{/sha}","git_commits_url":"https://api.github.com/repos/xetys/generator-jhipster/git/commits{/sha}","comments_url":"https://api.github.com/repos/xetys/generator-jhipster/comments{/number}","issue_comment_url":"https://api.github.com/repos/xetys/generator-jhipster/issues/comments{/number}","contents_url":"https://api.github.com/repos/xetys/generator-jhipster/contents/{+path}","compare_url":"https://api.github.com/repos/xetys/generator-jhipster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xetys/generator-jhipster/merges","archive_url":"https://api.github.com/repos/xetys/generator-jhipster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xetys/generator-jhipster/downloads","issues_url":"https://api.github.com/repos/xetys/generator-jhipster/issues{/number}","pulls_url":"https://api.github.com/repos/xetys/generator-jhipster/pulls{/number}","milestones_url":"https://api.github.com/repos/xetys/generator-jhipster/milestones{/number}","notifications_url":"https://api.github.com/repos/xetys/generator-jhipster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xetys/generator-jhipster/labels{/name}","releases_url":"https://api.github.com/repos/xetys/generator-jhipster/releases{/id}","deployments_url":"https://api.github.com/repos/xetys/generator-jhipster/deployments","created_at":"2016-03-29T22:31:04Z","updated_at":"2016-03-29T22:31:06Z","pushed_at":"2016-05-31T16:01:12Z","git_url":"git://github.com/xetys/generator-jhipster.git","ssh_url":"git@github.com:xetys/generator-jhipster.git","clone_url":"https://github.com/xetys/generator-jhipster.git","svn_url":"https://github.com/xetys/generator-jhipster","homepage":"http://jhipster.github.io","size":12714,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"jhipster:master","ref":"master","sha":"b2064486470ccb0250a0cb49672cf4575ae1631d","user":{"login":"jhipster","id":6059488,"avatar_url":"https://avatars.githubusercontent.com/u/6059488?v=3","gravatar_id":"","url":"https://api.github.com/users/jhipster","html_url":"https://github.com/jhipster","followers_url":"https://api.github.com/users/jhipster/followers","following_url":"https://api.github.com/users/jhipster/following{/other_user}","gists_url":"https://api.github.com/users/jhipster/gists{/gist_id}","starred_url":"https://api.github.com/users/jhipster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhipster/subscriptions","organizations_url":"https://api.github.com/users/jhipster/orgs","repos_url":"https://api.github.com/users/jhipster/repos","events_url":"https://api.github.com/users/jhipster/events{/privacy}","received_events_url":"https://api.github.com/users/jhipster/received_events","type":"Organization","site_admin":false},"repo":{"id":13753636,"name":"generator-jhipster","full_name":"jhipster/generator-jhipster","owner":{"login":"jhipster","id":6059488,"avatar_url":"https://avatars.githubusercontent.com/u/6059488?v=3","gravatar_id":"","url":"https://api.github.com/users/jhipster","html_url":"https://github.com/jhipster","followers_url":"https://api.github.com/users/jhipster/followers","following_url":"https://api.github.com/users/jhipster/following{/other_user}","gists_url":"https://api.github.com/users/jhipster/gists{/gist_id}","starred_url":"https://api.github.com/users/jhipster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhipster/subscriptions","organizations_url":"https://api.github.com/users/jhipster/orgs","repos_url":"https://api.github.com/users/jhipster/repos","events_url":"https://api.github.com/users/jhipster/events{/privacy}","received_events_url":"https://api.github.com/users/jhipster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jhipster/generator-jhipster","description":"An Open Source application generator for creating Spring Boot + AngularJS projects in seconds!","fork":false,"url":"https://api.github.com/repos/jhipster/generator-jhipster","forks_url":"https://api.github.com/repos/jhipster/generator-jhipster/forks","keys_url":"https://api.github.com/repos/jhipster/generator-jhipster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhipster/generator-jhipster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhipster/generator-jhipster/teams","hooks_url":"https://api.github.com/repos/jhipster/generator-jhipster/hooks","issue_events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/events{/number}","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/events","assignees_url":"https://api.github.com/repos/jhipster/generator-jhipster/assignees{/user}","branches_url":"https://api.github.com/repos/jhipster/generator-jhipster/branches{/branch}","tags_url":"https://api.github.com/repos/jhipster/generator-jhipster/tags","blobs_url":"https://api.github.com/repos/jhipster/generator-jhipster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhipster/generator-jhipster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhipster/generator-jhipster/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhipster/generator-jhipster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhipster/generator-jhipster/statuses/{sha}","languages_url":"https://api.github.com/repos/jhipster/generator-jhipster/languages","stargazers_url":"https://api.github.com/repos/jhipster/generator-jhipster/stargazers","contributors_url":"https://api.github.com/repos/jhipster/generator-jhipster/contributors","subscribers_url":"https://api.github.com/repos/jhipster/generator-jhipster/subscribers","subscription_url":"https://api.github.com/repos/jhipster/generator-jhipster/subscription","commits_url":"https://api.github.com/repos/jhipster/generator-jhipster/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhipster/generator-jhipster/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhipster/generator-jhipster/contents/{+path}","compare_url":"https://api.github.com/repos/jhipster/generator-jhipster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhipster/generator-jhipster/merges","archive_url":"https://api.github.com/repos/jhipster/generator-jhipster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhipster/generator-jhipster/downloads","issues_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues{/number}","pulls_url":"https://api.github.com/repos/jhipster/generator-jhipster/pulls{/number}","milestones_url":"https://api.github.com/repos/jhipster/generator-jhipster/milestones{/number}","notifications_url":"https://api.github.com/repos/jhipster/generator-jhipster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/labels{/name}","releases_url":"https://api.github.com/repos/jhipster/generator-jhipster/releases{/id}","deployments_url":"https://api.github.com/repos/jhipster/generator-jhipster/deployments","created_at":"2013-10-21T20:07:22Z","updated_at":"2016-06-01T06:35:01Z","pushed_at":"2016-06-01T00:55:46Z","git_url":"git://github.com/jhipster/generator-jhipster.git","ssh_url":"git@github.com:jhipster/generator-jhipster.git","clone_url":"https://github.com/jhipster/generator-jhipster.git","svn_url":"https://github.com/jhipster/generator-jhipster","homepage":"http://jhipster.github.io","size":16120,"stargazers_count":4201,"watchers_count":4201,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":945,"mirror_url":null,"open_issues_count":32,"forks":945,"open_issues":32,"watchers":4201,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/3662"},"html":{"href":"https://github.com/jhipster/generator-jhipster/pull/3662"},"issue":{"href":"https://api.github.com/repos/jhipster/generator-jhipster/issues/3662"},"comments":{"href":"https://api.github.com/repos/jhipster/generator-jhipster/issues/3662/comments"},"review_comments":{"href":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/3662/comments"},"review_comment":{"href":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jhipster/generator-jhipster/pulls/3662/commits"},"statuses":{"href":"https://api.github.com/repos/jhipster/generator-jhipster/statuses/b553669a33eeac45042fc07235c669f5a5d9b66b"}}}}
{"actor":{"display_login":"PierreBesson"}}