{"action":"created","comment":{"url":"https://api.github.com/repos/eclipse/smarthome/pulls/comments/138072123","pull_request_review_id":61820551,"id":138072123,"diff_hunk":"@@ -0,0 +1,87 @@\n+/**\n+ * Copyright (c) 2014-2017 by the respective copyright holders.\n+ * All rights reserved. This program and the accompanying materials\n+ * are made available under the terms of the Eclipse Public License v1.0\n+ * which accompanies this distribution, and is available at\n+ * http://www.eclipse.org/legal/epl-v10.html\n+ */\n+package org.eclipse.smarthome.io.console.internal.extension;\n+\n+import java.util.Arrays;\n+import java.util.List;\n+\n+import org.eclipse.smarthome.io.console.Console;\n+import org.eclipse.smarthome.io.console.extensions.AbstractConsoleCommandExtension;\n+import org.eclipse.smarthome.io.crypto.Crypto;\n+\n+/**\n+ * Console command extension for crypto module functions.\n+ *\n+ * @author Pauli Anttila - Initial contribution\n+ *\n+ */\n+public class CryptoConsoleCommandExtension extends AbstractConsoleCommandExtension {\n+\n+    private Crypto crypto;\n+\n+    private static final String SUBCMD_ENCRYPT = \"encrypt\";","path":"bundles/io/org.eclipse.smarthome.io.console/src/main/java/org/eclipse/smarthome/io/console/internal/extension/CryptoConsoleCommandExtension.java","position":27,"original_position":27,"commit_id":"0d01f1d5f815630bbea1a6f63e4c3c2f6b8f9af7","original_commit_id":"0d01f1d5f815630bbea1a6f63e4c3c2f6b8f9af7","user":{"login":"davidgraeff","id":66436,"avatar_url":"https://avatars2.githubusercontent.com/u/66436?v=4","gravatar_id":"","url":"https://api.github.com/users/davidgraeff","html_url":"https://github.com/davidgraeff","followers_url":"https://api.github.com/users/davidgraeff/followers","following_url":"https://api.github.com/users/davidgraeff/following{/other_user}","gists_url":"https://api.github.com/users/davidgraeff/gists{/gist_id}","starred_url":"https://api.github.com/users/davidgraeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidgraeff/subscriptions","organizations_url":"https://api.github.com/users/davidgraeff/orgs","repos_url":"https://api.github.com/users/davidgraeff/repos","events_url":"https://api.github.com/users/davidgraeff/events{/privacy}","received_events_url":"https://api.github.com/users/davidgraeff/received_events","type":"User","site_admin":false},"body":"I would say, per default, all \"password\" context fields are encrypted","created_at":"2017-09-11T13:40:37Z","updated_at":"2017-09-11T13:40:37Z","html_url":"https://github.com/eclipse/smarthome/pull/4169#discussion_r138072123","pull_request_url":"https://api.github.com/repos/eclipse/smarthome/pulls/4169","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/eclipse/smarthome/pulls/comments/138072123"},"html":{"href":"https://github.com/eclipse/smarthome/pull/4169#discussion_r138072123"},"pull_request":{"href":"https://api.github.com/repos/eclipse/smarthome/pulls/4169"}},"in_reply_to_id":138047771},"pull_request":{"url":"https://api.github.com/repos/eclipse/smarthome/pulls/4169","id":138712080,"html_url":"https://github.com/eclipse/smarthome/pull/4169","diff_url":"https://github.com/eclipse/smarthome/pull/4169.diff","patch_url":"https://github.com/eclipse/smarthome/pull/4169.patch","issue_url":"https://api.github.com/repos/eclipse/smarthome/issues/4169","number":4169,"state":"open","locked":false,"title":"POC: Encrypted credentials","user":{"login":"paulianttila","id":5506533,"avatar_url":"https://avatars3.githubusercontent.com/u/5506533?v=4","gravatar_id":"","url":"https://api.github.com/users/paulianttila","html_url":"https://github.com/paulianttila","followers_url":"https://api.github.com/users/paulianttila/followers","following_url":"https://api.github.com/users/paulianttila/following{/other_user}","gists_url":"https://api.github.com/users/paulianttila/gists{/gist_id}","starred_url":"https://api.github.com/users/paulianttila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulianttila/subscriptions","organizations_url":"https://api.github.com/users/paulianttila/orgs","repos_url":"https://api.github.com/users/paulianttila/repos","events_url":"https://api.github.com/users/paulianttila/events{/privacy}","received_events_url":"https://api.github.com/users/paulianttila/received_events","type":"User","site_admin":false},"body":"I quickly tested idea to have encrypted credentials on property files. Idea was to store passphrase in the ENV variable. Or even make it more secure and ask passphrase during startup (currently from karaf console), then passphrase is not stored on target system disk at all but only in RAM. Karaf console command extension can be used to encrypt credentials which can be then stored in property files.\r\n\r\nI also implemented simple crypto action in openHAB side, which could be used to decrypt credentials from rules. In fact, rules was my motivation for this as I use some rules to fetch iPhone location info, but I don't like to have my apple id credentials in plain text format in rule files.\r\n\r\nThis PR is just a POC and starting point for the discussion around the topic.\r\n\r\nSigned-off-by: Pauli Anttila <pauli.anttila@gmail.com>","created_at":"2017-08-31T16:31:38Z","updated_at":"2017-09-11T13:40:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ccd86bff8a6620fbd613bf494cad66a32aef6fa6","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/eclipse/smarthome/pulls/4169/commits","review_comments_url":"https://api.github.com/repos/eclipse/smarthome/pulls/4169/comments","review_comment_url":"https://api.github.com/repos/eclipse/smarthome/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eclipse/smarthome/issues/4169/comments","statuses_url":"https://api.github.com/repos/eclipse/smarthome/statuses/0d01f1d5f815630bbea1a6f63e4c3c2f6b8f9af7","head":{"label":"paulianttila:crypto","ref":"crypto","sha":"0d01f1d5f815630bbea1a6f63e4c3c2f6b8f9af7","user":{"login":"paulianttila","id":5506533,"avatar_url":"https://avatars3.githubusercontent.com/u/5506533?v=4","gravatar_id":"","url":"https://api.github.com/users/paulianttila","html_url":"https://github.com/paulianttila","followers_url":"https://api.github.com/users/paulianttila/followers","following_url":"https://api.github.com/users/paulianttila/following{/other_user}","gists_url":"https://api.github.com/users/paulianttila/gists{/gist_id}","starred_url":"https://api.github.com/users/paulianttila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulianttila/subscriptions","organizations_url":"https://api.github.com/users/paulianttila/orgs","repos_url":"https://api.github.com/users/paulianttila/repos","events_url":"https://api.github.com/users/paulianttila/events{/privacy}","received_events_url":"https://api.github.com/users/paulianttila/received_events","type":"User","site_admin":false},"repo":{"id":28567938,"name":"smarthome","full_name":"paulianttila/smarthome","owner":{"login":"paulianttila","id":5506533,"avatar_url":"https://avatars3.githubusercontent.com/u/5506533?v=4","gravatar_id":"","url":"https://api.github.com/users/paulianttila","html_url":"https://github.com/paulianttila","followers_url":"https://api.github.com/users/paulianttila/followers","following_url":"https://api.github.com/users/paulianttila/following{/other_user}","gists_url":"https://api.github.com/users/paulianttila/gists{/gist_id}","starred_url":"https://api.github.com/users/paulianttila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulianttila/subscriptions","organizations_url":"https://api.github.com/users/paulianttila/orgs","repos_url":"https://api.github.com/users/paulianttila/repos","events_url":"https://api.github.com/users/paulianttila/events{/privacy}","received_events_url":"https://api.github.com/users/paulianttila/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulianttila/smarthome","description":"Eclipse SmartHome project","fork":true,"url":"https://api.github.com/repos/paulianttila/smarthome","forks_url":"https://api.github.com/repos/paulianttila/smarthome/forks","keys_url":"https://api.github.com/repos/paulianttila/smarthome/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulianttila/smarthome/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulianttila/smarthome/teams","hooks_url":"https://api.github.com/repos/paulianttila/smarthome/hooks","issue_events_url":"https://api.github.com/repos/paulianttila/smarthome/issues/events{/number}","events_url":"https://api.github.com/repos/paulianttila/smarthome/events","assignees_url":"https://api.github.com/repos/paulianttila/smarthome/assignees{/user}","branches_url":"https://api.github.com/repos/paulianttila/smarthome/branches{/branch}","tags_url":"https://api.github.com/repos/paulianttila/smarthome/tags","blobs_url":"https://api.github.com/repos/paulianttila/smarthome/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulianttila/smarthome/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulianttila/smarthome/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulianttila/smarthome/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulianttila/smarthome/statuses/{sha}","languages_url":"https://api.github.com/repos/paulianttila/smarthome/languages","stargazers_url":"https://api.github.com/repos/paulianttila/smarthome/stargazers","contributors_url":"https://api.github.com/repos/paulianttila/smarthome/contributors","subscribers_url":"https://api.github.com/repos/paulianttila/smarthome/subscribers","subscription_url":"https://api.github.com/repos/paulianttila/smarthome/subscription","commits_url":"https://api.github.com/repos/paulianttila/smarthome/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulianttila/smarthome/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulianttila/smarthome/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulianttila/smarthome/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulianttila/smarthome/contents/{+path}","compare_url":"https://api.github.com/repos/paulianttila/smarthome/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulianttila/smarthome/merges","archive_url":"https://api.github.com/repos/paulianttila/smarthome/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulianttila/smarthome/downloads","issues_url":"https://api.github.com/repos/paulianttila/smarthome/issues{/number}","pulls_url":"https://api.github.com/repos/paulianttila/smarthome/pulls{/number}","milestones_url":"https://api.github.com/repos/paulianttila/smarthome/milestones{/number}","notifications_url":"https://api.github.com/repos/paulianttila/smarthome/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulianttila/smarthome/labels{/name}","releases_url":"https://api.github.com/repos/paulianttila/smarthome/releases{/id}","deployments_url":"https://api.github.com/repos/paulianttila/smarthome/deployments","created_at":"2014-12-28T17:58:17Z","updated_at":"2014-12-28T17:58:20Z","pushed_at":"2017-09-02T07:22:51Z","git_url":"git://github.com/paulianttila/smarthome.git","ssh_url":"git@github.com:paulianttila/smarthome.git","clone_url":"https://github.com/paulianttila/smarthome.git","svn_url":"https://github.com/paulianttila/smarthome","homepage":null,"size":28510,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"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":"eclipse:master","ref":"master","sha":"028988927a80a7c333799e0b5779ed36047228a6","user":{"login":"eclipse","id":56974,"avatar_url":"https://avatars1.githubusercontent.com/u/56974?v=4","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":15778981,"name":"smarthome","full_name":"eclipse/smarthome","owner":{"login":"eclipse","id":56974,"avatar_url":"https://avatars1.githubusercontent.com/u/56974?v=4","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/smarthome","description":"Eclipse SmartHome™ project","fork":false,"url":"https://api.github.com/repos/eclipse/smarthome","forks_url":"https://api.github.com/repos/eclipse/smarthome/forks","keys_url":"https://api.github.com/repos/eclipse/smarthome/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/smarthome/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/smarthome/teams","hooks_url":"https://api.github.com/repos/eclipse/smarthome/hooks","issue_events_url":"https://api.github.com/repos/eclipse/smarthome/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/smarthome/events","assignees_url":"https://api.github.com/repos/eclipse/smarthome/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/smarthome/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/smarthome/tags","blobs_url":"https://api.github.com/repos/eclipse/smarthome/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/smarthome/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/smarthome/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/smarthome/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/smarthome/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/smarthome/languages","stargazers_url":"https://api.github.com/repos/eclipse/smarthome/stargazers","contributors_url":"https://api.github.com/repos/eclipse/smarthome/contributors","subscribers_url":"https://api.github.com/repos/eclipse/smarthome/subscribers","subscription_url":"https://api.github.com/repos/eclipse/smarthome/subscription","commits_url":"https://api.github.com/repos/eclipse/smarthome/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/smarthome/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/smarthome/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/smarthome/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/smarthome/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/smarthome/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/smarthome/merges","archive_url":"https://api.github.com/repos/eclipse/smarthome/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/smarthome/downloads","issues_url":"https://api.github.com/repos/eclipse/smarthome/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/smarthome/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/smarthome/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/smarthome/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/smarthome/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/smarthome/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/smarthome/deployments","created_at":"2014-01-09T20:47:19Z","updated_at":"2017-09-11T11:16:46Z","pushed_at":"2017-09-11T13:26:42Z","git_url":"git://github.com/eclipse/smarthome.git","ssh_url":"git@github.com:eclipse/smarthome.git","clone_url":"https://github.com/eclipse/smarthome.git","svn_url":"https://github.com/eclipse/smarthome","homepage":"https://www.eclipse.org/smarthome/","size":36717,"stargazers_count":548,"watchers_count":548,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":544,"mirror_url":null,"open_issues_count":323,"forks":544,"open_issues":323,"watchers":548,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eclipse/smarthome/pulls/4169"},"html":{"href":"https://github.com/eclipse/smarthome/pull/4169"},"issue":{"href":"https://api.github.com/repos/eclipse/smarthome/issues/4169"},"comments":{"href":"https://api.github.com/repos/eclipse/smarthome/issues/4169/comments"},"review_comments":{"href":"https://api.github.com/repos/eclipse/smarthome/pulls/4169/comments"},"review_comment":{"href":"https://api.github.com/repos/eclipse/smarthome/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eclipse/smarthome/pulls/4169/commits"},"statuses":{"href":"https://api.github.com/repos/eclipse/smarthome/statuses/0d01f1d5f815630bbea1a6f63e4c3c2f6b8f9af7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"davidgraeff"}}