{"action":"created","comment":{"url":"https://api.github.com/repos/openT2T/translators/pulls/comments/112689588","pull_request_review_id":34025515,"id":112689588,"diff_hunk":"@@ -202,26 +214,35 @@ def unregisterDeviceChange() {\n \t\thttpError(500, \"something went wrong: $e\")\n \t}\n \n-\tlog.info \"Current subscription map is ${state.deviceSubscriptionMap}\" \n+\tlog.info \"Current subscription map is ${state.deviceSubscriptionMap}\"\n+    log.info \"Current verification key map is ${state.verificationKeyMap}\"\n }\n \n //Endpoints function: Subscribe to device additiona/removal updated in a location\n def registerDeviceGraph() {\n \tdef subscriptionEndpt = params.subscriptionURL\n-\n+    \n     if (subscriptionEndpt != null && subscriptionEndpt != \"undefined\"){\n         subscribe(location, \"DeviceCreated\", locationEventHandler, [filterEvents: false])\n         subscribe(location, \"DeviceUpdated\", locationEventHandler, [filterEvents: false])\n         subscribe(location, \"DeviceDeleted\", locationEventHandler, [filterEvents: false])\n \n     \tif(state.locationSubscriptionMap[location.id] == null){\n             state.locationSubscriptionMap.put(location.id, [subscriptionEndpt])\n-            log.info \"Added subscription URL: ${subscriptionEndpt} for Location ${location.name}\"\n         }else if (!state.locationSubscriptionMap[location.id].contains(subscriptionEndpt)){\n             state.locationSubscriptionMap[location.id] << subscriptionEndpt\n-            log.info \"Added subscription URL: ${subscriptionEndpt} for Location ${location.name}\"\n         }\n+        \n+        if(params.key != null){\n+            if(state.verificationKeyMap[subscriptionEndpt] == null){\n+                state.verificationKeyMap.put(subscriptionEndpt, params.key)","path":"org.opent2t.sample.hub.superpopular/com.smartthings.hub/js/groovy/SmartApp.groovy","position":null,"original_position":112,"commit_id":"211c522b905f3cc14e58860d164a8c374b79b731","original_commit_id":"e1711a62cbf91500bec632e992e9548f28dc76c0","user":{"login":"m-chau","id":14900903,"avatar_url":"https://avatars3.githubusercontent.com/u/14900903?v=3","gravatar_id":"","url":"https://api.github.com/users/m-chau","html_url":"https://github.com/m-chau","followers_url":"https://api.github.com/users/m-chau/followers","following_url":"https://api.github.com/users/m-chau/following{/other_user}","gists_url":"https://api.github.com/users/m-chau/gists{/gist_id}","starred_url":"https://api.github.com/users/m-chau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-chau/subscriptions","organizations_url":"https://api.github.com/users/m-chau/orgs","repos_url":"https://api.github.com/users/m-chau/repos","events_url":"https://api.github.com/users/m-chau/events{/privacy}","received_events_url":"https://api.github.com/users/m-chau/received_events","type":"User","site_admin":false},"body":"The \"params.key != null\" is. I realized there is some code duplication, so the updated version should fix it.\r\nThe backwards compatibility part is also at line 295 and 328.\r\n\r\n---\r\nIn reply to: [112324653](https://github.com/openT2T/translators/pull/234#discussion_r112324653) [](ancestors = 112324653)","created_at":"2017-04-21T13:42:22Z","updated_at":"2017-04-21T13:42:22Z","html_url":"https://github.com/openT2T/translators/pull/234#discussion_r112689588","pull_request_url":"https://api.github.com/repos/openT2T/translators/pulls/234","_links":{"self":{"href":"https://api.github.com/repos/openT2T/translators/pulls/comments/112689588"},"html":{"href":"https://github.com/openT2T/translators/pull/234#discussion_r112689588"},"pull_request":{"href":"https://api.github.com/repos/openT2T/translators/pulls/234"}}},"pull_request":{"url":"https://api.github.com/repos/openT2T/translators/pulls/234","id":116513359,"html_url":"https://github.com/openT2T/translators/pull/234","diff_url":"https://github.com/openT2T/translators/pull/234.diff","patch_url":"https://github.com/openT2T/translators/pull/234.patch","issue_url":"https://api.github.com/repos/openT2T/translators/issues/234","number":234,"state":"open","locked":false,"title":"Add HMAC verification support for SmartThings","user":{"login":"m-chau","id":14900903,"avatar_url":"https://avatars3.githubusercontent.com/u/14900903?v=3","gravatar_id":"","url":"https://api.github.com/users/m-chau","html_url":"https://github.com/m-chau","followers_url":"https://api.github.com/users/m-chau/followers","following_url":"https://api.github.com/users/m-chau/following{/other_user}","gists_url":"https://api.github.com/users/m-chau/gists{/gist_id}","starred_url":"https://api.github.com/users/m-chau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-chau/subscriptions","organizations_url":"https://api.github.com/users/m-chau/orgs","repos_url":"https://api.github.com/users/m-chau/repos","events_url":"https://api.github.com/users/m-chau/events{/privacy}","received_events_url":"https://api.github.com/users/m-chau/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-04-19T10:15:05Z","updated_at":"2017-04-21T13:42:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3a97814428f2d4f881ca5d4dcb2b780d6cb2c18","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openT2T/translators/pulls/234/commits","review_comments_url":"https://api.github.com/repos/openT2T/translators/pulls/234/comments","review_comment_url":"https://api.github.com/repos/openT2T/translators/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openT2T/translators/issues/234/comments","statuses_url":"https://api.github.com/repos/openT2T/translators/statuses/211c522b905f3cc14e58860d164a8c374b79b731","head":{"label":"m-chau:STSubscription","ref":"STSubscription","sha":"211c522b905f3cc14e58860d164a8c374b79b731","user":{"login":"m-chau","id":14900903,"avatar_url":"https://avatars3.githubusercontent.com/u/14900903?v=3","gravatar_id":"","url":"https://api.github.com/users/m-chau","html_url":"https://github.com/m-chau","followers_url":"https://api.github.com/users/m-chau/followers","following_url":"https://api.github.com/users/m-chau/following{/other_user}","gists_url":"https://api.github.com/users/m-chau/gists{/gist_id}","starred_url":"https://api.github.com/users/m-chau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-chau/subscriptions","organizations_url":"https://api.github.com/users/m-chau/orgs","repos_url":"https://api.github.com/users/m-chau/repos","events_url":"https://api.github.com/users/m-chau/events{/privacy}","received_events_url":"https://api.github.com/users/m-chau/received_events","type":"User","site_admin":false},"repo":{"id":67580298,"name":"translators","full_name":"m-chau/translators","owner":{"login":"m-chau","id":14900903,"avatar_url":"https://avatars3.githubusercontent.com/u/14900903?v=3","gravatar_id":"","url":"https://api.github.com/users/m-chau","html_url":"https://github.com/m-chau","followers_url":"https://api.github.com/users/m-chau/followers","following_url":"https://api.github.com/users/m-chau/following{/other_user}","gists_url":"https://api.github.com/users/m-chau/gists{/gist_id}","starred_url":"https://api.github.com/users/m-chau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-chau/subscriptions","organizations_url":"https://api.github.com/users/m-chau/orgs","repos_url":"https://api.github.com/users/m-chau/repos","events_url":"https://api.github.com/users/m-chau/events{/privacy}","received_events_url":"https://api.github.com/users/m-chau/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/m-chau/translators","description":"Repository for Open Translators to Things. ","fork":true,"url":"https://api.github.com/repos/m-chau/translators","forks_url":"https://api.github.com/repos/m-chau/translators/forks","keys_url":"https://api.github.com/repos/m-chau/translators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m-chau/translators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m-chau/translators/teams","hooks_url":"https://api.github.com/repos/m-chau/translators/hooks","issue_events_url":"https://api.github.com/repos/m-chau/translators/issues/events{/number}","events_url":"https://api.github.com/repos/m-chau/translators/events","assignees_url":"https://api.github.com/repos/m-chau/translators/assignees{/user}","branches_url":"https://api.github.com/repos/m-chau/translators/branches{/branch}","tags_url":"https://api.github.com/repos/m-chau/translators/tags","blobs_url":"https://api.github.com/repos/m-chau/translators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m-chau/translators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m-chau/translators/git/refs{/sha}","trees_url":"https://api.github.com/repos/m-chau/translators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m-chau/translators/statuses/{sha}","languages_url":"https://api.github.com/repos/m-chau/translators/languages","stargazers_url":"https://api.github.com/repos/m-chau/translators/stargazers","contributors_url":"https://api.github.com/repos/m-chau/translators/contributors","subscribers_url":"https://api.github.com/repos/m-chau/translators/subscribers","subscription_url":"https://api.github.com/repos/m-chau/translators/subscription","commits_url":"https://api.github.com/repos/m-chau/translators/commits{/sha}","git_commits_url":"https://api.github.com/repos/m-chau/translators/git/commits{/sha}","comments_url":"https://api.github.com/repos/m-chau/translators/comments{/number}","issue_comment_url":"https://api.github.com/repos/m-chau/translators/issues/comments{/number}","contents_url":"https://api.github.com/repos/m-chau/translators/contents/{+path}","compare_url":"https://api.github.com/repos/m-chau/translators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m-chau/translators/merges","archive_url":"https://api.github.com/repos/m-chau/translators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m-chau/translators/downloads","issues_url":"https://api.github.com/repos/m-chau/translators/issues{/number}","pulls_url":"https://api.github.com/repos/m-chau/translators/pulls{/number}","milestones_url":"https://api.github.com/repos/m-chau/translators/milestones{/number}","notifications_url":"https://api.github.com/repos/m-chau/translators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m-chau/translators/labels{/name}","releases_url":"https://api.github.com/repos/m-chau/translators/releases{/id}","deployments_url":"https://api.github.com/repos/m-chau/translators/deployments","created_at":"2016-09-07T06:53:29Z","updated_at":"2016-09-07T06:53:30Z","pushed_at":"2017-04-21T13:35:48Z","git_url":"git://github.com/m-chau/translators.git","ssh_url":"git@github.com:m-chau/translators.git","clone_url":"https://github.com/m-chau/translators.git","svn_url":"https://github.com/m-chau/translators","homepage":"http://www.opentranslatorstothings.org","size":1747,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"openT2T:dev","ref":"dev","sha":"34bfaa45fa2cba94fa83e66fbb5d818c1d9da06c","user":{"login":"openT2T","id":17659874,"avatar_url":"https://avatars3.githubusercontent.com/u/17659874?v=3","gravatar_id":"","url":"https://api.github.com/users/openT2T","html_url":"https://github.com/openT2T","followers_url":"https://api.github.com/users/openT2T/followers","following_url":"https://api.github.com/users/openT2T/following{/other_user}","gists_url":"https://api.github.com/users/openT2T/gists{/gist_id}","starred_url":"https://api.github.com/users/openT2T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openT2T/subscriptions","organizations_url":"https://api.github.com/users/openT2T/orgs","repos_url":"https://api.github.com/users/openT2T/repos","events_url":"https://api.github.com/users/openT2T/events{/privacy}","received_events_url":"https://api.github.com/users/openT2T/received_events","type":"Organization","site_admin":false},"repo":{"id":55200869,"name":"translators","full_name":"openT2T/translators","owner":{"login":"openT2T","id":17659874,"avatar_url":"https://avatars3.githubusercontent.com/u/17659874?v=3","gravatar_id":"","url":"https://api.github.com/users/openT2T","html_url":"https://github.com/openT2T","followers_url":"https://api.github.com/users/openT2T/followers","following_url":"https://api.github.com/users/openT2T/following{/other_user}","gists_url":"https://api.github.com/users/openT2T/gists{/gist_id}","starred_url":"https://api.github.com/users/openT2T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openT2T/subscriptions","organizations_url":"https://api.github.com/users/openT2T/orgs","repos_url":"https://api.github.com/users/openT2T/repos","events_url":"https://api.github.com/users/openT2T/events{/privacy}","received_events_url":"https://api.github.com/users/openT2T/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openT2T/translators","description":"Repository for Open Translators to Things. ","fork":false,"url":"https://api.github.com/repos/openT2T/translators","forks_url":"https://api.github.com/repos/openT2T/translators/forks","keys_url":"https://api.github.com/repos/openT2T/translators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openT2T/translators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openT2T/translators/teams","hooks_url":"https://api.github.com/repos/openT2T/translators/hooks","issue_events_url":"https://api.github.com/repos/openT2T/translators/issues/events{/number}","events_url":"https://api.github.com/repos/openT2T/translators/events","assignees_url":"https://api.github.com/repos/openT2T/translators/assignees{/user}","branches_url":"https://api.github.com/repos/openT2T/translators/branches{/branch}","tags_url":"https://api.github.com/repos/openT2T/translators/tags","blobs_url":"https://api.github.com/repos/openT2T/translators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openT2T/translators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openT2T/translators/git/refs{/sha}","trees_url":"https://api.github.com/repos/openT2T/translators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openT2T/translators/statuses/{sha}","languages_url":"https://api.github.com/repos/openT2T/translators/languages","stargazers_url":"https://api.github.com/repos/openT2T/translators/stargazers","contributors_url":"https://api.github.com/repos/openT2T/translators/contributors","subscribers_url":"https://api.github.com/repos/openT2T/translators/subscribers","subscription_url":"https://api.github.com/repos/openT2T/translators/subscription","commits_url":"https://api.github.com/repos/openT2T/translators/commits{/sha}","git_commits_url":"https://api.github.com/repos/openT2T/translators/git/commits{/sha}","comments_url":"https://api.github.com/repos/openT2T/translators/comments{/number}","issue_comment_url":"https://api.github.com/repos/openT2T/translators/issues/comments{/number}","contents_url":"https://api.github.com/repos/openT2T/translators/contents/{+path}","compare_url":"https://api.github.com/repos/openT2T/translators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openT2T/translators/merges","archive_url":"https://api.github.com/repos/openT2T/translators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openT2T/translators/downloads","issues_url":"https://api.github.com/repos/openT2T/translators/issues{/number}","pulls_url":"https://api.github.com/repos/openT2T/translators/pulls{/number}","milestones_url":"https://api.github.com/repos/openT2T/translators/milestones{/number}","notifications_url":"https://api.github.com/repos/openT2T/translators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openT2T/translators/labels{/name}","releases_url":"https://api.github.com/repos/openT2T/translators/releases{/id}","deployments_url":"https://api.github.com/repos/openT2T/translators/deployments","created_at":"2016-04-01T03:25:20Z","updated_at":"2017-03-17T15:39:24Z","pushed_at":"2017-04-21T13:35:50Z","git_url":"git://github.com/openT2T/translators.git","ssh_url":"git@github.com:openT2T/translators.git","clone_url":"https://github.com/openT2T/translators.git","svn_url":"https://github.com/openT2T/translators","homepage":"http://www.opentranslatorstothings.org","size":1739,"stargazers_count":28,"watchers_count":28,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":29,"forks":28,"open_issues":29,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openT2T/translators/pulls/234"},"html":{"href":"https://github.com/openT2T/translators/pull/234"},"issue":{"href":"https://api.github.com/repos/openT2T/translators/issues/234"},"comments":{"href":"https://api.github.com/repos/openT2T/translators/issues/234/comments"},"review_comments":{"href":"https://api.github.com/repos/openT2T/translators/pulls/234/comments"},"review_comment":{"href":"https://api.github.com/repos/openT2T/translators/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openT2T/translators/pulls/234/commits"},"statuses":{"href":"https://api.github.com/repos/openT2T/translators/statuses/211c522b905f3cc14e58860d164a8c374b79b731"}}}}
{"actor":{"display_login":"m-chau"}}