Skip to content

Auth type makes problem in dbt-duckdb > fsspec > webdav4 > httpx #3029

@ZergRocks

Description

@ZergRocks
# _types.py
AuthTypes = Union[
    Mapping[str, Any], # added
    Tuple[Union[str, bytes], Union[str, bytes]],
    Callable[["Request"], "Request"],
    "Auth",
]
# _client.py
    def _build_auth(self, auth: typing.Optional[AuthTypes]) -> typing.Optional[Auth]:
        if auth is None:
            return None
        elif isinstance(auth, tuple):
            if any(
                [
                    type(auth == dict),
                    auth.get('username'),
                    auth.get('password'),
                ]
            ):
                return BasicAuth( # added
                    username=auth.get('username'),
                    passworkd=auth.get('password')
                )
            return BasicAuth(username=auth[0], password=auth[1])
        elif isinstance(auth, Auth):
            return auth
        elif callable(auth):
            return FunctionAuth(func=auth)
        else:
            raise TypeError(f'Invalid "auth" argument: {auth!r}')

The auth option that this made in when I use the webdav option in the file system interface used by dbt-duckdb and is related to the handling of AuthType in this repository.

However, the current fs: webdav option is almost unavailable because the external module(especially dbt) is restricted from processing the yaml file in profiles.yml and converting it into a tuple. Therefore, we can consider ways such as enhancing httpx or changing the profile.yaml treatment in dbt-core to handle it.

Can you give me any advice on this matter? @jwills

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