Expand description
ai6-secret-system: the system secret provider. A secret is an entry of the host’s own
secret store, named by its key under the instance’s service: Windows Credential Manager
on Windows, the Secret Service (through secret-tool) on Linux. Other platforms are refused
when the instance is built. Calls block; the host calls them off its async runtime.
§ai6-secret-system
The system secret provider for AI6: a secret is an entry
of the host’s own secret store, so a token a person already keeps there is never copied into a
configuration file. It reads, and it stores (Outer Office’s masked box keeps a value here without
the value ever being read back). See the
API header.
§Features
- Windows Credential Manager: a generic credential
<service>/<key>, the value as UTF-16. - Linux: the Secret Service through libsecret’s
secret-tool. The value travels on the program’s standard input and output, never in an argument. - A
servicenamespace per instance, so another program’s entries and these never meet. - No value in any error or
Debug; every buffer that held one is wiped.
Other platforms are refused when the instance is built. macOS’s Keychain is not implemented.
§Installation
Part of the AI6 workspace; built with it, and loaded by a Station through [station.plugins]:
cargo build -p ai6 --features cli -p ai6-secret-system§Quick start
[secret_provider.local]
provider = "system"
service = "ai6" # default
[secret.signing]
provider = "local"
key = "signing key" # the entry's name
env = "SIGNING_KEY"On Linux the program secret-tool (package libsecret or libsecret-tools) and a running,
unlocked Secret Service such as GNOME Keyring or KWallet are needed.
§Development
cargo test -p ai6-secret-system
cargo clippy -p ai6-secret-system --all-targets -- -D warnings
# The real store of this host (Credential Manager; a Secret Service on Linux):
AI6_TEST_LIVE_SECRETS=1 cargo test -p ai6-secret-system --test live -- --ignoredThe tests run on an in-memory store and, on Linux, a stand-in secret-tool; no account is
needed. The ignored live test keeps and reads one entry in a service of its own and removes it.
§License
MPL-2.0. See LICENSE.
Structs§
- Store
Error - Why a store call failed. The text names the operation and an error code, never a value.
- System
Config - One instance’s settings, from
[secret_provider.<name>]; every one has a default. - System
Secrets - Reads and keeps secrets in the host’s own secret store.
Constants§
- PROVIDER_
ID - The provider ID a
[secret_provider.<name>]instance or a secret names.
Statics§
- guatiao_
declares - What this library declares, read by a scanner as data.
Traits§
- Store
- A host’s secret store: what the provider needs of Credential Manager or the Secret Service.
Functions§
- guatiao_
library_ ⚠entry - The symbol a
guatiaohost loads this library by.