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

Separate ~/.cargo/credentials #3748

Closed
tarcieri opened this issue Feb 21, 2017 · 4 comments
Closed

Separate ~/.cargo/credentials #3748

tarcieri opened this issue Feb 21, 2017 · 4 comments

Comments

@tarcieri
Copy link

Originally from: rust-lang/crates.io#78

Right now the crates.io API token used by cargo is stored in the [registry.token] section of ~/.cargo/config (which, as it were, has 644 file permissions by default, i.e. world readable)

I think it would make more sense to separate credentials into a separate file (e.g. ~/.cargo/credentials or ~/.cargo/token) which always has 600 file permissions and will warn or not function if the permissions are too loose

Some precedent here is RubyGems, which stores its equivalent credentials in a ~/.gem/credentials file, which always has 600 permissions

@alexcrichton
Copy link
Member

Sounds like a good idea to me!

@kmcallister
Copy link

This is a pretty big deal!

As another data point, OpenSSH will refuse to run if your file permissions aren't on point.

bors added a commit that referenced this issue Jun 13, 2017
Move API token into the separate file.

Fix of #3748. BTW, it's not clear what to do with old config.
Should I add a check for old config and try to remove [repository.token] field from it every time user add a new token?
Or should I just prefer to use a token field from a new config over the old one?
@sfackler
Copy link
Member

I think this can be closed.

@tarcieri
Copy link
Author

Nice! Glad to see this ship.

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

4 participants