Open
Description
Problem
The structures defined in the credential provider protocol use borrowed string (&'a str
) types that can only be deserialized if they don't contain any characters that need to be escaped by JSON. If escaping is required then the deserialization fails with:
invalid type: string "test\ning", expected a borrowed string
This can occur if, for example, the user attempts to use a "
in a registry auth token. This is not a bug in the JSON protocol itself.
Steps
- Set up a credential provider
- Run
cargo login
- Use a token that contains a
"
Possible Solution(s)
- Switch to using
Cow<'a, str>
in the credential struct definitions. - Switch to using
String
in the struct definitions.
Any solution seems to require a breaking change to the credential struct definitions.
Notes
No response
Version
cargo 1.78.0-nightly (fc1d58fd0 2024-02-09)
release: 1.78.0-nightly
commit-hash: fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3
commit-date: 2024-02-09
host: x86_64-pc-windows-msvc
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.6.0-DEV (sys:0.4.71+curl-8.6.0 vendored ssl:Schannel)
os: Windows 10.0.26085 (Windows 11 Enterprise) [64-bit]