This release is a pre-release and may not be stable for production use.
Fujin Secrets - Bitwarden
Bitwarden (and Vaultwarden) secret adapter for the Fujin deployment tool.
Installation
pip install fujin-secrets-bitwarden
Or with uv:
uv pip install fujin-secrets-bitwarden
Prerequisites
Download and install the Bitwarden CLI and log in to your account. When using a self-hosted Vaultwarden instance, point the CLI at your server first:
bw config server https://vault.example.com
Then log in and unlock the vault:
bw login
export BW_SESSION="$(bw unlock --raw)"
Configuration
[secrets]
adapter = "bitwarden"
[secrets.options]
password_env = "BW_PASSWORD"
folders = ["fujin/myapp/prod", "fujin/shared"]
| Option | Type | Description |
|---|---|---|
password_env |
string | Name of the environment variable holding the vault password. Used to unlock the vault when BW_SESSION is not set. |
folders |
string or list of strings | Bitwarden folder names to resolve refs from, in lookup order (first match wins). A single name is accepted as a one-element order. An empty list is rejected at config load; omit the option for whole-vault name lookup. |
Alternatively, set the BW_SESSION environment variable (export BW_SESSION="$(bw unlock --raw)").
When BW_SESSION is present, Fujin uses it directly and password_env is not
required.
Folder layout
App secrets are usually kept in dedicated folders so personal logins can never collide with app env refs:
fujin/
├── myapp/
│ ├── prod/ # prod-only secrets
│ └── staging/
└── shared/ # cross-app secrets (SMTP, S3, DB URLs)
Both forms of folders are accepted: a list (lookup order) or a bare string
(folders = "fujin/shared", a one-element order). folders = [] is a
configuration error at load time; remove the option instead when you want
whole-vault lookup.
Each deployment host can point at a different folder order while all hosts
share the same .env template. A host-scoped [hosts.secrets] block
replaces the global [secrets] table for that host (it is not merged), so
repeat adapter and password_env in the per-host block:
[secrets]
adapter = "bitwarden"
[secrets.options]
password_env = "BW_PASSWORD"
folders = ["fujin/shared"]
[[hosts]]
name = "prod"
address = "prod.example.com"
user = "deploy"
[hosts.secrets]
adapter = "bitwarden"
[hosts.secrets.options]
password_env = "BW_PASSWORD"
folders = ["fujin/myapp/prod", "fujin/shared"]
[[hosts]]
name = "staging"
address = "staging.example.com"
user = "deploy"
[hosts.secrets]
adapter = "bitwarden"
[hosts.secrets.options]
password_env = "BW_PASSWORD"
folders = ["fujin/myapp/staging", "fujin/shared"]
The same override can live in a machine-local per-host override file,
.fujin/hosts/<name>.toml (host-level keys sit at the top level):
# .fujin/hosts/prod.toml
[secrets]
adapter = "bitwarden"
[secrets.options]
password_env = "BW_PASSWORD"
folders = ["fujin/myapp/prod", "fujin/shared"]
Usage
In your environment file (.env or configured via envfile in fujin.toml),
prefix secret values with $:
DEBUG=False
DB_PASSWORD=$DB_PASSWORD
SMTP_PASSWORD=$fujin/shared/SMTP_PASSWORD
$DB_PASSWORD resolves to the item named DB_PASSWORD; $fujin/shared/SMTP_PASSWORD
resolves that item explicitly from the fujin/shared folder. $$ escapes a
literal $ and is never looked up (PASSWORD=pa$$word deploys pa$word).
Resolution
With folders
Fujin resolves folder names to ids once per deploy, then issues one
bw list items --folderid <id> --raw call per configured folder (no
bw get password calls). The resulting exact-name item maps are resolved in
configured order:
$DB_PASSWORDis looked up by exact item name infujin/myapp/prod, thenfujin/shared.- The first folder that contains an item with that exact name wins. Duplicate item names in later folders are ignored.
- Folder names themselves must be unique in the vault: if
bw list foldersreturns two folders with the same configured name, resolution fails closed and names that folder instead of picking one arbitrarily. - A folder-prefixed ref such as
$fujin/shared/postgresresolves only from that folder, which disambiguates items that share a name across folders. - If no configured folder contains the ref, the deploy fails closed before anything is uploaded. The error names the env key, the ref and the folders that were tried; resolved values are never echoed.
Only login items that have a password are used. Secure notes, cards, identities and login items without a password are skipped.
Without folders
Backwards compatible with earlier releases: every ref is resolved by item name
across the whole vault with one concurrent bw get password <name> --raw
call per ref. Use folders when names can collide between apps and personal
logins.
Related
Metadata
Release files for fujin-secrets-bitwarden 0.28.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fujin_secrets_bitwarden-0.28.0b1.tar.gz | 6.7 kB | With provenance | Details for fujin_secrets_bitwarden-0.28.0b1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fujin_secrets_bitwarden-0.28.0b1-py3-none-any.whl | Python 3 | none | any | Details for fujin_secrets_bitwarden-0.28.0b1-py3-none-any.whl |
Total release size: 14.3 kB
Release files / fujin_secrets_bitwarden-0.28.0b1.tar.gz
| Download URL | fujin_secrets_bitwarden-0.28.0b1.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35034bfbe1506024519f24b3f9edbeae2cb093977571edfb376681add1068265
|
|
BLAKE2b-256 checksum How to use checksums |
e40ef1b0bf33d175476a3b9f4ac340e36004042cd01bd629f0000c140afe4c9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logRelease files / fujin_secrets_bitwarden-0.28.0b1-py3-none-any.whl
| Download URL | fujin_secrets_bitwarden-0.28.0b1-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2ff1ed7321fd4f464c1a4e3a66aa494358315fc44c7ec317b82cb577a24b8d5
|
|
BLAKE2b-256 checksum How to use checksums |
309e462d24f60d7c804c220a39f30737a3949e11de278526e927c3f48dcd5e3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logSecurity for fujin-secrets-bitwarden 0.28.0b1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for fujin_secrets_bitwarden-0.28.0b1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.