Expand description
ai6-secret-bitwarden: the bitwarden secret provider. A secret is a field of one item of a
Bitwarden or Vaultwarden vault, read through the bw command line, which decrypts on this
host: the server only ever holds the encrypted vault. Credentials reach bw in its
environment, never in an argument. Calls block; the host calls them off its async runtime.
§ai6-secret-bitwarden
The bitwarden secret provider for AI6: a secret is a field
of one item of a Bitwarden or Vaultwarden vault, read through the bw command line, which
decrypts on this host: the server only ever holds the encrypted vault. See the
API header.
§Features
- One item’s
password,username,notes,uri,totpseed or custom field per secret. - Logs the CLI in with an API key and unlocks it with the master password, or takes an unlocked vault’s session key; keeps the session and replaces it once if it lapses.
- Credentials are secret references the Station reads when it builds the instance, and travel to
bwin its environment, never in an argument; aBW_*variable of the Station’s own is not passed on. httpsservers only unless the operator setsallow_http.- No value in any error or
Debug; every buffer that held one is wiped.
§Installation
Part of the AI6 workspace; built with it, and loaded by a Station through [station.plugins]. It
needs the Bitwarden CLI (bw) on the Station’s host:
cargo build -p ai6 --features cli -p ai6-secret-bitwarden§Quick start
[secret_provider.vault]
provider = "bitwarden"
server = "https://vault.example"
data_dir = "/var/lib/ai6/bw" # a CLI state of its own
client_id = "user.00000000-0000-0000-0000-000000000000"
client_secret = { provider = "file", key = "bw-client-secret" }
password = { provider = "file", key = "bw-master" }
[secret.forge]
provider = "vault"
key = "forge token" # the item's name, or its ID
field = "password" # the default
env = "GH_TOKEN"§Development
cargo test -p ai6-secret-bitwarden
cargo clippy -p ai6-secret-bitwarden --all-targets -- -D warningsThe tests run on a stand-in bw that keeps a small vault; no account is needed. The ignored live
test (tests/live.rs) needs a Vaultwarden account made for it and the AI6_TEST_BW_* settings the
file lists, plus AI6_TEST_LIVE_SECRETS=1.
§License
MPL-2.0. See LICENSE.
Structs§
- Bitwarden
- Reads fields of a Bitwarden vault’s items through the
bwcommand line. - Bitwarden
Config - One instance’s settings, from
[secret_provider.<name>]. - Bitwarden
Fields - What one secret names besides
key(the item’s name or ID). - Call
- One call of
bw: its arguments (never a secret) and the variables it runs with. - Outcome
- What
bwleft. - RunError
- Why
bwcould not be run to its end. The text holds no value.
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§
- Runner
- Runs the
bwprogram: what the provider needs of the Bitwarden CLI.
Functions§
- guatiao_
library_ ⚠entry - The symbol a
guatiaohost loads this library by.