pub enum KeyringProvider {
SecretTool,
KwalletQuery,
Security,
Pass,
}wizard only.Expand description
A well-known credential-provider CLI a password can be read from.
Variants§
SecretTool
secret-tool, over the Secret Service (GNOME Keyring).
KwalletQuery
kwallet-query, over the KDE Wallet.
Security
security, over the macOS Keychain.
Pass
pass, the standard unix password manager.
Implementations§
Source§impl KeyringProvider
impl KeyringProvider
Sourcepub fn available() -> Vec<Self>
pub fn available() -> Vec<Self>
The providers relevant on the running OS, the ones actually installed first and the rest in their wake, each group keeping the native-first order. Empty on platforms without a known stdin-friendly provider (Windows), where the picker goes straight to a custom command.
Sourcepub fn installed(self) -> bool
pub fn installed(self) -> bool
Whether this provider’s CLI is found on the PATH, which is what
leads the pick list: an installed provider is one a secret can be
stored in today, while the rest are a package install away.
The provider names its own program, being the first element of its read command, so no table of binary names is duplicated here.
Sourcepub fn read_command(self, service: Option<&str>, key: &str) -> Vec<String>
pub fn read_command(self, service: Option<&str>, key: &str) -> Vec<String>
The argv (program + arguments, no shell) printing the secret at
key on stdout — the value of the *.command config field.
key is used verbatim as the entry identifier: service is
an optional namespace a self-owning broker (which stores and
reads its own value, e.g. an OAuth token manager) adds — a path
prefix for pass/kwallet, a distinct attribute for
secret-tool/security. Pass None to read a pre-existing entry
exactly as named.
Sourcepub fn write_command(self, service: Option<&str>, key: &str) -> String
pub fn write_command(self, service: Option<&str>, key: &str) -> String
The shell command line persisting a secret it receives on stdin
— the write half of a store/read pair for a broker that owns the
value (e.g. an OAuth token manager), as opposed to a pre-existing
entry the user stores themselves. A shell line rather than an
argv: the writes rely on shell features ($(cat) on macOS).