-
Notifications
You must be signed in to change notification settings - Fork 55
feat: add Bitwarden Password Manager provider #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 17 commits
17ba5d9
731a77d
8db9e07
dd9672b
d309999
c59a8f1
3840a50
caece11
391cc43
3ef4115
0237708
e092416
6c0b679
56eceff
92ba652
9c2890c
31961a4
0cfcfce
5b3f13e
857e32d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,5 @@ target | |
| /secretspec-dotnet/**/obj/ | ||
|
|
||
| .idea/ | ||
|
|
||
| .pi/ | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,200 @@ | ||
| --- | ||
| title: Bitwarden Password Manager Provider | ||
| description: Bitwarden Password Manager secrets management integration | ||
| --- | ||
|
|
||
| The `bw` provider integrates with Bitwarden Password Manager for secret management with vault-wide access to all item types. | ||
|
|
||
| :::note[Version compatibility] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2 — Advertise the actual target release everywhere The base already contains the released |
||
| The Bitwarden Password Manager provider is an upcoming SecretSpec 0.16 feature and is not | ||
| available in SecretSpec 0.15. | ||
| ::: | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Bitwarden CLI (`bw`) | ||
| - Bitwarden account | ||
| - Signed in via `bw login` and unlocked with `bw unlock` | ||
| - `BW_SESSION` environment variable set | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### URI Format | ||
|
|
||
| #### Password Manager URIs | ||
| ``` | ||
| bw://[collection-id] | ||
| bw://[org@collection] | ||
| bw://?server=https://vault.company.com | ||
| bw://?type=login&field=password | ||
| ``` | ||
|
|
||
| - `collection-id`: Target collection ID | ||
| - `org@collection`: Organization and collection specification | ||
| - `type`: Item type (login, card, identity, sshkey, securenote) | ||
| - `field`: Specific field to extract | ||
|
|
||
| ### Examples | ||
|
|
||
| ```bash | ||
| # Password Manager - Personal vault | ||
| $ secretspec set API_KEY --provider bw:// | ||
|
|
||
| # Password Manager - Organization collection | ||
| $ secretspec set DATABASE_URL --provider "bw://myorg@dev-secrets" | ||
|
|
||
| # Password Manager - Self-hosted instance | ||
| $ secretspec set TOKEN --provider "bw://?server=https://vault.company.com" | ||
|
|
||
| # Password Manager - Specific item type and field | ||
| $ secretspec get 'MyApp Database' --provider 'bw://?type=login&field=username' | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Basic Commands | ||
|
|
||
| ```bash | ||
| # Set a secret (Password Manager) | ||
| $ secretspec set DATABASE_URL | ||
| Enter value for DATABASE_URL: postgresql://localhost/mydb | ||
| ✓ Secret DATABASE_URL saved to Bitwarden | ||
|
|
||
| # Get a secret from existing vault item | ||
| $ secretspec get 'MyApp Database' --provider 'bw://?type=login' | ||
|
|
||
| # Run with secrets | ||
| $ secretspec run -- npm start | ||
| ``` | ||
|
|
||
| ### Item Type Configuration | ||
|
|
||
| The Bitwarden provider supports all Bitwarden item types with smart field detection: | ||
|
|
||
| #### Login Items (Default) | ||
| ```bash | ||
| # Get password field (default) | ||
| $ secretspec get 'Database Login' --provider 'bw://?type=login' | ||
|
|
||
| # Get username field | ||
| $ secretspec get 'Database Login' --provider 'bw://?type=login&field=username' | ||
|
|
||
| # Get custom field | ||
| $ secretspec get 'API Service' --provider 'bw://?type=login&field=api_key' | ||
| ``` | ||
|
|
||
| #### Credit Card Items | ||
| ```bash | ||
| # Get API key from custom field (field required) | ||
| $ secretspec get 'Stripe Payment' --provider 'bw://?type=card&field=api_key' | ||
|
|
||
| # Get card number | ||
| $ secretspec get 'Company Card' --provider 'bw://?type=card&field=number' | ||
| ``` | ||
|
|
||
| #### SSH Key Items | ||
| ```bash | ||
| # Get private key (default) | ||
| $ secretspec get 'Deploy Key' --provider 'bw://?type=sshkey' | ||
|
|
||
| # Get passphrase | ||
| $ secretspec get 'Deploy Key' --provider 'bw://?type=sshkey&field=passphrase' | ||
| ``` | ||
|
|
||
| #### Identity Items | ||
| ```bash | ||
| # Get custom field (field required) | ||
| $ secretspec get 'Employee Record' --provider 'bw://?type=identity&field=employee_id' | ||
|
|
||
| # Get email field | ||
| $ secretspec get 'Personal Identity' --provider 'bw://?type=identity&field=email' | ||
| ``` | ||
|
|
||
| #### Secure Note Items | ||
| ```bash | ||
| # Get value from secure note | ||
| $ secretspec get 'Legacy Config' --provider 'bw://?type=securenote&field=config_value' | ||
| ``` | ||
|
|
||
| ### Profile Configuration | ||
|
|
||
| ```toml | ||
| # secretspec.toml | ||
| [development] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2 — Use valid profile configuration in the provider guide These tables do not match the project configuration schema: profiles are under |
||
| provider = "bw://dev-secrets" | ||
|
|
||
| [production] | ||
| provider = "bw://prod-secrets" | ||
|
|
||
| ``` | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| #### Authentication | ||
| ```bash | ||
| # Password Manager session | ||
| $ export BW_SESSION="your-session-key" | ||
| ``` | ||
|
|
||
| #### Configuration Defaults | ||
| ```bash | ||
| # Set item type and field defaults | ||
| $ export BITWARDEN_DEFAULT_TYPE=login | ||
| $ export BITWARDEN_DEFAULT_FIELD=password | ||
|
|
||
| # Organization settings | ||
| $ export BITWARDEN_ORGANIZATION=myorg | ||
| $ export BITWARDEN_COLLECTION=dev-secrets | ||
|
|
||
| # Use defaults | ||
| $ secretspec get DATABASE_PASSWORD --provider bw:// | ||
| ``` | ||
|
|
||
| ### CI/CD Integration | ||
|
|
||
| #### Password Manager with Session Key | ||
| ```bash | ||
| # Login and unlock (interactive) | ||
| $ bw login | ||
| $ bw unlock | ||
|
|
||
| # Export session for automation | ||
| $ export BW_SESSION="session-key-from-unlock" | ||
|
|
||
| # Use in CI/CD | ||
| $ secretspec run --provider bw://Production -- deploy | ||
| ``` | ||
|
|
||
| ### Field Requirements by Item Type | ||
|
|
||
| | Item Type | Default Field | Field Required? | Notes | | ||
| |--------------|----------------|-----------------|--------------------------| | ||
| | Login | `password` | No | Falls back to username | | ||
| | SSH Key | `private_key` | No | Standard SSH key field | | ||
| | Card | None | **YES** | Must specify field | | ||
| | Identity | None | **YES** | Must specify field | | ||
| | Secure Note | Smart detect | No | Uses note content/fields | | ||
|
|
||
| ## Error Handling | ||
|
|
||
| The provider includes comprehensive error handling with helpful guidance: | ||
|
|
||
| ### CLI Installation | ||
| ``` | ||
| Bitwarden CLI (bw) is not installed. | ||
|
|
||
| To install it: | ||
| - npm: npm install -g @bitwarden/cli | ||
| - Homebrew: brew install bitwarden-cli | ||
| - Download: https://bitwarden.com/help/cli/ | ||
| ``` | ||
|
|
||
| ### Authentication Issues | ||
| - Clear distinction between "not logged in" vs "vault locked" | ||
| - Step-by-step guidance for `bw login` and `bw unlock` | ||
| - Session key setup instructions | ||
|
|
||
| ### Item Access | ||
| - Graceful handling of missing items | ||
| - Field validation and suggestions | ||
| - Organization/collection permission guidance | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2 — Remove the unresolved changelog merge marker
The literal
>>>>>>> upstream/mainis a merge artifact and will be published as part of the 0.16 changelog unless removed.