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

Does not support fetching sparse index on an authenticated registry #50

Open
cpaika opened this issue Mar 7, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@cpaika
Copy link

cpaika commented Mar 7, 2024

Describe the bug
I am running an internal Artifactory instance. My config.json has the flag auth-required: true defined in it, which has been merged as the standard in the last few months: https://rust-lang.github.io/rfcs/3139-cargo-alternative-registry-auth.html#guide-level-explanation

When this flag is enabled, the client should fetch the crate index sending an Authorization header.

Currently I'm getting a 403 attempting to use this library against an authenticated private registry because its fetching the index without setting Authorization.

To Reproduce
Steps to reproduce the behavior:
Setup private repository, with authenticated crate index access (may be difficult)
Attempt to publish or fetch a crate to the private registry
See the command fail

Expected behavior
The library should send an authorization header for the index fetches if auth-required is true in the config.json.

@cpaika cpaika added the bug Something isn't working label Mar 7, 2024
@Jake-Shadle
Copy link
Member

I have a bunch of other stuff to work on so don't really have time to investigate this, if you come up with a simple (ie no dependencies preferably) method of retrieving an index's token then I'd accept a PR, but in the meantime you could use https://docs.rs/tame-index/latest/tame_index/index/sparse/struct.SparseIndex.html#method.make_remote_request to create the request and append the authentication token manually and then execute the request yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants