Improve documentation about private registry credentials #15021
Labels
A-registries
Area: registries
A-registry-authentication
Area: registry authentication and authorization (authn authz)
Problem
In the Cargo Book it states that you can set a token like so.
However, the Cargo uses this token directly in the
Authorization
header without modifying it.Many private registries will expect the token in the bearer format (
Bearer {token}
) so you will need to addBearer
to the token field incredentials.toml
.Generally when I see a
token
field in a config file, I expect to just add my token without caring about the format the registry expected the token to be delivered in. This lead to a good amount of confusion today 😅Possible Solution(s)
Basic
orBearer
to the token field.Bearer
if there is a 401 response.Notes
There is already precedence for retry failed request for getting the index
config.json
so extending it to downloading crates seems reasonable.See the sparse authentication docs
Version
The text was updated successfully, but these errors were encountered: