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

Missing auth-required for private registries #36

Open
jocutajar opened this issue Jan 18, 2024 · 0 comments
Open

Missing auth-required for private registries #36

jocutajar opened this issue Jan 18, 2024 · 0 comments

Comments

@jocutajar
Copy link

jocutajar commented Jan 18, 2024

  • What are you trying to do?

Publish a package to a private registry (requires auth to publish) that depends on another package in that private registry (requires auth to download).

  • What feature or behavior is this required for?

Working with private registry

  • How could we solve this issue? (Not knowing is okay!)

I think the registry needs to explicitly inform cargo that it requires auth (auth-required) in the config.json here:

as per rust-lang/cargo#10920
and https://doc.rust-lang.org/nightly/cargo/reference/registry-index.html#index-configuration

but only if it is a private registry. Public registries should have that set to false I guess.

  • Anything else?

I suppose we could make the registry accessible for read to anonymous users, that would work around the limitation.

Without the auth-required: true config value, cargo publish fails with:

Updating `my-registry` index
   Packaging my-crate v0.1.0 (/home/me/my-crate)
   Verifying my-crate v0.1.0 (/home/me/my-crate)
    Updating crates.io index
error: failed to verify package tarball

Caused by:
  failed to download from `https://nexus.example.com/repository/our-crates/api/v1/crates/my-dependency/0.1.0/download`

Caused by:
  failed to get successful HTTP response from `https://nexus.example.com/repository/our-crates/api/v1/crates/my-dependency/0.1.0/download` (1.2.3.4), got 401
  body:
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

No branches or pull requests

1 participant