Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #12334 - arlosi:cred-ext, r=ehuss
credential provider implementation The current credential process protocol only allows sending the credential without any additional information. This changes the protocol in two important ways: Cargo will tell the credential provider what the token is needed for, and the credential provider can tell Cargo how the token can be used. Since the credential provider knows why Cargo needs a token (`publish` for example), it can produce a signed token specifically for that operation. This would enable a credential process to produce an asymmetric token, or a token with restricted scope such as PASETO or Biscuit. The credential process can also indicate back to Cargo if the token can be cached in-memory for subsequent requests. For example, if a credential provider integrates with an SSO identity provider that provides short-lived tokens, Cargo will only continue to use the token while it is valid. ### Summary of changes * Rename `credential-process` to `credential-provider` in config. * Add a new line-oriented JSON protocol for communicating with external credential providers via stdin/stdout. * Allow built-in credential providers to run in the Cargo process. * Move support for asymmetric tokens (RFC3231) into a built-in credential provider (`cargo:paseto`). * Change the unstable key for asymmetric tokens from `registry-auth` to `credential-process` * Add a new built-in provider to represent the current config/token based system (`cargo:token`). * Add a new built-in provider for the a "basic" provider that prints only the token on stdout (`cargo:basic`). * Create a new config key for the fallback credential providers (`registry.credential-providers`) as a list. * The provider for `crates.io` no longer also acts as a fallback for other registries. * Adds a `[credential-alias]` table for defining aliases of credential providers. * Collect all headers from `http_registry` requests, passing them through to the cred provider. Everything remains unstable under the `-Zcredential-process` flag. ### How to review this: I recommend starting with the changes in `unstable.md` for a more detailed description. ### Open questions * [x] Should we pass all the HTTP headers rather than just `www-authenticate`
- Loading branch information