{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/comments/74363546","id":74363546,"diff_hunk":"@@ -132,34 +146,57 @@\n      * The client secret from the OpenShift server.\n      */\n     private final Secret clientSecret;\n+    \n+    /**\n+     * This map contains defaults gathered for this objects fields when those fields were not set in the UI.\n+     * We don't store our inferred defaults in those fields, because if we do, they will show up in the gui\n+     * When the getters are called.\n+     */\n+    private final Map<String,String> overrides = new HashMap<String,String>();\n+    \n \n     @DataBoundConstructor\n     public OpenShiftOAuth2SecurityRealm(String serviceAccountDirectory, String serviceAccountName, String serverPrefix, String clientId, String clientSecret) throws IOException, GeneralSecurityException {\n         HttpTransport transport = HTTP_TRANSPORT;\n+        \n+        LOGGER.fine(String.format(\"ctor args sa dir %s sa name %s svr prefix %s client id %s client secret %s\", serviceAccountDirectory, serviceAccountName, serverPrefix, clientId, clientSecret));\n \n-        this.serviceAccountDirectory = Util.fixEmpty(serviceAccountDirectory);\n-    \tif (Util.fixEmpty(serviceAccountName) == null)\n-    \t\tthis.serviceAccountName = \"jenkins\";\n-    \telse\n-    \t\tthis.serviceAccountName = serviceAccountName;\n-    \t// TODO: should this be in a different method?  Will this show up in settings page?\n-    \tif (this.serviceAccountDirectory != null) {\n-    \t\tif (Util.fixEmpty(clientSecret) == null) {\n-\t            BufferedReader r = new BufferedReader(new FileReader(new File(this.serviceAccountDirectory, \"token\")));\n-\t            clientSecret = r.readLine();\n+        String fixedServiceAccountDirectory = Util.fixEmpty(serviceAccountDirectory);\n+        String fixedClientId = Util.fixEmpty(clientId);\n+        String fixedClientSecret = Util.fixEmpty(clientSecret);\n+        String fixedServerPrefix = Util.fixEmpty(serverPrefix);\n+        \n+        // decided not to default this since it is not even consistent within OpenShift;\n+        // going through the example instantapp templates, the SA will be \"default\";\n+        // going through the auto generated server, the SA will be \"jenkins\"\n+        this.serviceAccountName = Util.fixEmpty(serviceAccountName);","path":"src/main/java/org/openshift/jenkins/plugins/openshiftlogin/OpenShiftOAuth2SecurityRealm.java","position":null,"original_position":77,"commit_id":"e55279f7bdb2bb93d08f61efab1e0db8e6f57d8b","original_commit_id":"2c7cc23ad8dea53bbdfaf093ea54ea5d7d854700","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"body":"oc get user ~ does not work because the shell expands ~ to $HOME.\n\nOn Wed, Aug 10, 2016 at 1:23 PM, Gabe Montero <notifications@github.com>\nwrote:\n\n> In src/main/java/org/openshift/jenkins/plugins/openshiftlogin/\n> OpenShiftOAuth2SecurityRealm.java\n> <https://github.com/openshift/jenkins-openshift-login-plugin/pull/2#discussion_r74289644>\n> :\n>\n> > -    \telse\n> > -    \t\tthis.serviceAccountName = serviceAccountName;\n> > -    \t// TODO: should this be in a different method?  Will this show up in settings page?\n> > -    \tif (this.serviceAccountDirectory != null) {\n> > -    \t\tif (Util.fixEmpty(clientSecret) == null) {\n> > -\t            BufferedReader r = new BufferedReader(new FileReader(new File(this.serviceAccountDirectory, \"token\")));\n> > -\t            clientSecret = r.readLine();\n> > +        String fixedServiceAccountDirectory = Util.fixEmpty(serviceAccountDirectory);\n> > +        String fixedClientId = Util.fixEmpty(clientId);\n> > +        String fixedClientSecret = Util.fixEmpty(clientSecret);\n> > +        String fixedServerPrefix = Util.fixEmpty(serverPrefix);\n> > +\n> > +        // decided not to default this since it is not even consistent within OpenShift;\n> > +        // going through the example instantapp templates, the SA will be \"default\";\n> > +        // going through the auto generated server, the SA will be \"jenkins\"\n> > +        this.serviceAccountName = Util.fixEmpty(serviceAccountName);\n>\n> OK, oc get user ~ did not work, but oc get user/~ does. That said, the\n> error I was getting when trying in Java was not the same as the command\n> line. I still get permission denied in Java. But using the --loglevel=8\n> output, I should be able to work backwards and get something to work. Might\n> have to ditch the openshift-restclient-java in the process and go with\n> lower level okhttp packages, but no biggie.\n>\n> Thanks.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/openshift/jenkins-openshift-login-plugin/pull/2/files/2c7cc23ad8dea53bbdfaf093ea54ea5d7d854700#r74289644>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ABG_p0jgI1KZH535B272heqvuS94D6Jeks5qegkugaJpZM4Jfdh->\n> .\n>\n","created_at":"2016-08-11T02:52:03Z","updated_at":"2016-08-11T02:52:03Z","html_url":"https://github.com/openshift/jenkins-openshift-login-plugin/pull/2#discussion_r74363546","pull_request_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/comments/74363546"},"html":{"href":"https://github.com/openshift/jenkins-openshift-login-plugin/pull/2#discussion_r74363546"},"pull_request":{"href":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/2","id":80519776,"html_url":"https://github.com/openshift/jenkins-openshift-login-plugin/pull/2","diff_url":"https://github.com/openshift/jenkins-openshift-login-plugin/pull/2.diff","patch_url":"https://github.com/openshift/jenkins-openshift-login-plugin/pull/2.patch","issue_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/issues/2","number":2,"state":"open","locked":false,"title":"Get to work for me","user":{"login":"gabemontero","id":3594868,"avatar_url":"https://avatars.githubusercontent.com/u/3594868?v=3","gravatar_id":"","url":"https://api.github.com/users/gabemontero","html_url":"https://github.com/gabemontero","followers_url":"https://api.github.com/users/gabemontero/followers","following_url":"https://api.github.com/users/gabemontero/following{/other_user}","gists_url":"https://api.github.com/users/gabemontero/gists{/gist_id}","starred_url":"https://api.github.com/users/gabemontero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabemontero/subscriptions","organizations_url":"https://api.github.com/users/gabemontero/orgs","repos_url":"https://api.github.com/users/gabemontero/repos","events_url":"https://api.github.com/users/gabemontero/events{/privacy}","received_events_url":"https://api.github.com/users/gabemontero/received_events","type":"User","site_admin":false},"body":"@smarterclayton PTAL\r\n@bparees @deads2k FYI / PTAL if interested\r\n\r\nThe changes here are for:\r\n1) fix pom version as part of publishing on jenkinsci.org\r\n2) add some debug tracing\r\n3) address TODO around deriving defaults, but not exposing those derived values subsequently in the UI (same basic approach used in the openshift/jenkins-plugin code)","created_at":"2016-08-08T20:51:52Z","updated_at":"2016-08-11T02:52:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d18faf7b86579636ff95ac24ddd4d5b356652fb4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/2/commits","review_comments_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/2/comments","review_comment_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/issues/2/comments","statuses_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/statuses/e55279f7bdb2bb93d08f61efab1e0db8e6f57d8b","head":{"label":"gabemontero:getToWorkForMe","ref":"getToWorkForMe","sha":"e55279f7bdb2bb93d08f61efab1e0db8e6f57d8b","user":{"login":"gabemontero","id":3594868,"avatar_url":"https://avatars.githubusercontent.com/u/3594868?v=3","gravatar_id":"","url":"https://api.github.com/users/gabemontero","html_url":"https://github.com/gabemontero","followers_url":"https://api.github.com/users/gabemontero/followers","following_url":"https://api.github.com/users/gabemontero/following{/other_user}","gists_url":"https://api.github.com/users/gabemontero/gists{/gist_id}","starred_url":"https://api.github.com/users/gabemontero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabemontero/subscriptions","organizations_url":"https://api.github.com/users/gabemontero/orgs","repos_url":"https://api.github.com/users/gabemontero/repos","events_url":"https://api.github.com/users/gabemontero/events{/privacy}","received_events_url":"https://api.github.com/users/gabemontero/received_events","type":"User","site_admin":false},"repo":{"id":61748932,"name":"jenkins-openshift-login-plugin","full_name":"gabemontero/jenkins-openshift-login-plugin","owner":{"login":"gabemontero","id":3594868,"avatar_url":"https://avatars.githubusercontent.com/u/3594868?v=3","gravatar_id":"","url":"https://api.github.com/users/gabemontero","html_url":"https://github.com/gabemontero","followers_url":"https://api.github.com/users/gabemontero/followers","following_url":"https://api.github.com/users/gabemontero/following{/other_user}","gists_url":"https://api.github.com/users/gabemontero/gists{/gist_id}","starred_url":"https://api.github.com/users/gabemontero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabemontero/subscriptions","organizations_url":"https://api.github.com/users/gabemontero/orgs","repos_url":"https://api.github.com/users/gabemontero/repos","events_url":"https://api.github.com/users/gabemontero/events{/privacy}","received_events_url":"https://api.github.com/users/gabemontero/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabemontero/jenkins-openshift-login-plugin","description":"A plugin for integrating OpenShift OAuth into Jenkins","fork":true,"url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin","forks_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/forks","keys_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/teams","hooks_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/hooks","issue_events_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/events","assignees_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/tags","blobs_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/languages","stargazers_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/stargazers","contributors_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/contributors","subscribers_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/subscribers","subscription_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/subscription","commits_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/merges","archive_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/downloads","issues_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/labels{/name}","releases_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/gabemontero/jenkins-openshift-login-plugin/deployments","created_at":"2016-06-22T20:21:35Z","updated_at":"2016-06-22T20:21:36Z","pushed_at":"2016-08-11T01:57:48Z","git_url":"git://github.com/gabemontero/jenkins-openshift-login-plugin.git","ssh_url":"git@github.com:gabemontero/jenkins-openshift-login-plugin.git","clone_url":"https://github.com/gabemontero/jenkins-openshift-login-plugin.git","svn_url":"https://github.com/gabemontero/jenkins-openshift-login-plugin","homepage":null,"size":17,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"openshift:master","ref":"master","sha":"c07bf7d21c6f466856701ea05c348fb79cc478be","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":61512183,"name":"jenkins-openshift-login-plugin","full_name":"openshift/jenkins-openshift-login-plugin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/jenkins-openshift-login-plugin","description":"A plugin for integrating OpenShift OAuth into Jenkins","fork":false,"url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin","forks_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/forks","keys_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/teams","hooks_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/hooks","issue_events_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/events","assignees_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/tags","blobs_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/languages","stargazers_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/stargazers","contributors_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/contributors","subscribers_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/subscribers","subscription_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/subscription","commits_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/merges","archive_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/downloads","issues_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/deployments","created_at":"2016-06-20T02:45:29Z","updated_at":"2016-07-18T16:24:26Z","pushed_at":"2016-08-11T01:57:48Z","git_url":"git://github.com/openshift/jenkins-openshift-login-plugin.git","ssh_url":"git@github.com:openshift/jenkins-openshift-login-plugin.git","clone_url":"https://github.com/openshift/jenkins-openshift-login-plugin.git","svn_url":"https://github.com/openshift/jenkins-openshift-login-plugin","homepage":null,"size":14,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/2"},"html":{"href":"https://github.com/openshift/jenkins-openshift-login-plugin/pull/2"},"issue":{"href":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/issues/2"},"comments":{"href":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/jenkins-openshift-login-plugin/statuses/e55279f7bdb2bb93d08f61efab1e0db8e6f57d8b"}}}}
{"actor":{"display_login":"smarterclayton"}}