{"action":"closed","number":351,"pull_request":{"url":"https://api.github.com/repos/mqttjs/MQTT.js/pulls/351","id":50825213,"html_url":"https://github.com/mqttjs/MQTT.js/pull/351","diff_url":"https://github.com/mqttjs/MQTT.js/pull/351.diff","patch_url":"https://github.com/mqttjs/MQTT.js/pull/351.patch","issue_url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/351","number":351,"state":"closed","locked":false,"title":"Handling wrong authentication.","user":{"login":"roccomuso","id":6730217,"avatar_url":"https://avatars.githubusercontent.com/u/6730217?v=3","gravatar_id":"","url":"https://api.github.com/users/roccomuso","html_url":"https://github.com/roccomuso","followers_url":"https://api.github.com/users/roccomuso/followers","following_url":"https://api.github.com/users/roccomuso/following{/other_user}","gists_url":"https://api.github.com/users/roccomuso/gists{/gist_id}","starred_url":"https://api.github.com/users/roccomuso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roccomuso/subscriptions","organizations_url":"https://api.github.com/users/roccomuso/orgs","repos_url":"https://api.github.com/users/roccomuso/repos","events_url":"https://api.github.com/users/roccomuso/events{/privacy}","received_events_url":"https://api.github.com/users/roccomuso/received_events","type":"User","site_admin":false},"body":"Done: emit an error on console if credentials are wrong, (both for pub and sub).\r\n\r\nTodo: gotta be handled the 'No Authorizations' case.\r\nI did some attempts on sub.js, editing the client.on('connect') callback this way:\r\n\r\n      client.on('connect', function() {\r\n        client.subscribe(args.topic, { qos: args.qos }, function(err, granted){\r\n          if (err){\r\n            console.warn('Error: ', err);\r\n            client.end();\r\n          }else console.log('Granted: ', granted);\r\n        });\r\n\r\nand this is my output on a topic that i'm not authorized to subscribe to:\r\n\r\n    Granted: [ { topic: 'priv8', qos: 128 } ]\r\n\r\nWeird, isn't it? The broker i'm using is Mosca. I'm implementing on Mosca the following functions: authenticate, authorizePublish, authorizeSubscribe.\r\n","created_at":"2015-11-16T15:38:58Z","updated_at":"2016-09-01T15:47:45Z","closed_at":"2016-09-01T15:47:45Z","merged_at":null,"merge_commit_sha":"addbf1e66f6ad0e0cec960ff519c99d0a142164c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mqttjs/MQTT.js/pulls/351/commits","review_comments_url":"https://api.github.com/repos/mqttjs/MQTT.js/pulls/351/comments","review_comment_url":"https://api.github.com/repos/mqttjs/MQTT.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/351/comments","statuses_url":"https://api.github.com/repos/mqttjs/MQTT.js/statuses/19015fd7c59bb11b1bd38976e71dfefd30f3d0c8","head":{"label":"roccomuso:master","ref":"master","sha":"19015fd7c59bb11b1bd38976e71dfefd30f3d0c8","user":{"login":"roccomuso","id":6730217,"avatar_url":"https://avatars.githubusercontent.com/u/6730217?v=3","gravatar_id":"","url":"https://api.github.com/users/roccomuso","html_url":"https://github.com/roccomuso","followers_url":"https://api.github.com/users/roccomuso/followers","following_url":"https://api.github.com/users/roccomuso/following{/other_user}","gists_url":"https://api.github.com/users/roccomuso/gists{/gist_id}","starred_url":"https://api.github.com/users/roccomuso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roccomuso/subscriptions","organizations_url":"https://api.github.com/users/roccomuso/orgs","repos_url":"https://api.github.com/users/roccomuso/repos","events_url":"https://api.github.com/users/roccomuso/events{/privacy}","received_events_url":"https://api.github.com/users/roccomuso/received_events","type":"User","site_admin":false},"repo":{"id":46234938,"name":"MQTT.js","full_name":"roccomuso/MQTT.js","owner":{"login":"roccomuso","id":6730217,"avatar_url":"https://avatars.githubusercontent.com/u/6730217?v=3","gravatar_id":"","url":"https://api.github.com/users/roccomuso","html_url":"https://github.com/roccomuso","followers_url":"https://api.github.com/users/roccomuso/followers","following_url":"https://api.github.com/users/roccomuso/following{/other_user}","gists_url":"https://api.github.com/users/roccomuso/gists{/gist_id}","starred_url":"https://api.github.com/users/roccomuso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roccomuso/subscriptions","organizations_url":"https://api.github.com/users/roccomuso/orgs","repos_url":"https://api.github.com/users/roccomuso/repos","events_url":"https://api.github.com/users/roccomuso/events{/privacy}","received_events_url":"https://api.github.com/users/roccomuso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/roccomuso/MQTT.js","description":"The MQTT client for Node.js and the browser","fork":true,"url":"https://api.github.com/repos/roccomuso/MQTT.js","forks_url":"https://api.github.com/repos/roccomuso/MQTT.js/forks","keys_url":"https://api.github.com/repos/roccomuso/MQTT.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roccomuso/MQTT.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roccomuso/MQTT.js/teams","hooks_url":"https://api.github.com/repos/roccomuso/MQTT.js/hooks","issue_events_url":"https://api.github.com/repos/roccomuso/MQTT.js/issues/events{/number}","events_url":"https://api.github.com/repos/roccomuso/MQTT.js/events","assignees_url":"https://api.github.com/repos/roccomuso/MQTT.js/assignees{/user}","branches_url":"https://api.github.com/repos/roccomuso/MQTT.js/branches{/branch}","tags_url":"https://api.github.com/repos/roccomuso/MQTT.js/tags","blobs_url":"https://api.github.com/repos/roccomuso/MQTT.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roccomuso/MQTT.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roccomuso/MQTT.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/roccomuso/MQTT.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roccomuso/MQTT.js/statuses/{sha}","languages_url":"https://api.github.com/repos/roccomuso/MQTT.js/languages","stargazers_url":"https://api.github.com/repos/roccomuso/MQTT.js/stargazers","contributors_url":"https://api.github.com/repos/roccomuso/MQTT.js/contributors","subscribers_url":"https://api.github.com/repos/roccomuso/MQTT.js/subscribers","subscription_url":"https://api.github.com/repos/roccomuso/MQTT.js/subscription","commits_url":"https://api.github.com/repos/roccomuso/MQTT.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/roccomuso/MQTT.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/roccomuso/MQTT.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/roccomuso/MQTT.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/roccomuso/MQTT.js/contents/{+path}","compare_url":"https://api.github.com/repos/roccomuso/MQTT.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roccomuso/MQTT.js/merges","archive_url":"https://api.github.com/repos/roccomuso/MQTT.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roccomuso/MQTT.js/downloads","issues_url":"https://api.github.com/repos/roccomuso/MQTT.js/issues{/number}","pulls_url":"https://api.github.com/repos/roccomuso/MQTT.js/pulls{/number}","milestones_url":"https://api.github.com/repos/roccomuso/MQTT.js/milestones{/number}","notifications_url":"https://api.github.com/repos/roccomuso/MQTT.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roccomuso/MQTT.js/labels{/name}","releases_url":"https://api.github.com/repos/roccomuso/MQTT.js/releases{/id}","deployments_url":"https://api.github.com/repos/roccomuso/MQTT.js/deployments","created_at":"2015-11-15T20:41:55Z","updated_at":"2015-11-15T20:41:56Z","pushed_at":"2015-11-22T23:56:41Z","git_url":"git://github.com/roccomuso/MQTT.js.git","ssh_url":"git@github.com:roccomuso/MQTT.js.git","clone_url":"https://github.com/roccomuso/MQTT.js.git","svn_url":"https://github.com/roccomuso/MQTT.js","homepage":"","size":977,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mqttjs:master","ref":"master","sha":"1639df9fd9d0e5974669778d5867375d71eb9b70","user":{"login":"mqttjs","id":10424911,"avatar_url":"https://avatars.githubusercontent.com/u/10424911?v=3","gravatar_id":"","url":"https://api.github.com/users/mqttjs","html_url":"https://github.com/mqttjs","followers_url":"https://api.github.com/users/mqttjs/followers","following_url":"https://api.github.com/users/mqttjs/following{/other_user}","gists_url":"https://api.github.com/users/mqttjs/gists{/gist_id}","starred_url":"https://api.github.com/users/mqttjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mqttjs/subscriptions","organizations_url":"https://api.github.com/users/mqttjs/orgs","repos_url":"https://api.github.com/users/mqttjs/repos","events_url":"https://api.github.com/users/mqttjs/events{/privacy}","received_events_url":"https://api.github.com/users/mqttjs/received_events","type":"Organization","site_admin":false},"repo":{"id":1569980,"name":"MQTT.js","full_name":"mqttjs/MQTT.js","owner":{"login":"mqttjs","id":10424911,"avatar_url":"https://avatars.githubusercontent.com/u/10424911?v=3","gravatar_id":"","url":"https://api.github.com/users/mqttjs","html_url":"https://github.com/mqttjs","followers_url":"https://api.github.com/users/mqttjs/followers","following_url":"https://api.github.com/users/mqttjs/following{/other_user}","gists_url":"https://api.github.com/users/mqttjs/gists{/gist_id}","starred_url":"https://api.github.com/users/mqttjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mqttjs/subscriptions","organizations_url":"https://api.github.com/users/mqttjs/orgs","repos_url":"https://api.github.com/users/mqttjs/repos","events_url":"https://api.github.com/users/mqttjs/events{/privacy}","received_events_url":"https://api.github.com/users/mqttjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mqttjs/MQTT.js","description":"The MQTT client for Node.js and the browser","fork":false,"url":"https://api.github.com/repos/mqttjs/MQTT.js","forks_url":"https://api.github.com/repos/mqttjs/MQTT.js/forks","keys_url":"https://api.github.com/repos/mqttjs/MQTT.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mqttjs/MQTT.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mqttjs/MQTT.js/teams","hooks_url":"https://api.github.com/repos/mqttjs/MQTT.js/hooks","issue_events_url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/events{/number}","events_url":"https://api.github.com/repos/mqttjs/MQTT.js/events","assignees_url":"https://api.github.com/repos/mqttjs/MQTT.js/assignees{/user}","branches_url":"https://api.github.com/repos/mqttjs/MQTT.js/branches{/branch}","tags_url":"https://api.github.com/repos/mqttjs/MQTT.js/tags","blobs_url":"https://api.github.com/repos/mqttjs/MQTT.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mqttjs/MQTT.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mqttjs/MQTT.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mqttjs/MQTT.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mqttjs/MQTT.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mqttjs/MQTT.js/languages","stargazers_url":"https://api.github.com/repos/mqttjs/MQTT.js/stargazers","contributors_url":"https://api.github.com/repos/mqttjs/MQTT.js/contributors","subscribers_url":"https://api.github.com/repos/mqttjs/MQTT.js/subscribers","subscription_url":"https://api.github.com/repos/mqttjs/MQTT.js/subscription","commits_url":"https://api.github.com/repos/mqttjs/MQTT.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mqttjs/MQTT.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mqttjs/MQTT.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mqttjs/MQTT.js/contents/{+path}","compare_url":"https://api.github.com/repos/mqttjs/MQTT.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mqttjs/MQTT.js/merges","archive_url":"https://api.github.com/repos/mqttjs/MQTT.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mqttjs/MQTT.js/downloads","issues_url":"https://api.github.com/repos/mqttjs/MQTT.js/issues{/number}","pulls_url":"https://api.github.com/repos/mqttjs/MQTT.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mqttjs/MQTT.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mqttjs/MQTT.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mqttjs/MQTT.js/labels{/name}","releases_url":"https://api.github.com/repos/mqttjs/MQTT.js/releases{/id}","deployments_url":"https://api.github.com/repos/mqttjs/MQTT.js/deployments","created_at":"2011-04-05T00:33:23Z","updated_at":"2016-09-01T12:21:07Z","pushed_at":"2016-09-01T15:36:58Z","git_url":"git://github.com/mqttjs/MQTT.js.git","ssh_url":"git@github.com:mqttjs/MQTT.js.git","clone_url":"https://github.com/mqttjs/MQTT.js.git","svn_url":"https://github.com/mqttjs/MQTT.js","homepage":"","size":1473,"stargazers_count":1604,"watchers_count":1604,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":349,"mirror_url":null,"open_issues_count":29,"forks":349,"open_issues":29,"watchers":1604,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mqttjs/MQTT.js/pulls/351"},"html":{"href":"https://github.com/mqttjs/MQTT.js/pull/351"},"issue":{"href":"https://api.github.com/repos/mqttjs/MQTT.js/issues/351"},"comments":{"href":"https://api.github.com/repos/mqttjs/MQTT.js/issues/351/comments"},"review_comments":{"href":"https://api.github.com/repos/mqttjs/MQTT.js/pulls/351/comments"},"review_comment":{"href":"https://api.github.com/repos/mqttjs/MQTT.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mqttjs/MQTT.js/pulls/351/commits"},"statuses":{"href":"https://api.github.com/repos/mqttjs/MQTT.js/statuses/19015fd7c59bb11b1bd38976e71dfefd30f3d0c8"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":7,"review_comments":1,"commits":4,"additions":25,"deletions":3,"changed_files":2}}
{"actor":{"display_login":"mcollina"}}