Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing for other auth handlers in CLI #628

Closed
fmigneault opened this issue May 6, 2024 · 0 comments · Fixed by #654
Closed

Fix typing for other auth handlers in CLI #628

fmigneault opened this issue May 6, 2024 · 0 comments · Fixed by #654
Assignees
Labels
triage/bug Something isn't working

Comments

@fmigneault
Copy link
Collaborator

Describe the bug

Typing of AuthHandler on auth parameter for the WeaverClient do not permit other/external handlers.

How to Reproduce

import os
from requests_magpie import MagpieAuth
from weaver.cli import WeaverClient

client = WeaverClient(
    url="https://hirondelle.crim.ca/weaver/",
    auth=MagpieAuth(
        magpie_url="https://hirondelle.crim.ca/magpie/",
        username=os.getenv("MAGPIE_USERNAME"),
        password=os.getenv("MAGPIE_PASSWORD"),
    )
)

image

Expected behavior

A Protocol (or other similar?) typing definition should be used to allow any AuthHandler-like implementation that provides all necessary parameters and operations. Namely, that would be the __call__ method that must set the relevant HTTP method, headers, etc. definitions based on the provided request object as input.

@fmigneault fmigneault added the triage/bug Something isn't working label May 6, 2024
@fmigneault fmigneault self-assigned this May 6, 2024
fmigneault-crim pushed a commit that referenced this issue May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant