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!)
Publish a package to a private registry (requires auth to publish) that depends on another package in that private registry (requires auth to download).
Working with private registry
I think the registry needs to explicitly inform cargo that it requires auth (
auth-required
) in theconfig.json
here: https://github.com/sonatype-nexus-community/nexus-repository-cargo/blob/57760b63228c1f821ec08320f3591c7f7bd1b1ef/src/main/java/org/sonatype/nexus/plugins/cargo/registry/CargoRegistryFacetImpl.java#L160as per https://github.com/rust-lang/cargo/issues/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.
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: