payload: {"action":"created","comment":{"url":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/comments/356938510","pull_request_review_id":330969701,"id":356938510,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1NjkzODUxMA==","diff_hunk":"@@ -104,19 +104,17 @@ func (c *ClientMQTT) onConnect(p *common.Connect) error {\n \t}\n \n \tif p.Will != nil {\n-\t\t// TODO: remove?\n-\t\t// if !common.PubTopicValidate(p.Will.Topic) {\n-\t\t// \treturn errors.New(\"will topic (%s) invalid\", p.Will.Topic)\n-\t\t// }\n-\t\t// if !c.authorize(auth.Publish, p.Will.Topic) {\n-\t\t// \tc.sendConnack(common.NotAuthorized)\n-\t\t// \treturn errors.New(\"will topic (%s) not permitted\", p.Will.Topic)\n-\t\t// }\n-\t\t// if p.Will.QOS > 1 {\n-\t\t// \treturn errors.New(\"will QOS (%d) not supported\", p.Will.QOS)\n-\t\t// }\n+\t\tif !common.CheckTopic(p.Will.Topic, false) {\n+\t\t\treturn errors.New(\"will topic invalid\")\n+\t\t}\n+\t\tif !c.authorize(auth.Publish, p.Will.Topic) {\n+\t\t\tc.sendConnack(common.NotAuthorized, false)\n+\t\t\treturn errors.New(\"will topic not permitted\")\n+\t\t}\n+\t\tif p.Will.QOS > 1 {\n+\t\t\treturn errors.New(\"will QoS not supported\")\n+\t\t}","path":"session/client_mqtt_i.go","position":82,"original_position":82,"commit_id":"8341e4768b87b72cc8153edd8045f8b25bd599ab","original_commit_id":"8341e4768b87b72cc8153edd8045f8b25bd599ab","user":{"login":"kuailehaibin","id":8502587,"node_id":"MDQ6VXNlcjg1MDI1ODc=","avatar_url":"https://avatars1.githubusercontent.com/u/8502587?v=4","gravatar_id":"","url":"https://api.github.com/users/kuailehaibin","html_url":"https://github.com/kuailehaibin","followers_url":"https://api.github.com/users/kuailehaibin/followers","following_url":"https://api.github.com/users/kuailehaibin/following{/other_user}","gists_url":"https://api.github.com/users/kuailehaibin/gists{/gist_id}","starred_url":"https://api.github.com/users/kuailehaibin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuailehaibin/subscriptions","organizations_url":"https://api.github.com/users/kuailehaibin/orgs","repos_url":"https://api.github.com/users/kuailehaibin/repos","events_url":"https://api.github.com/users/kuailehaibin/events{/privacy}","received_events_url":"https://api.github.com/users/kuailehaibin/received_events","type":"User","site_admin":false},"body":"好的","created_at":"2019-12-12T03:01:21Z","updated_at":"2019-12-12T03:01:21Z","html_url":"https://github.com/baetyl/baetyl-broker/pull/7#discussion_r356938510","pull_request_url":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/comments/356938510"},"html":{"href":"https://github.com/baetyl/baetyl-broker/pull/7#discussion_r356938510"},"pull_request":{"href":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/7"}},"in_reply_to_id":356928485},"pull_request":{"url":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/7","id":351893660,"node_id":"MDExOlB1bGxSZXF1ZXN0MzUxODkzNjYw","html_url":"https://github.com/baetyl/baetyl-broker/pull/7","diff_url":"https://github.com/baetyl/baetyl-broker/pull/7.diff","patch_url":"https://github.com/baetyl/baetyl-broker/pull/7.patch","issue_url":"https://api.github.com/repos/baetyl/baetyl-broker/issues/7","number":7,"state":"open","locked":false,"title":"add will and retain of mqtt","user":{"login":"kuailehaibin","id":8502587,"node_id":"MDQ6VXNlcjg1MDI1ODc=","avatar_url":"https://avatars1.githubusercontent.com/u/8502587?v=4","gravatar_id":"","url":"https://api.github.com/users/kuailehaibin","html_url":"https://github.com/kuailehaibin","followers_url":"https://api.github.com/users/kuailehaibin/followers","following_url":"https://api.github.com/users/kuailehaibin/following{/other_user}","gists_url":"https://api.github.com/users/kuailehaibin/gists{/gist_id}","starred_url":"https://api.github.com/users/kuailehaibin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuailehaibin/subscriptions","organizations_url":"https://api.github.com/users/kuailehaibin/orgs","repos_url":"https://api.github.com/users/kuailehaibin/repos","events_url":"https://api.github.com/users/kuailehaibin/events{/privacy}","received_events_url":"https://api.github.com/users/kuailehaibin/received_events","type":"User","site_admin":false},"body":"add will and retain of mqtt","created_at":"2019-12-11T12:44:17Z","updated_at":"2019-12-12T03:01:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81ad2d66acd555baaa311c898c4ced08b4c4b586","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/7/commits","review_comments_url":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/7/comments","review_comment_url":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/baetyl/baetyl-broker/issues/7/comments","statuses_url":"https://api.github.com/repos/baetyl/baetyl-broker/statuses/8341e4768b87b72cc8153edd8045f8b25bd599ab","head":{"label":"kuailehaibin:master","ref":"master","sha":"8341e4768b87b72cc8153edd8045f8b25bd599ab","user":{"login":"kuailehaibin","id":8502587,"node_id":"MDQ6VXNlcjg1MDI1ODc=","avatar_url":"https://avatars1.githubusercontent.com/u/8502587?v=4","gravatar_id":"","url":"https://api.github.com/users/kuailehaibin","html_url":"https://github.com/kuailehaibin","followers_url":"https://api.github.com/users/kuailehaibin/followers","following_url":"https://api.github.com/users/kuailehaibin/following{/other_user}","gists_url":"https://api.github.com/users/kuailehaibin/gists{/gist_id}","starred_url":"https://api.github.com/users/kuailehaibin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuailehaibin/subscriptions","organizations_url":"https://api.github.com/users/kuailehaibin/orgs","repos_url":"https://api.github.com/users/kuailehaibin/repos","events_url":"https://api.github.com/users/kuailehaibin/events{/privacy}","received_events_url":"https://api.github.com/users/kuailehaibin/received_events","type":"User","site_admin":false},"repo":{"id":223703223,"node_id":"MDEwOlJlcG9zaXRvcnkyMjM3MDMyMjM=","name":"baetyl-broker","full_name":"kuailehaibin/baetyl-broker","private":false,"owner":{"login":"kuailehaibin","id":8502587,"node_id":"MDQ6VXNlcjg1MDI1ODc=","avatar_url":"https://avatars1.githubusercontent.com/u/8502587?v=4","gravatar_id":"","url":"https://api.github.com/users/kuailehaibin","html_url":"https://github.com/kuailehaibin","followers_url":"https://api.github.com/users/kuailehaibin/followers","following_url":"https://api.github.com/users/kuailehaibin/following{/other_user}","gists_url":"https://api.github.com/users/kuailehaibin/gists{/gist_id}","starred_url":"https://api.github.com/users/kuailehaibin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuailehaibin/subscriptions","organizations_url":"https://api.github.com/users/kuailehaibin/orgs","repos_url":"https://api.github.com/users/kuailehaibin/repos","events_url":"https://api.github.com/users/kuailehaibin/events{/privacy}","received_events_url":"https://api.github.com/users/kuailehaibin/received_events","type":"User","site_admin":false},"html_url":"https://github.com/kuailehaibin/baetyl-broker","description":null,"fork":true,"url":"https://api.github.com/repos/kuailehaibin/baetyl-broker","forks_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/forks","keys_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/teams","hooks_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/hooks","issue_events_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/issues/events{/number}","events_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/events","assignees_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/assignees{/user}","branches_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/branches{/branch}","tags_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/tags","blobs_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/git/refs{/sha}","trees_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/statuses/{sha}","languages_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/languages","stargazers_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/stargazers","contributors_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/contributors","subscribers_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/subscribers","subscription_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/subscription","commits_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/commits{/sha}","git_commits_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/git/commits{/sha}","comments_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/comments{/number}","issue_comment_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/issues/comments{/number}","contents_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/contents/{+path}","compare_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/merges","archive_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/downloads","issues_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/issues{/number}","pulls_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/pulls{/number}","milestones_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/milestones{/number}","notifications_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/labels{/name}","releases_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/releases{/id}","deployments_url":"https://api.github.com/repos/kuailehaibin/baetyl-broker/deployments","created_at":"2019-11-24T06:38:32Z","updated_at":"2019-12-11T12:43:50Z","pushed_at":"2019-12-11T12:43:46Z","git_url":"git://github.com/kuailehaibin/baetyl-broker.git","ssh_url":"git@github.com:kuailehaibin/baetyl-broker.git","clone_url":"https://github.com/kuailehaibin/baetyl-broker.git","svn_url":"https://github.com/kuailehaibin/baetyl-broker","homepage":null,"size":204,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"baetyl:master","ref":"master","sha":"f0df546824fce83c3b3112bac73cbea428de8cab","user":{"login":"baetyl","id":54415384,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NDE1Mzg0","avatar_url":"https://avatars3.githubusercontent.com/u/54415384?v=4","gravatar_id":"","url":"https://api.github.com/users/baetyl","html_url":"https://github.com/baetyl","followers_url":"https://api.github.com/users/baetyl/followers","following_url":"https://api.github.com/users/baetyl/following{/other_user}","gists_url":"https://api.github.com/users/baetyl/gists{/gist_id}","starred_url":"https://api.github.com/users/baetyl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baetyl/subscriptions","organizations_url":"https://api.github.com/users/baetyl/orgs","repos_url":"https://api.github.com/users/baetyl/repos","events_url":"https://api.github.com/users/baetyl/events{/privacy}","received_events_url":"https://api.github.com/users/baetyl/received_events","type":"Organization","site_admin":false},"repo":{"id":218269616,"node_id":"MDEwOlJlcG9zaXRvcnkyMTgyNjk2MTY=","name":"baetyl-broker","full_name":"baetyl/baetyl-broker","private":false,"owner":{"login":"baetyl","id":54415384,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NDE1Mzg0","avatar_url":"https://avatars3.githubusercontent.com/u/54415384?v=4","gravatar_id":"","url":"https://api.github.com/users/baetyl","html_url":"https://github.com/baetyl","followers_url":"https://api.github.com/users/baetyl/followers","following_url":"https://api.github.com/users/baetyl/following{/other_user}","gists_url":"https://api.github.com/users/baetyl/gists{/gist_id}","starred_url":"https://api.github.com/users/baetyl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baetyl/subscriptions","organizations_url":"https://api.github.com/users/baetyl/orgs","repos_url":"https://api.github.com/users/baetyl/repos","events_url":"https://api.github.com/users/baetyl/events{/privacy}","received_events_url":"https://api.github.com/users/baetyl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/baetyl/baetyl-broker","description":null,"fork":false,"url":"https://api.github.com/repos/baetyl/baetyl-broker","forks_url":"https://api.github.com/repos/baetyl/baetyl-broker/forks","keys_url":"https://api.github.com/repos/baetyl/baetyl-broker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/baetyl/baetyl-broker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/baetyl/baetyl-broker/teams","hooks_url":"https://api.github.com/repos/baetyl/baetyl-broker/hooks","issue_events_url":"https://api.github.com/repos/baetyl/baetyl-broker/issues/events{/number}","events_url":"https://api.github.com/repos/baetyl/baetyl-broker/events","assignees_url":"https://api.github.com/repos/baetyl/baetyl-broker/assignees{/user}","branches_url":"https://api.github.com/repos/baetyl/baetyl-broker/branches{/branch}","tags_url":"https://api.github.com/repos/baetyl/baetyl-broker/tags","blobs_url":"https://api.github.com/repos/baetyl/baetyl-broker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/baetyl/baetyl-broker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/baetyl/baetyl-broker/git/refs{/sha}","trees_url":"https://api.github.com/repos/baetyl/baetyl-broker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/baetyl/baetyl-broker/statuses/{sha}","languages_url":"https://api.github.com/repos/baetyl/baetyl-broker/languages","stargazers_url":"https://api.github.com/repos/baetyl/baetyl-broker/stargazers","contributors_url":"https://api.github.com/repos/baetyl/baetyl-broker/contributors","subscribers_url":"https://api.github.com/repos/baetyl/baetyl-broker/subscribers","subscription_url":"https://api.github.com/repos/baetyl/baetyl-broker/subscription","commits_url":"https://api.github.com/repos/baetyl/baetyl-broker/commits{/sha}","git_commits_url":"https://api.github.com/repos/baetyl/baetyl-broker/git/commits{/sha}","comments_url":"https://api.github.com/repos/baetyl/baetyl-broker/comments{/number}","issue_comment_url":"https://api.github.com/repos/baetyl/baetyl-broker/issues/comments{/number}","contents_url":"https://api.github.com/repos/baetyl/baetyl-broker/contents/{+path}","compare_url":"https://api.github.com/repos/baetyl/baetyl-broker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/baetyl/baetyl-broker/merges","archive_url":"https://api.github.com/repos/baetyl/baetyl-broker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/baetyl/baetyl-broker/downloads","issues_url":"https://api.github.com/repos/baetyl/baetyl-broker/issues{/number}","pulls_url":"https://api.github.com/repos/baetyl/baetyl-broker/pulls{/number}","milestones_url":"https://api.github.com/repos/baetyl/baetyl-broker/milestones{/number}","notifications_url":"https://api.github.com/repos/baetyl/baetyl-broker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/baetyl/baetyl-broker/labels{/name}","releases_url":"https://api.github.com/repos/baetyl/baetyl-broker/releases{/id}","deployments_url":"https://api.github.com/repos/baetyl/baetyl-broker/deployments","created_at":"2019-10-29T11:18:47Z","updated_at":"2019-11-30T13:48:49Z","pushed_at":"2019-12-11T12:44:18Z","git_url":"git://github.com/baetyl/baetyl-broker.git","ssh_url":"git@github.com:baetyl/baetyl-broker.git","clone_url":"https://github.com/baetyl/baetyl-broker.git","svn_url":"https://github.com/baetyl/baetyl-broker","homepage":null,"size":172,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":4,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/7"},"html":{"href":"https://github.com/baetyl/baetyl-broker/pull/7"},"issue":{"href":"https://api.github.com/repos/baetyl/baetyl-broker/issues/7"},"comments":{"href":"https://api.github.com/repos/baetyl/baetyl-broker/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/baetyl/baetyl-broker/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/baetyl/baetyl-broker/statuses/8341e4768b87b72cc8153edd8045f8b25bd599ab"}},"author_association":"NONE"}}
other: {"actor":{"display_login":"kuailehaibin"}}