Available on crate feature
wizard only.Expand description
OS-aware credential-provider picker shared by the account wizards.
A secret is read from a well-known credential CLI, from a custom shell command, or stored raw in the configuration. Two flavours share the same machinery:
- a password is read from an OS keyring (
KeyringProvider); - an OAuth 2.0 access token is read from a token broker
(
TokenBroker) that refreshes it on every read.
A known provider or broker yields an argv command (no shell), so the config serializes it as a TOML array; only a custom command falls back to a shell string. The picker never writes the secret: it just records the read command, leaving the value for the user to store under the chosen entry beforehand.
Enums§
- Keyring
Provider - A well-known credential-provider CLI a password can be read from.
- Secret
Choice imaporjmaporsmtp - A secret collected by the picker.
- Token
Broker - A well-known OAuth 2.0 token broker: an external CLI that owns the account’s refresh token and prints a fresh access token on stdout.
Functions§
- prompt_
secret imaporjmaporsmtp - Prompts for a password: a pick list of the OS keyring providers, then
a custom command, then a raw value. See [
prompt_choice] for how the entry is resolved. - prompt_
token imaporjmaporsmtp - Prompts for an API token: a pick list combining the OS keyrings (for
a token the user generated on the provider and stored themselves) and,
when
oauthis true, the OAuth 2.0 token brokers (which refresh and print a fresh token on every read), then a custom command and a raw value. Same aim asprompt_secret— a command that returns the token — merging both acquisition paths behind one strategy prompt. The brokers are hidden unless the service advertises OAuth.