{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/comments/30873215","id":30873215,"diff_hunk":"@@ -114,15 +114,53 @@ protected Random initialValue() {\n \n             final TreeSet<String> groups = new TreeSet<String>(getGroupIdStrategy());\n             groups.addAll(Arrays.asList(names).subList(1, names.length));\n-            r.put(names[0], groups);\n+\n+            /**\n+             * Truncate the password if set\n+             */\n+            r.put(names[0].split(\"/\")[0], groups);\n         }\n         return r;\n     }\n \n+    /**\n+     * Return the users password if set. Otherwise return an empty string.\n+     * @param username\n+     * @return\n+     */\n+    private String getUserPassword(String username) {\n+        String password = \"\";\n+        for (String line : data.split(\"\\r?\\n\")) {\n+            String s = line.trim();\n+            if (s.isEmpty()) {\n+                continue;\n+            }\n+            String[] names = s.split(\" +\");","path":"src/main/java/org/jenkinsci/plugins/mocksecurityrealm/MockSecurityRealm.java","position":26,"original_position":26,"commit_id":"fa40b4ce43b547bd971832e4921065a5dab1302c","original_commit_id":"fa40b4ce43b547bd971832e4921065a5dab1302c","user":{"login":"oleg-nenashev","id":3000480,"avatar_url":"https://avatars.githubusercontent.com/u/3000480?v=3","gravatar_id":"","url":"https://api.github.com/users/oleg-nenashev","html_url":"https://github.com/oleg-nenashev","followers_url":"https://api.github.com/users/oleg-nenashev/followers","following_url":"https://api.github.com/users/oleg-nenashev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-nenashev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-nenashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-nenashev/subscriptions","organizations_url":"https://api.github.com/users/oleg-nenashev/orgs","repos_url":"https://api.github.com/users/oleg-nenashev/repos","events_url":"https://api.github.com/users/oleg-nenashev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-nenashev/received_events","type":"User","site_admin":false},"body":"Sorry, I'm still migrating from C#, which does not uses regex by default","created_at":"2015-05-22T07:06:34Z","updated_at":"2015-05-22T07:06:34Z","html_url":"https://github.com/jenkinsci/mock-security-realm-plugin/pull/1#discussion_r30873215","pull_request_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/comments/30873215"},"html":{"href":"https://github.com/jenkinsci/mock-security-realm-plugin/pull/1#discussion_r30873215"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/1","id":36004048,"html_url":"https://github.com/jenkinsci/mock-security-realm-plugin/pull/1","diff_url":"https://github.com/jenkinsci/mock-security-realm-plugin/pull/1.diff","patch_url":"https://github.com/jenkinsci/mock-security-realm-plugin/pull/1.patch","issue_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/issues/1","number":1,"state":"open","locked":false,"title":"Added support to add a password explicitly","user":{"login":"uaarkoti","id":340391,"avatar_url":"https://avatars.githubusercontent.com/u/340391?v=3","gravatar_id":"","url":"https://api.github.com/users/uaarkoti","html_url":"https://github.com/uaarkoti","followers_url":"https://api.github.com/users/uaarkoti/followers","following_url":"https://api.github.com/users/uaarkoti/following{/other_user}","gists_url":"https://api.github.com/users/uaarkoti/gists{/gist_id}","starred_url":"https://api.github.com/users/uaarkoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uaarkoti/subscriptions","organizations_url":"https://api.github.com/users/uaarkoti/orgs","repos_url":"https://api.github.com/users/uaarkoti/repos","events_url":"https://api.github.com/users/uaarkoti/events{/privacy}","received_events_url":"https://api.github.com/users/uaarkoti/received_events","type":"User","site_admin":false},"body":"While mock security realm is only meant for development and test environments, for some users, even in those environments weak passwords are not allowed. \r\n\r\nThis will allow users to create temporary passwords that will pass internal security requirements.","created_at":"2015-05-22T06:38:33Z","updated_at":"2015-05-22T07:06:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82649e97a385048812fa7434d5522e9df612a932","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/issues/1/comments","statuses_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/statuses/fa40b4ce43b547bd971832e4921065a5dab1302c","head":{"label":"uaarkoti:master","ref":"master","sha":"fa40b4ce43b547bd971832e4921065a5dab1302c","user":{"login":"uaarkoti","id":340391,"avatar_url":"https://avatars.githubusercontent.com/u/340391?v=3","gravatar_id":"","url":"https://api.github.com/users/uaarkoti","html_url":"https://github.com/uaarkoti","followers_url":"https://api.github.com/users/uaarkoti/followers","following_url":"https://api.github.com/users/uaarkoti/following{/other_user}","gists_url":"https://api.github.com/users/uaarkoti/gists{/gist_id}","starred_url":"https://api.github.com/users/uaarkoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uaarkoti/subscriptions","organizations_url":"https://api.github.com/users/uaarkoti/orgs","repos_url":"https://api.github.com/users/uaarkoti/repos","events_url":"https://api.github.com/users/uaarkoti/events{/privacy}","received_events_url":"https://api.github.com/users/uaarkoti/received_events","type":"User","site_admin":false},"repo":{"id":35989849,"name":"mock-security-realm-plugin","full_name":"uaarkoti/mock-security-realm-plugin","owner":{"login":"uaarkoti","id":340391,"avatar_url":"https://avatars.githubusercontent.com/u/340391?v=3","gravatar_id":"","url":"https://api.github.com/users/uaarkoti","html_url":"https://github.com/uaarkoti","followers_url":"https://api.github.com/users/uaarkoti/followers","following_url":"https://api.github.com/users/uaarkoti/following{/other_user}","gists_url":"https://api.github.com/users/uaarkoti/gists{/gist_id}","starred_url":"https://api.github.com/users/uaarkoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uaarkoti/subscriptions","organizations_url":"https://api.github.com/users/uaarkoti/orgs","repos_url":"https://api.github.com/users/uaarkoti/repos","events_url":"https://api.github.com/users/uaarkoti/events{/privacy}","received_events_url":"https://api.github.com/users/uaarkoti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/uaarkoti/mock-security-realm-plugin","description":"","fork":true,"url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin","forks_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/forks","keys_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/teams","hooks_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/hooks","issue_events_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/events","assignees_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/tags","blobs_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/languages","stargazers_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/stargazers","contributors_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/contributors","subscribers_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/subscribers","subscription_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/subscription","commits_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/merges","archive_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/downloads","issues_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/labels{/name}","releases_url":"https://api.github.com/repos/uaarkoti/mock-security-realm-plugin/releases{/id}","created_at":"2015-05-21T03:55:48Z","updated_at":"2015-05-21T03:55:48Z","pushed_at":"2015-05-22T06:34:59Z","git_url":"git://github.com/uaarkoti/mock-security-realm-plugin.git","ssh_url":"git@github.com:uaarkoti/mock-security-realm-plugin.git","clone_url":"https://github.com/uaarkoti/mock-security-realm-plugin.git","svn_url":"https://github.com/uaarkoti/mock-security-realm-plugin","homepage":"","size":98,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"jenkinsci:master","ref":"master","sha":"de4556f0d48592ead90a61dfb2b93ceb6a78d2f1","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":6234674,"name":"mock-security-realm-plugin","full_name":"jenkinsci/mock-security-realm-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/mock-security-realm-plugin","description":"","fork":false,"url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin","forks_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/releases{/id}","created_at":"2012-10-15T21:30:03Z","updated_at":"2014-11-18T16:15:16Z","pushed_at":"2015-05-22T06:38:34Z","git_url":"git://github.com/jenkinsci/mock-security-realm-plugin.git","ssh_url":"git@github.com:jenkinsci/mock-security-realm-plugin.git","clone_url":"https://github.com/jenkinsci/mock-security-realm-plugin.git","svn_url":"https://github.com/jenkinsci/mock-security-realm-plugin","homepage":"","size":256,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/1"},"html":{"href":"https://github.com/jenkinsci/mock-security-realm-plugin/pull/1"},"issue":{"href":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/issues/1"},"comments":{"href":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/mock-security-realm-plugin/statuses/fa40b4ce43b547bd971832e4921065a5dab1302c"}}}}