Open Eh2406 opened 2 months ago
This is a general problem affecting credential providers other than cargo:token
. I can repro a similar issue on Linux with cargo:libsecret
as the provider when running echo token | cargo login
, then attempting to
I had intended to fix this at the same time as #13615. I'll prioritize getting this in soon.
@rustbot claim
Problem
On Windows authentication tokens that end and a new line do not properly get stripped when running publish or yank commands (others not yet tested). The new line do get stripped on other OS's. Even more oddly, if the registry requires authentication the new line is stripped when retrieving index or crate files.
Steps
This slightly convoluted setup is because the documentation for
cargo:token-from-stdout
explicitly documents that new-lines's are trimmed. https://doc.rust-lang.org/beta/cargo/reference/registry-authentication.html#cargotoken-from-stdout-command-args but the problem can be more easily reproduced with the simple:Caused by: token contains invalid characters. Only printable ISO-8859-1 characters are allowed as it is sent in a HTTPS header.
Caused by: token contains invalid characters. Only printable ISO-8859-1 characters are allowed as it is sent in a HTTPS header.