{"action":"created","comment":{"url":"https://api.github.com/repos/python-zk/kazoo/pulls/comments/200196169","pull_request_review_id":134464585,"id":200196169,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDE5NjE2OQ==","diff_hunk":"@@ -408,6 +414,23 @@ def _read_socket(self, read_timeout):\n                 async_object.set(True)\n         elif header.xid == WATCH_XID:\n             self._read_watch_event(buffer, offset)\n+        elif self.sasl_cli and not self.sasl_cli.complete:\n+            # SASL authentication is not yet finished, this can only\n+            # be a SASL packet\n+            self.logger.log(BLATHER, 'Received SASL')\n+            try:\n+                challenge, _ = SASL.deserialize(buffer, offset)\n+            except Exception:\n+                raise ConnectionDropped('error while doing SASL authentication.')\n+            response = self.sasl_cli.process(challenge)\n+            if response:\n+                # authentication not yet finished, answering the challenge\n+                self._send_sasl_request(challenge=response,\n+                                        timeout=client._session_timeout)\n+            else:\n+                # authentication is ok, remove sensible information from the object","path":"kazoo/protocol/connection.py","position":51,"original_position":51,"commit_id":"4f0a3e100c6ecb3337ae26b20c7c5b3e795002d6","original_commit_id":"4f0a3e100c6ecb3337ae26b20c7c5b3e795002d6","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"line too long (83 > 79 characters)","created_at":"2018-07-04T20:10:33Z","updated_at":"2018-07-04T20:10:33Z","html_url":"https://github.com/python-zk/kazoo/pull/512#discussion_r200196169","pull_request_url":"https://api.github.com/repos/python-zk/kazoo/pulls/512","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/python-zk/kazoo/pulls/comments/200196169"},"html":{"href":"https://github.com/python-zk/kazoo/pull/512#discussion_r200196169"},"pull_request":{"href":"https://api.github.com/repos/python-zk/kazoo/pulls/512"}}},"pull_request":{"url":"https://api.github.com/repos/python-zk/kazoo/pulls/512","id":199318068,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MzE4MDY4","html_url":"https://github.com/python-zk/kazoo/pull/512","diff_url":"https://github.com/python-zk/kazoo/pull/512.diff","patch_url":"https://github.com/python-zk/kazoo/pull/512.patch","issue_url":"https://api.github.com/repos/python-zk/kazoo/issues/512","number":512,"state":"open","locked":false,"title":"feat(core): Added SASL DIGEST-MD5 support","user":{"login":"StephenSorriaux","id":16797053,"node_id":"MDQ6VXNlcjE2Nzk3MDUz","avatar_url":"https://avatars0.githubusercontent.com/u/16797053?v=4","gravatar_id":"","url":"https://api.github.com/users/StephenSorriaux","html_url":"https://github.com/StephenSorriaux","followers_url":"https://api.github.com/users/StephenSorriaux/followers","following_url":"https://api.github.com/users/StephenSorriaux/following{/other_user}","gists_url":"https://api.github.com/users/StephenSorriaux/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenSorriaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenSorriaux/subscriptions","organizations_url":"https://api.github.com/users/StephenSorriaux/orgs","repos_url":"https://api.github.com/users/StephenSorriaux/repos","events_url":"https://api.github.com/users/StephenSorriaux/events{/privacy}","received_events_url":"https://api.github.com/users/StephenSorriaux/received_events","type":"User","site_admin":false},"body":"This PR adds support for **DIGEST-MD5** SASL authentification to Zookeeper.\r\n\r\nUsage is as same as before except that we can now use the 'sasl' mechanism:\r\n```\r\nfrom kazoo.client import KazooClient\r\nzk = KazooClient(hosts='172.20.0.2:2181', auth_data=[('sasl', 'user:password')])\r\nzk.start()\r\n...\r\n```\r\nI mainly followed [Zookeeper's client-server mutual authentication](https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication) documentation for this implementation.\r\n\r\nIt uses the [pure-sasl library](https://github.com/thobbs/pure-sasl) to manage the SASL challenge. It is a very well documented library to use for SASL authentification and can also be used if we want to add a **GSSAPI** support for Zookeeper.\r\n\r\nSome tests also have been added.\r\n\r\nThank you\r\n\r\nStephen","created_at":"2018-07-04T20:10:20Z","updated_at":"2018-07-04T20:10:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05509e038353e37ec9c0a04dbc8b7684ed219b96","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/python-zk/kazoo/pulls/512/commits","review_comments_url":"https://api.github.com/repos/python-zk/kazoo/pulls/512/comments","review_comment_url":"https://api.github.com/repos/python-zk/kazoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python-zk/kazoo/issues/512/comments","statuses_url":"https://api.github.com/repos/python-zk/kazoo/statuses/4f0a3e100c6ecb3337ae26b20c7c5b3e795002d6","head":{"label":"StephenSorriaux:feat/add-sasl-support","ref":"feat/add-sasl-support","sha":"4f0a3e100c6ecb3337ae26b20c7c5b3e795002d6","user":{"login":"StephenSorriaux","id":16797053,"node_id":"MDQ6VXNlcjE2Nzk3MDUz","avatar_url":"https://avatars0.githubusercontent.com/u/16797053?v=4","gravatar_id":"","url":"https://api.github.com/users/StephenSorriaux","html_url":"https://github.com/StephenSorriaux","followers_url":"https://api.github.com/users/StephenSorriaux/followers","following_url":"https://api.github.com/users/StephenSorriaux/following{/other_user}","gists_url":"https://api.github.com/users/StephenSorriaux/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenSorriaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenSorriaux/subscriptions","organizations_url":"https://api.github.com/users/StephenSorriaux/orgs","repos_url":"https://api.github.com/users/StephenSorriaux/repos","events_url":"https://api.github.com/users/StephenSorriaux/events{/privacy}","received_events_url":"https://api.github.com/users/StephenSorriaux/received_events","type":"User","site_admin":false},"repo":{"id":135804328,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU4MDQzMjg=","name":"kazoo","full_name":"StephenSorriaux/kazoo","owner":{"login":"StephenSorriaux","id":16797053,"node_id":"MDQ6VXNlcjE2Nzk3MDUz","avatar_url":"https://avatars0.githubusercontent.com/u/16797053?v=4","gravatar_id":"","url":"https://api.github.com/users/StephenSorriaux","html_url":"https://github.com/StephenSorriaux","followers_url":"https://api.github.com/users/StephenSorriaux/followers","following_url":"https://api.github.com/users/StephenSorriaux/following{/other_user}","gists_url":"https://api.github.com/users/StephenSorriaux/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenSorriaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenSorriaux/subscriptions","organizations_url":"https://api.github.com/users/StephenSorriaux/orgs","repos_url":"https://api.github.com/users/StephenSorriaux/repos","events_url":"https://api.github.com/users/StephenSorriaux/events{/privacy}","received_events_url":"https://api.github.com/users/StephenSorriaux/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/StephenSorriaux/kazoo","description":"Kazoo is a high-level Python library that makes it easier to use Apache Zookeeper.","fork":true,"url":"https://api.github.com/repos/StephenSorriaux/kazoo","forks_url":"https://api.github.com/repos/StephenSorriaux/kazoo/forks","keys_url":"https://api.github.com/repos/StephenSorriaux/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StephenSorriaux/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StephenSorriaux/kazoo/teams","hooks_url":"https://api.github.com/repos/StephenSorriaux/kazoo/hooks","issue_events_url":"https://api.github.com/repos/StephenSorriaux/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/StephenSorriaux/kazoo/events","assignees_url":"https://api.github.com/repos/StephenSorriaux/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/StephenSorriaux/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/StephenSorriaux/kazoo/tags","blobs_url":"https://api.github.com/repos/StephenSorriaux/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StephenSorriaux/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StephenSorriaux/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/StephenSorriaux/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StephenSorriaux/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/StephenSorriaux/kazoo/languages","stargazers_url":"https://api.github.com/repos/StephenSorriaux/kazoo/stargazers","contributors_url":"https://api.github.com/repos/StephenSorriaux/kazoo/contributors","subscribers_url":"https://api.github.com/repos/StephenSorriaux/kazoo/subscribers","subscription_url":"https://api.github.com/repos/StephenSorriaux/kazoo/subscription","commits_url":"https://api.github.com/repos/StephenSorriaux/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/StephenSorriaux/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/StephenSorriaux/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/StephenSorriaux/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/StephenSorriaux/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/StephenSorriaux/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StephenSorriaux/kazoo/merges","archive_url":"https://api.github.com/repos/StephenSorriaux/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StephenSorriaux/kazoo/downloads","issues_url":"https://api.github.com/repos/StephenSorriaux/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/StephenSorriaux/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/StephenSorriaux/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/StephenSorriaux/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StephenSorriaux/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/StephenSorriaux/kazoo/releases{/id}","deployments_url":"https://api.github.com/repos/StephenSorriaux/kazoo/deployments","created_at":"2018-06-02T09:22:02Z","updated_at":"2018-06-02T09:22:05Z","pushed_at":"2018-07-04T19:53:46Z","git_url":"git://github.com/StephenSorriaux/kazoo.git","ssh_url":"git@github.com:StephenSorriaux/kazoo.git","clone_url":"https://github.com/StephenSorriaux/kazoo.git","svn_url":"https://github.com/StephenSorriaux/kazoo","homepage":"https://kazoo.readthedocs.io","size":3753,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":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":"python-zk:master","ref":"master","sha":"ac09667bf6b7afd69fe494cbc67e2e56327a73bb","user":{"login":"python-zk","id":1731709,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MzE3MDk=","avatar_url":"https://avatars2.githubusercontent.com/u/1731709?v=4","gravatar_id":"","url":"https://api.github.com/users/python-zk","html_url":"https://github.com/python-zk","followers_url":"https://api.github.com/users/python-zk/followers","following_url":"https://api.github.com/users/python-zk/following{/other_user}","gists_url":"https://api.github.com/users/python-zk/gists{/gist_id}","starred_url":"https://api.github.com/users/python-zk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-zk/subscriptions","organizations_url":"https://api.github.com/users/python-zk/orgs","repos_url":"https://api.github.com/users/python-zk/repos","events_url":"https://api.github.com/users/python-zk/events{/privacy}","received_events_url":"https://api.github.com/users/python-zk/received_events","type":"Organization","site_admin":false},"repo":{"id":4426689,"node_id":"MDEwOlJlcG9zaXRvcnk0NDI2Njg5","name":"kazoo","full_name":"python-zk/kazoo","owner":{"login":"python-zk","id":1731709,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MzE3MDk=","avatar_url":"https://avatars2.githubusercontent.com/u/1731709?v=4","gravatar_id":"","url":"https://api.github.com/users/python-zk","html_url":"https://github.com/python-zk","followers_url":"https://api.github.com/users/python-zk/followers","following_url":"https://api.github.com/users/python-zk/following{/other_user}","gists_url":"https://api.github.com/users/python-zk/gists{/gist_id}","starred_url":"https://api.github.com/users/python-zk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-zk/subscriptions","organizations_url":"https://api.github.com/users/python-zk/orgs","repos_url":"https://api.github.com/users/python-zk/repos","events_url":"https://api.github.com/users/python-zk/events{/privacy}","received_events_url":"https://api.github.com/users/python-zk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python-zk/kazoo","description":"Kazoo is a high-level Python library that makes it easier to use Apache Zookeeper.","fork":false,"url":"https://api.github.com/repos/python-zk/kazoo","forks_url":"https://api.github.com/repos/python-zk/kazoo/forks","keys_url":"https://api.github.com/repos/python-zk/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python-zk/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python-zk/kazoo/teams","hooks_url":"https://api.github.com/repos/python-zk/kazoo/hooks","issue_events_url":"https://api.github.com/repos/python-zk/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/python-zk/kazoo/events","assignees_url":"https://api.github.com/repos/python-zk/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/python-zk/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/python-zk/kazoo/tags","blobs_url":"https://api.github.com/repos/python-zk/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python-zk/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python-zk/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/python-zk/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python-zk/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/python-zk/kazoo/languages","stargazers_url":"https://api.github.com/repos/python-zk/kazoo/stargazers","contributors_url":"https://api.github.com/repos/python-zk/kazoo/contributors","subscribers_url":"https://api.github.com/repos/python-zk/kazoo/subscribers","subscription_url":"https://api.github.com/repos/python-zk/kazoo/subscription","commits_url":"https://api.github.com/repos/python-zk/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/python-zk/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/python-zk/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/python-zk/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/python-zk/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/python-zk/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python-zk/kazoo/merges","archive_url":"https://api.github.com/repos/python-zk/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python-zk/kazoo/downloads","issues_url":"https://api.github.com/repos/python-zk/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/python-zk/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/python-zk/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/python-zk/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python-zk/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/python-zk/kazoo/releases{/id}","deployments_url":"https://api.github.com/repos/python-zk/kazoo/deployments","created_at":"2012-05-23T23:46:42Z","updated_at":"2018-06-28T03:34:13Z","pushed_at":"2018-07-04T20:10:21Z","git_url":"git://github.com/python-zk/kazoo.git","ssh_url":"git@github.com:python-zk/kazoo.git","clone_url":"https://github.com/python-zk/kazoo.git","svn_url":"https://github.com/python-zk/kazoo","homepage":"https://kazoo.readthedocs.io","size":3745,"stargazers_count":859,"watchers_count":859,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":320,"mirror_url":null,"archived":false,"open_issues_count":79,"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":320,"open_issues":79,"watchers":859,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python-zk/kazoo/pulls/512"},"html":{"href":"https://github.com/python-zk/kazoo/pull/512"},"issue":{"href":"https://api.github.com/repos/python-zk/kazoo/issues/512"},"comments":{"href":"https://api.github.com/repos/python-zk/kazoo/issues/512/comments"},"review_comments":{"href":"https://api.github.com/repos/python-zk/kazoo/pulls/512/comments"},"review_comment":{"href":"https://api.github.com/repos/python-zk/kazoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python-zk/kazoo/pulls/512/commits"},"statuses":{"href":"https://api.github.com/repos/python-zk/kazoo/statuses/4f0a3e100c6ecb3337ae26b20c7c5b3e795002d6"}},"author_association":"NONE"}}
{"actor":{"display_login":"houndci-bot"}}