-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Authorization
Header is missing on cargo build
for private registries
#10920
Comments
It seems that #10474 is completed and will make it to stable release, but I still struggle with the same issue that @sassman reported. I have artifactory in my enterprise environment, I'm able to publish one crate, but when publishing another one, cargo fails with 403 error. I'm trying with
And it still does not work. Is there an instruction for dumb users like me what do I need to do to get it working? Cargo book seems to be focused on securely storing credentials in a bunch of secret managers, I can't find a recipe on how to enable auth for downloads :( |
What did you mean by "able to publish one, but failed on another"? For publishing packages to alternate registries, you can have a look at https://doc.rust-lang.org/nightly/cargo/reference/registries.html#publishing-to-an-alternate-registry.
Were you stuck in uploading or downloading? I am a bit confused now… Setting either default credential provider or registry specific provider should fix the issue. If not, please file a new issue with reproducible steps and relevant configuration. We can have a look then :) |
Sorry for confusion, publishing works as expected with token auth, but when publishing a package that is dependent on another already published package, Cargo is trying to download the dependent package from private repo first to validate it, and bails out with the following error:
So it fails on download, despite me having configured credentials provider and using latest nightly which should support auth:
|
Does your registry have the flag set in its |
Hm, I've seen reference of some flag somewhere, but can't find it right now. My registry only has |
https://doc.rust-lang.org/nightly/cargo/reference/registry-index.html#index-configuration |
Problem
Given
<project_root>/.cargo/config
like this:my-crate
at version0.1.1
(because this works already well)Cargo.toml
with aregistry
property like:~/.cargo/credentials.toml
for exactly this registry like:Then
cargo build
downloadsmy-crate
with using thetoken
specified in thecredentials.toml
Steps
cargo login
or as said aboveregistry
property (see above)cargo build
Possible Solution(s)
IMO it would be most consitent that cargo under the given circumstances uses an
Authorization
header forbuild
and download.As it is doing it already correctly for the
publish
sub-commandAlternatively in the project
.cargo/config
one option might activate the desired behavior, maybe on the[net]
config section.Notes
No response
Version
The text was updated successfully, but these errors were encountered: