jina-ai/jina-hubble-sdk

Adopt proxy way to login in hubble-client-python

mapleeit opened this issue ยท 2 comments

I suggest allow passsing arbitary named parameters to login and authentication endpoint.

    @staticmethod
    async def login(**kwargs):
        api_host = get_base_url()

        async with aiohttp.ClientSession(trust_env=True) as session:
            redirect_url = 'http://localhost:8085'
            kwargs[redirect_url] = redirect_url

            async with session.get(
                url=urljoin(
                    api_host,
                    'user.identity.authorize?{}'.format(urlencode(kwargs)),
                ),
                stream=True,
            ) as response:
                response.raise_for_status()
                json_response = await response.json()
                webbrowser.open(json_response['data']['redirectTo'], new=2)

๐ŸŽ‰ This issue has been resolved in version 0.6.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€