-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Allow specifying a credentials file other than ~/.cargo/credentials #5638
Comments
It is worth noting (for others in the same boat if nothing else) that the current plan is to just make |
Throwing in another possible workaround: Maybe Having a flag to avoid the need for any workaround would be best. |
I’m in the middle of a house move, but a quick grep for credentials makes me think this wouldn’t be a huge change. (Famous last words!) I’d be willing to have a first attempt at this patch if people think it’s a good idea. |
Sorry for the slow reply, the decisive people that have final say on these things are on vacation or otherwise unavailable. My impression is that they will be back soon. FWIIW, I like the suggestion, and stoked that Hypothesis will be using rust. |
Another possible solution is to make cargo read credentials from cargo/src/cargo/util/config.rs Lines 616 to 635 in 5845464
|
@alexwlchan how is that first pass going? Anything we can do to help? |
@Eh2406 I haven’t started working on it yet; I read this bit:
and decided I�’d wait until I got the definitive okay, and since it never came, the emails languished in my inbox. |
I am sorry for that. Let me see if I can get there attenchen. @rust-lang/cargo recommendation on how to resolve this issue, are the proposed solutions exeptibal? |
No worries, no rush, I just didn’t want to sink a bunch of time without knowing if I was doing the right thing. :-) |
We'd definitely like to see an RFC for this, especially because any change here has security implications. Speaking only for myself, I would roughly suggest that I'd prefer a solution that passes this configuration either by environment variable or by an include directive, rather than by an executable script, unless you absolutely need a script. |
Another, Travis CI only fix is to delete the file in We could also propose changing the default behaviour of |
Btw this RFC may help with this. |
@ehuss pointed out that you can also use the env |
Triage: The credential file is still hardcoded to be in |
This has now been stabilized. Between that and the other options mentioned, I'm going to assume this is resolved. If there is a reason we should re-open this, let us know! |
As the title suggests.
Use case
In Hypothesis (https://github.com/HypothesisWorks/hypothesis), we’re going to start publishing Rust packages soon. We have a continuous release process that means all our releases are done by Travis CI.
We store our credentials (crates.io, PyPI, Rubygems, …) in an encrypted ZIP file, which is unpacked by Travis at runtime. For Cargo, this means copying our
credentials
file from the ZIP file into~/.cargo/credentials
– but we ask Travis to cache~/.cargo
!The Travis docs are very explicit about not putting secrets in the cache:
So it would be nice if we could tell
cargo publish
to look somewhere outside~/.cargo
for a credentials file.I wonder if this also opens the door for #4645?
Possible interface
For consistency with
--manifest-path
, something like:$ cargo publish --credentials-path secrets/cargo-credentials
Other examples
We use twine to upload our Python packages, which has a
--config-file
for passing a path to our PyPI credentials:(ETA: I found a couple of other tickets about the credentials file, but I couldn’t find this exact suggestion. Happy to close if it’s a duplicate I’ve missed!)
The text was updated successfully, but these errors were encountered: