{"action":"created","comment":{"url":"https://api.github.com/repos/openstf/stf/pulls/comments/46434075","id":46434075,"diff_hunk":"@@ -334,6 +336,38 @@ module.exports = function(options) {\n         .on('user.settings.reset', function() {\n           dbapi.resetUserSettings(user.email)\n         })\n+        .on('user.keys.accessToken.generate', function(data) {\n+          var expiry = Date.now() + 100 * 365 * 24 * 3600","path":"lib/units/websocket/index.js","position":21,"original_position":21,"commit_id":"9cb231391a60a85e5c3a72d2b8f4851901ea4f32","original_commit_id":"9cb231391a60a85e5c3a72d2b8f4851901ea4f32","user":{"login":"sorccu","id":32509,"avatar_url":"https://avatars.githubusercontent.com/u/32509?v=3","gravatar_id":"","url":"https://api.github.com/users/sorccu","html_url":"https://github.com/sorccu","followers_url":"https://api.github.com/users/sorccu/followers","following_url":"https://api.github.com/users/sorccu/following{/other_user}","gists_url":"https://api.github.com/users/sorccu/gists{/gist_id}","starred_url":"https://api.github.com/users/sorccu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorccu/subscriptions","organizations_url":"https://api.github.com/users/sorccu/orgs","repos_url":"https://api.github.com/users/sorccu/repos","events_url":"https://api.github.com/users/sorccu/events{/privacy}","received_events_url":"https://api.github.com/users/sorccu/received_events","type":"User","site_admin":false},"body":"I think we should patch jwtutil instead, since adding clearly unnecessary data is a waste. Currently it adds a default expiry if there's none given, so I understand your choice here. However I would like to either\r\n\r\n1. Remove the default expiry entirely, and simply ensure that it's being added where it's needed.\r\n2. or, if `expiry === null`, then don't add the exp option at all. It would still set the default expiry if expiry isn't given at all (it's `undefined`).\r\n\r\nI think I'd personally prefer option 1. If you can implement it in this PR, that would be great.\r\n\r\nThis would also make the token a bit smaller.","created_at":"2015-12-02T16:10:22Z","updated_at":"2015-12-02T16:10:22Z","html_url":"https://github.com/openstf/stf/pull/190#discussion_r46434075","pull_request_url":"https://api.github.com/repos/openstf/stf/pulls/190","_links":{"self":{"href":"https://api.github.com/repos/openstf/stf/pulls/comments/46434075"},"html":{"href":"https://github.com/openstf/stf/pull/190#discussion_r46434075"},"pull_request":{"href":"https://api.github.com/repos/openstf/stf/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/openstf/stf/pulls/190","id":51826809,"html_url":"https://github.com/openstf/stf/pull/190","diff_url":"https://github.com/openstf/stf/pull/190.diff","patch_url":"https://github.com/openstf/stf/pull/190.patch","issue_url":"https://api.github.com/repos/openstf/stf/issues/190","number":190,"state":"open","locked":false,"title":"Generate Auth Token to access STF API's","user":{"login":"vbanthia","id":7875161,"avatar_url":"https://avatars.githubusercontent.com/u/7875161?v=3","gravatar_id":"","url":"https://api.github.com/users/vbanthia","html_url":"https://github.com/vbanthia","followers_url":"https://api.github.com/users/vbanthia/followers","following_url":"https://api.github.com/users/vbanthia/following{/other_user}","gists_url":"https://api.github.com/users/vbanthia/gists{/gist_id}","starred_url":"https://api.github.com/users/vbanthia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbanthia/subscriptions","organizations_url":"https://api.github.com/users/vbanthia/orgs","repos_url":"https://api.github.com/users/vbanthia/repos","events_url":"https://api.github.com/users/vbanthia/events{/privacy}","received_events_url":"https://api.github.com/users/vbanthia/received_events","type":"User","site_admin":false},"body":"This feature allow user to generate an access token. Using that token users will be able to access STF API.\r\n\r\nUI looks like this.\r\n\r\n ![screen shot 2015-11-26 at 02 44 57](https://cloud.githubusercontent.com/assets/7875161/11404971/45e4124c-93e8-11e5-8e60-86b198633fb0.png)\r\n\r\n![screen shot 2015-11-26 at 02 45 11](https://cloud.githubusercontent.com/assets/7875161/11404999/7f29e6d0-93e8-11e5-86bf-d5cde3e0baf5.png)\r\n\r\n![screen shot 2015-11-26 at 02 46 08](https://cloud.githubusercontent.com/assets/7875161/11405033/ae582f0c-93e8-11e5-9b39-7fa90842ee81.png)\r\n\r\n![screen shot 2015-11-26 at 02 45 36](https://cloud.githubusercontent.com/assets/7875161/11405003/8c1f3854-93e8-11e5-95fc-f963ab9f9810.png)\r\n\r\n![screen shot 2015-11-26 at 02 45 53](https://cloud.githubusercontent.com/assets/7875161/11405069/e1935f40-93e8-11e5-94a5-ac221307a991.png)\r\n\r\n![screen shot 2015-11-26 at 02 46 31](https://cloud.githubusercontent.com/assets/7875161/11405038/b888a236-93e8-11e5-8fcc-9176a9a3929f.png)\r\n\r\n![screen shot 2015-11-26 at 02 46 42](https://cloud.githubusercontent.com/assets/7875161/11405041/ba6c3fae-93e8-11e5-98d4-bd4279170678.png)\r\n\r\n![screen shot 2015-11-26 at 02 46 54](https://cloud.githubusercontent.com/assets/7875161/11405045/bd6cb7ba-93e8-11e5-8bb7-da38bb178474.png)\r\n\r\n\r\n","created_at":"2015-11-25T17:54:05Z","updated_at":"2015-12-02T16:10:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8a4cc9bba8302d0754bf95f29587a5f0137df9f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openstf/stf/pulls/190/commits","review_comments_url":"https://api.github.com/repos/openstf/stf/pulls/190/comments","review_comment_url":"https://api.github.com/repos/openstf/stf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openstf/stf/issues/190/comments","statuses_url":"https://api.github.com/repos/openstf/stf/statuses/9cb231391a60a85e5c3a72d2b8f4851901ea4f32","head":{"label":"openstf:auth-token","ref":"auth-token","sha":"9cb231391a60a85e5c3a72d2b8f4851901ea4f32","user":{"login":"openstf","id":12196621,"avatar_url":"https://avatars.githubusercontent.com/u/12196621?v=3","gravatar_id":"","url":"https://api.github.com/users/openstf","html_url":"https://github.com/openstf","followers_url":"https://api.github.com/users/openstf/followers","following_url":"https://api.github.com/users/openstf/following{/other_user}","gists_url":"https://api.github.com/users/openstf/gists{/gist_id}","starred_url":"https://api.github.com/users/openstf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstf/subscriptions","organizations_url":"https://api.github.com/users/openstf/orgs","repos_url":"https://api.github.com/users/openstf/repos","events_url":"https://api.github.com/users/openstf/events{/privacy}","received_events_url":"https://api.github.com/users/openstf/received_events","type":"Organization","site_admin":false},"repo":{"id":37834277,"name":"stf","full_name":"openstf/stf","owner":{"login":"openstf","id":12196621,"avatar_url":"https://avatars.githubusercontent.com/u/12196621?v=3","gravatar_id":"","url":"https://api.github.com/users/openstf","html_url":"https://github.com/openstf","followers_url":"https://api.github.com/users/openstf/followers","following_url":"https://api.github.com/users/openstf/following{/other_user}","gists_url":"https://api.github.com/users/openstf/gists{/gist_id}","starred_url":"https://api.github.com/users/openstf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstf/subscriptions","organizations_url":"https://api.github.com/users/openstf/orgs","repos_url":"https://api.github.com/users/openstf/repos","events_url":"https://api.github.com/users/openstf/events{/privacy}","received_events_url":"https://api.github.com/users/openstf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openstf/stf","description":"Control and manage Android devices from your browser.","fork":false,"url":"https://api.github.com/repos/openstf/stf","forks_url":"https://api.github.com/repos/openstf/stf/forks","keys_url":"https://api.github.com/repos/openstf/stf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openstf/stf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openstf/stf/teams","hooks_url":"https://api.github.com/repos/openstf/stf/hooks","issue_events_url":"https://api.github.com/repos/openstf/stf/issues/events{/number}","events_url":"https://api.github.com/repos/openstf/stf/events","assignees_url":"https://api.github.com/repos/openstf/stf/assignees{/user}","branches_url":"https://api.github.com/repos/openstf/stf/branches{/branch}","tags_url":"https://api.github.com/repos/openstf/stf/tags","blobs_url":"https://api.github.com/repos/openstf/stf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openstf/stf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openstf/stf/git/refs{/sha}","trees_url":"https://api.github.com/repos/openstf/stf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openstf/stf/statuses/{sha}","languages_url":"https://api.github.com/repos/openstf/stf/languages","stargazers_url":"https://api.github.com/repos/openstf/stf/stargazers","contributors_url":"https://api.github.com/repos/openstf/stf/contributors","subscribers_url":"https://api.github.com/repos/openstf/stf/subscribers","subscription_url":"https://api.github.com/repos/openstf/stf/subscription","commits_url":"https://api.github.com/repos/openstf/stf/commits{/sha}","git_commits_url":"https://api.github.com/repos/openstf/stf/git/commits{/sha}","comments_url":"https://api.github.com/repos/openstf/stf/comments{/number}","issue_comment_url":"https://api.github.com/repos/openstf/stf/issues/comments{/number}","contents_url":"https://api.github.com/repos/openstf/stf/contents/{+path}","compare_url":"https://api.github.com/repos/openstf/stf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openstf/stf/merges","archive_url":"https://api.github.com/repos/openstf/stf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openstf/stf/downloads","issues_url":"https://api.github.com/repos/openstf/stf/issues{/number}","pulls_url":"https://api.github.com/repos/openstf/stf/pulls{/number}","milestones_url":"https://api.github.com/repos/openstf/stf/milestones{/number}","notifications_url":"https://api.github.com/repos/openstf/stf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openstf/stf/labels{/name}","releases_url":"https://api.github.com/repos/openstf/stf/releases{/id}","created_at":"2015-06-22T02:23:43Z","updated_at":"2015-12-02T11:22:21Z","pushed_at":"2015-12-02T15:23:25Z","git_url":"git://github.com/openstf/stf.git","ssh_url":"git@github.com:openstf/stf.git","clone_url":"https://github.com/openstf/stf.git","svn_url":"https://github.com/openstf/stf","homepage":"https://openstf.io","size":56240,"stargazers_count":2920,"watchers_count":2920,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":243,"mirror_url":null,"open_issues_count":71,"forks":243,"open_issues":71,"watchers":2920,"default_branch":"master"}},"base":{"label":"openstf:master","ref":"master","sha":"ddc24e5dc5eab07292a073d20e3d238f96d1b930","user":{"login":"openstf","id":12196621,"avatar_url":"https://avatars.githubusercontent.com/u/12196621?v=3","gravatar_id":"","url":"https://api.github.com/users/openstf","html_url":"https://github.com/openstf","followers_url":"https://api.github.com/users/openstf/followers","following_url":"https://api.github.com/users/openstf/following{/other_user}","gists_url":"https://api.github.com/users/openstf/gists{/gist_id}","starred_url":"https://api.github.com/users/openstf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstf/subscriptions","organizations_url":"https://api.github.com/users/openstf/orgs","repos_url":"https://api.github.com/users/openstf/repos","events_url":"https://api.github.com/users/openstf/events{/privacy}","received_events_url":"https://api.github.com/users/openstf/received_events","type":"Organization","site_admin":false},"repo":{"id":37834277,"name":"stf","full_name":"openstf/stf","owner":{"login":"openstf","id":12196621,"avatar_url":"https://avatars.githubusercontent.com/u/12196621?v=3","gravatar_id":"","url":"https://api.github.com/users/openstf","html_url":"https://github.com/openstf","followers_url":"https://api.github.com/users/openstf/followers","following_url":"https://api.github.com/users/openstf/following{/other_user}","gists_url":"https://api.github.com/users/openstf/gists{/gist_id}","starred_url":"https://api.github.com/users/openstf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstf/subscriptions","organizations_url":"https://api.github.com/users/openstf/orgs","repos_url":"https://api.github.com/users/openstf/repos","events_url":"https://api.github.com/users/openstf/events{/privacy}","received_events_url":"https://api.github.com/users/openstf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openstf/stf","description":"Control and manage Android devices from your browser.","fork":false,"url":"https://api.github.com/repos/openstf/stf","forks_url":"https://api.github.com/repos/openstf/stf/forks","keys_url":"https://api.github.com/repos/openstf/stf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openstf/stf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openstf/stf/teams","hooks_url":"https://api.github.com/repos/openstf/stf/hooks","issue_events_url":"https://api.github.com/repos/openstf/stf/issues/events{/number}","events_url":"https://api.github.com/repos/openstf/stf/events","assignees_url":"https://api.github.com/repos/openstf/stf/assignees{/user}","branches_url":"https://api.github.com/repos/openstf/stf/branches{/branch}","tags_url":"https://api.github.com/repos/openstf/stf/tags","blobs_url":"https://api.github.com/repos/openstf/stf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openstf/stf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openstf/stf/git/refs{/sha}","trees_url":"https://api.github.com/repos/openstf/stf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openstf/stf/statuses/{sha}","languages_url":"https://api.github.com/repos/openstf/stf/languages","stargazers_url":"https://api.github.com/repos/openstf/stf/stargazers","contributors_url":"https://api.github.com/repos/openstf/stf/contributors","subscribers_url":"https://api.github.com/repos/openstf/stf/subscribers","subscription_url":"https://api.github.com/repos/openstf/stf/subscription","commits_url":"https://api.github.com/repos/openstf/stf/commits{/sha}","git_commits_url":"https://api.github.com/repos/openstf/stf/git/commits{/sha}","comments_url":"https://api.github.com/repos/openstf/stf/comments{/number}","issue_comment_url":"https://api.github.com/repos/openstf/stf/issues/comments{/number}","contents_url":"https://api.github.com/repos/openstf/stf/contents/{+path}","compare_url":"https://api.github.com/repos/openstf/stf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openstf/stf/merges","archive_url":"https://api.github.com/repos/openstf/stf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openstf/stf/downloads","issues_url":"https://api.github.com/repos/openstf/stf/issues{/number}","pulls_url":"https://api.github.com/repos/openstf/stf/pulls{/number}","milestones_url":"https://api.github.com/repos/openstf/stf/milestones{/number}","notifications_url":"https://api.github.com/repos/openstf/stf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openstf/stf/labels{/name}","releases_url":"https://api.github.com/repos/openstf/stf/releases{/id}","created_at":"2015-06-22T02:23:43Z","updated_at":"2015-12-02T11:22:21Z","pushed_at":"2015-12-02T15:23:25Z","git_url":"git://github.com/openstf/stf.git","ssh_url":"git@github.com:openstf/stf.git","clone_url":"https://github.com/openstf/stf.git","svn_url":"https://github.com/openstf/stf","homepage":"https://openstf.io","size":56240,"stargazers_count":2920,"watchers_count":2920,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":243,"mirror_url":null,"open_issues_count":71,"forks":243,"open_issues":71,"watchers":2920,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openstf/stf/pulls/190"},"html":{"href":"https://github.com/openstf/stf/pull/190"},"issue":{"href":"https://api.github.com/repos/openstf/stf/issues/190"},"comments":{"href":"https://api.github.com/repos/openstf/stf/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/openstf/stf/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/openstf/stf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openstf/stf/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/openstf/stf/statuses/9cb231391a60a85e5c3a72d2b8f4851901ea4f32"}}}}