{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/comments/85179902","pull_request_review_id":5910187,"id":85179902,"diff_hunk":"@@ -0,0 +1,83 @@\n+package org.apache.mesos.dcos;\n+\n+import com.google.common.annotations.VisibleForTesting;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import java.io.IOException;\n+import java.nio.file.Files;\n+import java.nio.file.Path;\n+import java.nio.file.Paths;\n+\n+/**\n+ * Facilitates installation of DC/OS cert inside framework's JRE.\n+ */\n+public class DCOSCertInstaller {\n+    private static final Logger LOGGER = LoggerFactory.getLogger(DCOSCertInstaller.class);\n+\n+    public static final String DEFAULT_JRE_KEYSTORE_PASS = \"changeit\";\n+    public static final String CERT_PATH = \".ssl/ca.crt\";\n+\n+    public static boolean installCertificate(String pathToJRE) {\n+        return installCertificate(pathToJRE, new ProcessRunner());\n+    }\n+\n+    @VisibleForTesting\n+    protected static boolean installCertificate(String pathToJRE, ProcessRunner processRunner) {\n+        try {\n+            final Path jrePath = Paths.get(pathToJRE);\n+            // Check if JRE is present, there's nothing to do.\n+            if (!Files.exists(jrePath)) {\n+                LOGGER.info(\"JRE not found at path: {}\", jrePath.toAbsolutePath());","path":"sdk/core/src/main/java/org/apache/mesos/dcos/DCOSCertInstaller.java","position":31,"original_position":31,"commit_id":"4bafa81b8fe3e5ee59a573232863fdd475a6a635","original_commit_id":"4bafa81b8fe3e5ee59a573232863fdd475a6a635","user":{"login":"nickbp","id":35933,"avatar_url":"https://avatars.githubusercontent.com/u/35933?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbp","html_url":"https://github.com/nickbp","followers_url":"https://api.github.com/users/nickbp/followers","following_url":"https://api.github.com/users/nickbp/following{/other_user}","gists_url":"https://api.github.com/users/nickbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbp/subscriptions","organizations_url":"https://api.github.com/users/nickbp/orgs","repos_url":"https://api.github.com/users/nickbp/repos","events_url":"https://api.github.com/users/nickbp/events{/privacy}","received_events_url":"https://api.github.com/users/nickbp/received_events","type":"User","site_admin":false},"body":"error()","created_at":"2016-10-26T17:45:39Z","updated_at":"2016-10-26T17:45:39Z","html_url":"https://github.com/mesosphere/dcos-commons/pull/238#discussion_r85179902","pull_request_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/238","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/comments/85179902"},"html":{"href":"https://github.com/mesosphere/dcos-commons/pull/238#discussion_r85179902"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/238"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/238","id":90867500,"html_url":"https://github.com/mesosphere/dcos-commons/pull/238","diff_url":"https://github.com/mesosphere/dcos-commons/pull/238.diff","patch_url":"https://github.com/mesosphere/dcos-commons/pull/238.patch","issue_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/238","number":238,"state":"open","locked":false,"title":"DCOS Certificate Installer","user":{"login":"mohitsoni","id":102390,"avatar_url":"https://avatars.githubusercontent.com/u/102390?v=3","gravatar_id":"","url":"https://api.github.com/users/mohitsoni","html_url":"https://github.com/mohitsoni","followers_url":"https://api.github.com/users/mohitsoni/followers","following_url":"https://api.github.com/users/mohitsoni/following{/other_user}","gists_url":"https://api.github.com/users/mohitsoni/gists{/gist_id}","starred_url":"https://api.github.com/users/mohitsoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohitsoni/subscriptions","organizations_url":"https://api.github.com/users/mohitsoni/orgs","repos_url":"https://api.github.com/users/mohitsoni/repos","events_url":"https://api.github.com/users/mohitsoni/events{/privacy}","received_events_url":"https://api.github.com/users/mohitsoni/received_events","type":"User","site_admin":false},"body":"This PR implements a DC/OS certificate installer, which installs the `.ssl/ca.crt` file injected inside the sandbox.","created_at":"2016-10-25T18:44:36Z","updated_at":"2016-10-26T17:45:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8d8c6520890e6bd4bedd7876aea3724ac8988a6","assignee":{"login":"nickbp","id":35933,"avatar_url":"https://avatars.githubusercontent.com/u/35933?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbp","html_url":"https://github.com/nickbp","followers_url":"https://api.github.com/users/nickbp/followers","following_url":"https://api.github.com/users/nickbp/following{/other_user}","gists_url":"https://api.github.com/users/nickbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbp/subscriptions","organizations_url":"https://api.github.com/users/nickbp/orgs","repos_url":"https://api.github.com/users/nickbp/repos","events_url":"https://api.github.com/users/nickbp/events{/privacy}","received_events_url":"https://api.github.com/users/nickbp/received_events","type":"User","site_admin":false},"assignees":[{"login":"nickbp","id":35933,"avatar_url":"https://avatars.githubusercontent.com/u/35933?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbp","html_url":"https://github.com/nickbp","followers_url":"https://api.github.com/users/nickbp/followers","following_url":"https://api.github.com/users/nickbp/following{/other_user}","gists_url":"https://api.github.com/users/nickbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbp/subscriptions","organizations_url":"https://api.github.com/users/nickbp/orgs","repos_url":"https://api.github.com/users/nickbp/repos","events_url":"https://api.github.com/users/nickbp/events{/privacy}","received_events_url":"https://api.github.com/users/nickbp/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/238/commits","review_comments_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/238/comments","review_comment_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/238/comments","statuses_url":"https://api.github.com/repos/mesosphere/dcos-commons/statuses/4bafa81b8fe3e5ee59a573232863fdd475a6a635","head":{"label":"mesosphere:dcos-cert-installer","ref":"dcos-cert-installer","sha":"4bafa81b8fe3e5ee59a573232863fdd475a6a635","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":60286497,"name":"dcos-commons","full_name":"mesosphere/dcos-commons","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-commons","description":null,"fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-commons","forks_url":"https://api.github.com/repos/mesosphere/dcos-commons/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-commons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-commons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-commons/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-commons/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-commons/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-commons/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-commons/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-commons/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-commons/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-commons/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-commons/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-commons/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-commons/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-commons/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-commons/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-commons/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-commons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-commons/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-commons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-commons/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-commons/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-commons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-commons/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-commons/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/dcos-commons/deployments","created_at":"2016-06-02T18:09:08Z","updated_at":"2016-10-24T16:58:44Z","pushed_at":"2016-10-26T17:42:15Z","git_url":"git://github.com/mesosphere/dcos-commons.git","ssh_url":"git@github.com:mesosphere/dcos-commons.git","clone_url":"https://github.com/mesosphere/dcos-commons.git","svn_url":"https://github.com/mesosphere/dcos-commons","homepage":null,"size":17110,"stargazers_count":22,"watchers_count":22,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":14,"forks":14,"open_issues":14,"watchers":22,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"4dabde6a6b91268889171253aed1499d2bd811ea","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":60286497,"name":"dcos-commons","full_name":"mesosphere/dcos-commons","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-commons","description":null,"fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-commons","forks_url":"https://api.github.com/repos/mesosphere/dcos-commons/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-commons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-commons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-commons/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-commons/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-commons/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-commons/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-commons/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-commons/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-commons/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-commons/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-commons/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-commons/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-commons/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-commons/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-commons/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-commons/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-commons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-commons/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-commons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-commons/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-commons/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-commons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-commons/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-commons/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/dcos-commons/deployments","created_at":"2016-06-02T18:09:08Z","updated_at":"2016-10-24T16:58:44Z","pushed_at":"2016-10-26T17:42:15Z","git_url":"git://github.com/mesosphere/dcos-commons.git","ssh_url":"git@github.com:mesosphere/dcos-commons.git","clone_url":"https://github.com/mesosphere/dcos-commons.git","svn_url":"https://github.com/mesosphere/dcos-commons","homepage":null,"size":17110,"stargazers_count":22,"watchers_count":22,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":14,"forks":14,"open_issues":14,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/238"},"html":{"href":"https://github.com/mesosphere/dcos-commons/pull/238"},"issue":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/issues/238"},"comments":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/issues/238/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/238/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/238/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/statuses/4bafa81b8fe3e5ee59a573232863fdd475a6a635"}}}}
{"actor":{"display_login":"nickbp"}}