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

Authentication for private registries #8221

Closed
juan-abia opened this issue Oct 15, 2024 · 11 comments
Closed

Authentication for private registries #8221

juan-abia opened this issue Oct 15, 2024 · 11 comments
Labels
registry Related to package indexes and registries

Comments

@juan-abia
Copy link

Hello! thanks of all, thanks for your awesome work at astral-sh!

I'm trying to use uv to publish to a private registry (cloudsmith). But I'm getting Unauthorized error. The same token is working using poetry. Here is the line I execute:

uv publish --verbose --publish-url https://python.cloudsmith.io/<my_org>/pip/ --token <cloudsmith_api_key> <my_package>.tar.gz

Here is the output:

DEBUG uv 0.4.20
warning: `uv publish` is experimental and may change without warning
Publishing 1 file to https://python.cloudsmith.io/<my_org>/pip/
DEBUG Using request timeout of 900s
Uploading <my_package>.tar.gz (279.2KiB)
DEBUG Using username/password basic auth
DEBUG Response code for https://python.cloudsmith.io/<my_org>/pip/: 401 Unauthorized
DEBUG Upload error response: {"detail": "Authentication credentials were not provided."}
error: Failed to publish `<my_package>.tar.gz` to https://python.cloudsmith.io/<my_org>/pip/
  Caused by: Upload failed with status code 401 Unauthorized. Server says: {"detail": "Authentication credentials were not provided."}

I've tried using the UV_PUBLISH_TOKEN env var. And also using username as token and the api key as the password.

Could you please add compatibility with cloudsmith? TY!

@astrojuanlu
Copy link

@juan-abia Does it work if you configure a .netrc file?

$ cat ~/.netrc
machine python.cloudsmith.io
  login LOGIN
  password TOKEN

@juan-abia
Copy link
Author

Doesn't work @astrojuanlu :(
I also updated to verion 0.4.22 and no luck

@lskillen
Copy link

lskillen commented Oct 16, 2024

Hey folks 👋 I'm representing the Cloudsmith team here, so I'm happy to help diagnose from our side, too.

We also utilize uv (and ruff too, actually) at Cloudsmith extensively, so we'd be delighted to offer support. :)

If you need a free account to test out, just let us know, too. Cheers!

@charliermarsh
Copy link
Member

Thank you so much @lskillen -- really appreciate that! A test account would be super useful. I'll let @konstin follow up.

@konstin
Copy link
Member

konstin commented Oct 16, 2024

Hi @lskillen! We'd love to collaborate with you on this, and a test account would be great! You can reach me at [email protected] (or on discord as konsti2849) for coordinating the details.

@lskillen
Copy link

Sounds good, I'll drop you an email and intro you to our team. :)

@zanieb zanieb added the registry Related to package indexes and registries label Oct 16, 2024
@konstin
Copy link
Member

konstin commented Oct 16, 2024

@astrojuanlu For cloudsmith, you need to use username and password authentication: For the username, use your username or token, the password is your token. For --token we use the PyPI default of __token__, which mismatches with the cloudsmith token.

@juan-abia
Copy link
Author

juan-abia commented Oct 16, 2024

@konstin just confirmed that using token works

@konstin
Copy link
Member

konstin commented Oct 17, 2024

Cloudsmith updated their backend to also allow __token__, so you can now publish with --token, too. Shoutout to the cloudsmith team for adding this so quickly!

@lskillen
Copy link

Glad it worked. 😁 Happy to be included on a list if one ever exists of "Supported services that work". 😆

@juan-abia
Copy link
Author

Thanks a lot team! closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
registry Related to package indexes and registries
Projects
None yet
Development

No branches or pull requests

6 participants