{"action":"created","comment":{"url":"https://api.github.com/repos/alv-ch/jobroom2/pulls/comments/186701296","pull_request_review_id":118330266,"id":186701296,"diff_hunk":"@@ -35,25 +33,11 @@ public DomainUserDetailsService(UserRepository userRepository) {\n \n     @Override\n     @Transactional\n-    public UserDetails loadUserByUsername(final String login) {\n+    public DomainUserPrincipal loadUserByUsername(final String login) {\n         log.debug(\"Authenticating {}\", login);\n-        String lowercaseLogin = login.toLowerCase(Locale.ENGLISH);\n-        Optional<User> userByLoginFromDatabase = userRepository.findOneWithAuthoritiesByLogin(lowercaseLogin);\n-        return userByLoginFromDatabase.map(user ->\n-            createSpringSecurityUser(lowercaseLogin, user))\n-            .orElseThrow(() ->\n-                new UsernameNotFoundException(\"User \" + lowercaseLogin + \" was not found in the \" + \"database\"));\n-    }\n-\n-    private org.springframework.security.core.userdetails.User createSpringSecurityUser(String lowercaseLogin, User user) {\n-        if (!user.getActivated()) {\n-            throw new UserNotActivatedException(\"User \" + lowercaseLogin + \" was not activated\");\n-        }\n-        List<GrantedAuthority> grantedAuthorities = user.getAuthorities().stream()\n-            .map(authority -> new SimpleGrantedAuthority(authority.getName()))\n-            .collect(Collectors.toList());\n-        return new org.springframework.security.core.userdetails.User(user.getLogin(),\n-            user.getPassword(),\n-            grantedAuthorities);\n+        return userRepository.findOneWithAuthoritiesByLogin(login.toLowerCase(Locale.ENGLISH))\n+                             .map(DomainUserPrincipal::new)\n+                             .orElseThrow(() ->\n+                                 new BadCredentialsException(format(BAD_CREDENTIALS_MSG)));","path":"src/main/java/ch/admin/seco/jobroom/security/DomainUserDetailsService.java","position":null,"original_position":63,"commit_id":"de790c022b74cf972ea8ba21378cdb257b86bb95","original_commit_id":"9d7fcc6402e28121a40c06414767a51c4b7bf365","user":{"login":"wwebec","id":11734079,"avatar_url":"https://avatars0.githubusercontent.com/u/11734079?v=4","gravatar_id":"","url":"https://api.github.com/users/wwebec","html_url":"https://github.com/wwebec","followers_url":"https://api.github.com/users/wwebec/followers","following_url":"https://api.github.com/users/wwebec/following{/other_user}","gists_url":"https://api.github.com/users/wwebec/gists{/gist_id}","starred_url":"https://api.github.com/users/wwebec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwebec/subscriptions","organizations_url":"https://api.github.com/users/wwebec/orgs","repos_url":"https://api.github.com/users/wwebec/repos","events_url":"https://api.github.com/users/wwebec/events{/privacy}","received_events_url":"https://api.github.com/users/wwebec/received_events","type":"User","site_admin":false},"body":"done\r\n","created_at":"2018-05-08T11:54:15Z","updated_at":"2018-05-08T11:54:15Z","html_url":"https://github.com/alv-ch/jobroom2/pull/545#discussion_r186701296","pull_request_url":"https://api.github.com/repos/alv-ch/jobroom2/pulls/545","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/alv-ch/jobroom2/pulls/comments/186701296"},"html":{"href":"https://github.com/alv-ch/jobroom2/pull/545#discussion_r186701296"},"pull_request":{"href":"https://api.github.com/repos/alv-ch/jobroom2/pulls/545"}},"in_reply_to_id":186652371},"pull_request":{"url":"https://api.github.com/repos/alv-ch/jobroom2/pulls/545","id":186553856,"html_url":"https://github.com/alv-ch/jobroom2/pull/545","diff_url":"https://github.com/alv-ch/jobroom2/pull/545.diff","patch_url":"https://github.com/alv-ch/jobroom2/pull/545.patch","issue_url":"https://api.github.com/repos/alv-ch/jobroom2/issues/545","number":545,"state":"open","locked":false,"title":"feature/extension-jwt-with-user-fields-of-job-add","user":{"login":"wwebec","id":11734079,"avatar_url":"https://avatars0.githubusercontent.com/u/11734079?v=4","gravatar_id":"","url":"https://api.github.com/users/wwebec","html_url":"https://github.com/wwebec","followers_url":"https://api.github.com/users/wwebec/followers","following_url":"https://api.github.com/users/wwebec/following{/other_user}","gists_url":"https://api.github.com/users/wwebec/gists{/gist_id}","starred_url":"https://api.github.com/users/wwebec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwebec/subscriptions","organizations_url":"https://api.github.com/users/wwebec/orgs","repos_url":"https://api.github.com/users/wwebec/repos","events_url":"https://api.github.com/users/wwebec/events{/privacy}","received_events_url":"https://api.github.com/users/wwebec/received_events","type":"User","site_admin":false},"body":"The changes copied from the fork branch  https://github.com/alv-ch/jobroom2/pull/541\r\n\r\nExtension of JWT implementation of a jobroom2 (gateway application) with fields from a User entity of a  job-ad -service. There were added following fileds into the token:\r\n- extId,\r\n- companyId, \r\n- firstName, \r\n- lastName, \r\n- email;\r\n- phone","created_at":"2018-05-08T07:53:18Z","updated_at":"2018-05-08T11:54:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"994b34b659ad4172312506448af21425954a4f8c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"birom","id":21288589,"avatar_url":"https://avatars0.githubusercontent.com/u/21288589?v=4","gravatar_id":"","url":"https://api.github.com/users/birom","html_url":"https://github.com/birom","followers_url":"https://api.github.com/users/birom/followers","following_url":"https://api.github.com/users/birom/following{/other_user}","gists_url":"https://api.github.com/users/birom/gists{/gist_id}","starred_url":"https://api.github.com/users/birom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/birom/subscriptions","organizations_url":"https://api.github.com/users/birom/orgs","repos_url":"https://api.github.com/users/birom/repos","events_url":"https://api.github.com/users/birom/events{/privacy}","received_events_url":"https://api.github.com/users/birom/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alv-ch/jobroom2/pulls/545/commits","review_comments_url":"https://api.github.com/repos/alv-ch/jobroom2/pulls/545/comments","review_comment_url":"https://api.github.com/repos/alv-ch/jobroom2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alv-ch/jobroom2/issues/545/comments","statuses_url":"https://api.github.com/repos/alv-ch/jobroom2/statuses/de790c022b74cf972ea8ba21378cdb257b86bb95","head":{"label":"alv-ch:feature/extension-jwt-with-user-fields-of-job-add","ref":"feature/extension-jwt-with-user-fields-of-job-add","sha":"de790c022b74cf972ea8ba21378cdb257b86bb95","user":{"login":"alv-ch","id":7008756,"avatar_url":"https://avatars0.githubusercontent.com/u/7008756?v=4","gravatar_id":"","url":"https://api.github.com/users/alv-ch","html_url":"https://github.com/alv-ch","followers_url":"https://api.github.com/users/alv-ch/followers","following_url":"https://api.github.com/users/alv-ch/following{/other_user}","gists_url":"https://api.github.com/users/alv-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/alv-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alv-ch/subscriptions","organizations_url":"https://api.github.com/users/alv-ch/orgs","repos_url":"https://api.github.com/users/alv-ch/repos","events_url":"https://api.github.com/users/alv-ch/events{/privacy}","received_events_url":"https://api.github.com/users/alv-ch/received_events","type":"Organization","site_admin":false},"repo":{"id":18153573,"name":"jobroom2","full_name":"alv-ch/jobroom2","owner":{"login":"alv-ch","id":7008756,"avatar_url":"https://avatars0.githubusercontent.com/u/7008756?v=4","gravatar_id":"","url":"https://api.github.com/users/alv-ch","html_url":"https://github.com/alv-ch","followers_url":"https://api.github.com/users/alv-ch/followers","following_url":"https://api.github.com/users/alv-ch/following{/other_user}","gists_url":"https://api.github.com/users/alv-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/alv-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alv-ch/subscriptions","organizations_url":"https://api.github.com/users/alv-ch/orgs","repos_url":"https://api.github.com/users/alv-ch/repos","events_url":"https://api.github.com/users/alv-ch/events{/privacy}","received_events_url":"https://api.github.com/users/alv-ch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alv-ch/jobroom2","description":"Future web gateway of www.job-room.ch","fork":false,"url":"https://api.github.com/repos/alv-ch/jobroom2","forks_url":"https://api.github.com/repos/alv-ch/jobroom2/forks","keys_url":"https://api.github.com/repos/alv-ch/jobroom2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alv-ch/jobroom2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alv-ch/jobroom2/teams","hooks_url":"https://api.github.com/repos/alv-ch/jobroom2/hooks","issue_events_url":"https://api.github.com/repos/alv-ch/jobroom2/issues/events{/number}","events_url":"https://api.github.com/repos/alv-ch/jobroom2/events","assignees_url":"https://api.github.com/repos/alv-ch/jobroom2/assignees{/user}","branches_url":"https://api.github.com/repos/alv-ch/jobroom2/branches{/branch}","tags_url":"https://api.github.com/repos/alv-ch/jobroom2/tags","blobs_url":"https://api.github.com/repos/alv-ch/jobroom2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alv-ch/jobroom2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alv-ch/jobroom2/git/refs{/sha}","trees_url":"https://api.github.com/repos/alv-ch/jobroom2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alv-ch/jobroom2/statuses/{sha}","languages_url":"https://api.github.com/repos/alv-ch/jobroom2/languages","stargazers_url":"https://api.github.com/repos/alv-ch/jobroom2/stargazers","contributors_url":"https://api.github.com/repos/alv-ch/jobroom2/contributors","subscribers_url":"https://api.github.com/repos/alv-ch/jobroom2/subscribers","subscription_url":"https://api.github.com/repos/alv-ch/jobroom2/subscription","commits_url":"https://api.github.com/repos/alv-ch/jobroom2/commits{/sha}","git_commits_url":"https://api.github.com/repos/alv-ch/jobroom2/git/commits{/sha}","comments_url":"https://api.github.com/repos/alv-ch/jobroom2/comments{/number}","issue_comment_url":"https://api.github.com/repos/alv-ch/jobroom2/issues/comments{/number}","contents_url":"https://api.github.com/repos/alv-ch/jobroom2/contents/{+path}","compare_url":"https://api.github.com/repos/alv-ch/jobroom2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alv-ch/jobroom2/merges","archive_url":"https://api.github.com/repos/alv-ch/jobroom2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alv-ch/jobroom2/downloads","issues_url":"https://api.github.com/repos/alv-ch/jobroom2/issues{/number}","pulls_url":"https://api.github.com/repos/alv-ch/jobroom2/pulls{/number}","milestones_url":"https://api.github.com/repos/alv-ch/jobroom2/milestones{/number}","notifications_url":"https://api.github.com/repos/alv-ch/jobroom2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alv-ch/jobroom2/labels{/name}","releases_url":"https://api.github.com/repos/alv-ch/jobroom2/releases{/id}","deployments_url":"https://api.github.com/repos/alv-ch/jobroom2/deployments","created_at":"2014-03-26T20:56:10Z","updated_at":"2018-05-08T07:45:05Z","pushed_at":"2018-05-08T11:53:49Z","git_url":"git://github.com/alv-ch/jobroom2.git","ssh_url":"git@github.com:alv-ch/jobroom2.git","clone_url":"https://github.com/alv-ch/jobroom2.git","svn_url":"https://github.com/alv-ch/jobroom2","homepage":"","size":8296,"stargazers_count":2,"watchers_count":2,"language":"TypeScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":3,"open_issues":2,"watchers":2,"default_branch":"develop"}},"base":{"label":"alv-ch:develop","ref":"develop","sha":"14ab207b76406efba1d8f0bc51a057994aa31e5d","user":{"login":"alv-ch","id":7008756,"avatar_url":"https://avatars0.githubusercontent.com/u/7008756?v=4","gravatar_id":"","url":"https://api.github.com/users/alv-ch","html_url":"https://github.com/alv-ch","followers_url":"https://api.github.com/users/alv-ch/followers","following_url":"https://api.github.com/users/alv-ch/following{/other_user}","gists_url":"https://api.github.com/users/alv-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/alv-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alv-ch/subscriptions","organizations_url":"https://api.github.com/users/alv-ch/orgs","repos_url":"https://api.github.com/users/alv-ch/repos","events_url":"https://api.github.com/users/alv-ch/events{/privacy}","received_events_url":"https://api.github.com/users/alv-ch/received_events","type":"Organization","site_admin":false},"repo":{"id":18153573,"name":"jobroom2","full_name":"alv-ch/jobroom2","owner":{"login":"alv-ch","id":7008756,"avatar_url":"https://avatars0.githubusercontent.com/u/7008756?v=4","gravatar_id":"","url":"https://api.github.com/users/alv-ch","html_url":"https://github.com/alv-ch","followers_url":"https://api.github.com/users/alv-ch/followers","following_url":"https://api.github.com/users/alv-ch/following{/other_user}","gists_url":"https://api.github.com/users/alv-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/alv-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alv-ch/subscriptions","organizations_url":"https://api.github.com/users/alv-ch/orgs","repos_url":"https://api.github.com/users/alv-ch/repos","events_url":"https://api.github.com/users/alv-ch/events{/privacy}","received_events_url":"https://api.github.com/users/alv-ch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alv-ch/jobroom2","description":"Future web gateway of www.job-room.ch","fork":false,"url":"https://api.github.com/repos/alv-ch/jobroom2","forks_url":"https://api.github.com/repos/alv-ch/jobroom2/forks","keys_url":"https://api.github.com/repos/alv-ch/jobroom2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alv-ch/jobroom2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alv-ch/jobroom2/teams","hooks_url":"https://api.github.com/repos/alv-ch/jobroom2/hooks","issue_events_url":"https://api.github.com/repos/alv-ch/jobroom2/issues/events{/number}","events_url":"https://api.github.com/repos/alv-ch/jobroom2/events","assignees_url":"https://api.github.com/repos/alv-ch/jobroom2/assignees{/user}","branches_url":"https://api.github.com/repos/alv-ch/jobroom2/branches{/branch}","tags_url":"https://api.github.com/repos/alv-ch/jobroom2/tags","blobs_url":"https://api.github.com/repos/alv-ch/jobroom2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alv-ch/jobroom2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alv-ch/jobroom2/git/refs{/sha}","trees_url":"https://api.github.com/repos/alv-ch/jobroom2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alv-ch/jobroom2/statuses/{sha}","languages_url":"https://api.github.com/repos/alv-ch/jobroom2/languages","stargazers_url":"https://api.github.com/repos/alv-ch/jobroom2/stargazers","contributors_url":"https://api.github.com/repos/alv-ch/jobroom2/contributors","subscribers_url":"https://api.github.com/repos/alv-ch/jobroom2/subscribers","subscription_url":"https://api.github.com/repos/alv-ch/jobroom2/subscription","commits_url":"https://api.github.com/repos/alv-ch/jobroom2/commits{/sha}","git_commits_url":"https://api.github.com/repos/alv-ch/jobroom2/git/commits{/sha}","comments_url":"https://api.github.com/repos/alv-ch/jobroom2/comments{/number}","issue_comment_url":"https://api.github.com/repos/alv-ch/jobroom2/issues/comments{/number}","contents_url":"https://api.github.com/repos/alv-ch/jobroom2/contents/{+path}","compare_url":"https://api.github.com/repos/alv-ch/jobroom2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alv-ch/jobroom2/merges","archive_url":"https://api.github.com/repos/alv-ch/jobroom2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alv-ch/jobroom2/downloads","issues_url":"https://api.github.com/repos/alv-ch/jobroom2/issues{/number}","pulls_url":"https://api.github.com/repos/alv-ch/jobroom2/pulls{/number}","milestones_url":"https://api.github.com/repos/alv-ch/jobroom2/milestones{/number}","notifications_url":"https://api.github.com/repos/alv-ch/jobroom2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alv-ch/jobroom2/labels{/name}","releases_url":"https://api.github.com/repos/alv-ch/jobroom2/releases{/id}","deployments_url":"https://api.github.com/repos/alv-ch/jobroom2/deployments","created_at":"2014-03-26T20:56:10Z","updated_at":"2018-05-08T07:45:05Z","pushed_at":"2018-05-08T11:53:49Z","git_url":"git://github.com/alv-ch/jobroom2.git","ssh_url":"git@github.com:alv-ch/jobroom2.git","clone_url":"https://github.com/alv-ch/jobroom2.git","svn_url":"https://github.com/alv-ch/jobroom2","homepage":"","size":8296,"stargazers_count":2,"watchers_count":2,"language":"TypeScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":3,"open_issues":2,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/alv-ch/jobroom2/pulls/545"},"html":{"href":"https://github.com/alv-ch/jobroom2/pull/545"},"issue":{"href":"https://api.github.com/repos/alv-ch/jobroom2/issues/545"},"comments":{"href":"https://api.github.com/repos/alv-ch/jobroom2/issues/545/comments"},"review_comments":{"href":"https://api.github.com/repos/alv-ch/jobroom2/pulls/545/comments"},"review_comment":{"href":"https://api.github.com/repos/alv-ch/jobroom2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alv-ch/jobroom2/pulls/545/commits"},"statuses":{"href":"https://api.github.com/repos/alv-ch/jobroom2/statuses/de790c022b74cf972ea8ba21378cdb257b86bb95"}},"author_association":"NONE"}}
{"actor":{"display_login":"wwebec"}}