Skip to content

Add auth data for aiozk #35

@lyncir

Description

@lyncir

Can you add auth_data when ZKClient instance like KazooClient(auth_data=auth_data)?
Or that would work not good?

For example:

class MyZKClient(ZKClient):

    def __init__(
            self,
            servers,
            chroot=None,
            session_timeout=10,
            default_acl=None,
            retry_policy=None,
            allow_read_only=False,
            read_timeout=None,
            loop=None,
            auth_data=None,
    ):
        super().__init__(servers, chroot, session_timeout, default_acl,
                         retry_policy, allow_read_only, read_timeout,
                         loop)
        self.auth_data = auth_data

    async def send(self, request):
        try:
            return await super().send(request)

        except NoAuth:

            if self.auth_data:
                await super().send(self.auth_data)

                return await super().send(request)


auth_data = AuthRequest(type=0, scheme='digest', auth=auth)
MyZKClient(zk_hosts, auth_data=auth_data)

but, still has some NoAuth error when use TreeCache

zookeeper: 3.4.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions