Keys / crates.io
CARGO_REGISTRY_TOKEN
The crates.io API token Cargo publishes crates with, such as cargo publish in CI.
- Starts with
cio- Expires
- you choose, or never
- API
- revoke only; create on crates.io
Get it
Create one on crates.io/settings/tokens. The steps aren't recorded yet.
Set it
CARGO_REGISTRY_TOKEN=cio...
Cargo reads it for crates.io in place of registry.token; --token overrides it. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- Create a new token with the same endpoint scopes and crate scopes.
- Deploy it everywhere that reads
CARGO_REGISTRY_TOKEN. - Check that nothing still uses the old token, then revoke it on the API Tokens page.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.