Closed mbodmer closed 1 month ago
I don't understand the intentions of the design
Consider what you don't understand or doesn't reasonate with you as "wrong design". Let me know how you would design this part so that we can reason about it together 👍
also have not the cargo/http/auth knowledge for this.
Yeah, every time I touch this part it feels like I need to study cargo auth from scratch 😂
I had similar issue with a private artifactory. From my investigation, the cause is because the --token
is used to access registry. But if --registry
and --token
are not provided no token is used (the value from environment is not used).
This issue also prevent to use multiple registries and tokens.
I made a "fix", @MarcoIeni are you ok for a PR to discuss about it?
are you ok for a PR to discuss about it?
Sure. Go for it!!!
Cool, thank you! I'll try it out
Bug description
I am using cargo with a private registry (kellnr.io, sparse index) which is read and write protected.
Credentials are needed for every operation on it. Cargo takes them from the file
~/.cargo/credentials.toml
which looks like:If you want to read up more on configuration see: https://kellnr.io/documentation#configure-cargo and https://doc.rust-lang.org/cargo/reference/registry-authentication.html
When running
release-plz release-pr --backend gitlab --git-token "mygit-token-here" --registry myregistry
everything works fine:however running
release-plz release --backend gitlab --git-token "mygit-token-here" --registry myregistry
does not work when there is an actual release waiting to be released:It only works when additionally given the registry token on the commandline like:
release-plz release --backend gitlab --git-token "mygit-token-here" --registry myregistry --token "myregistry-token-here"
.Log is more or less the same as above, but this time data is transferred and then cargo publish is called:
Looks like in
cargo.rs
fn fetch_sparse_metadata()
would only work with a token set for authenticated registries.From afar, it looks like there is not much of common ground in usage between release-pr/update(release) in this regard. Maybe I did just not understand it yet.
Making available both,
credentials.toml
and the--token xy
on the commandline somehow works in my case, but not when one of them is missing.This does not make a lot of sense from a usage standpoint. Also this enforces credentials injection in multiple ways for release-plz.
Would work on a PR, but I don't understand the intentions of the design and also have not the cargo/http/auth knowledge for this.