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

Handle 403, 404 #70

Merged
merged 3 commits into from
Sep 19, 2023
Merged

Handle 403, 404 #70

merged 3 commits into from
Sep 19, 2023

Conversation

logangrado
Copy link
Contributor

@logangrado logangrado commented Sep 18, 2023

Update handling of 400 error codes such that:

  • 403: Handle the same way as 401
  • 404:
    • Attempt to find credentials from normal sources
    • Do not prompt if credentials are not found
  • not_prompting:
    • Allow discovery of credentials when not prompting

Addresses #69

src/unearth/auth.py Outdated Show resolved Hide resolved
@frostming frostming merged commit 66b32c9 into frostming:main Sep 19, 2023
15 checks passed
@logangrado
Copy link
Contributor Author

@frostming Thanks for accepting this contribution.

Any idea how long it will be until this is picked up in PDM?

@frostming
Copy link
Owner

0.11.0 is released, you can get this feature by upgrading unearth.

@frostming
Copy link
Owner

It seems this causes a regression on some indexes that return 403 on not found. For example: https://download.pytorch.org/whl/numba/

When it fails to get that package on not found, it returns a 403 instead of 404, so that it will prompt for username and password.

The situation is complicated because some index return 403 on 401, while some return 403 on 404, that's quite unfortunate.

@logangrado

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants