This Insomnia plugin allows you to interact with the Bitwarden Secrets Manager (bws) CLI to perform operations such as retrieving secrets and projects.
bws CLI installed on your system. You can install the CLI using the following commands:
curl https://bws.bitwarden.com/install | sh`
iwr https://bws.bitwarden.com/install | iex
In order for Insomnia to recognize the plugin as an Insomnia plugin, please copy the plugin files to the following locations:
MacOS: ~/Library/Application Support/Insomnia/plugins/
(escaped version: ~/Library/Application\ Support/Insomnia/plugins/
)
Windows: %APPDATA%\Insomnia\plugins\
Linux: $XDG_CONFIG_HOME/Insomnia/plugins/
or ~/.config/Insomnia/plugins/
The plugin requires you to set the bws CLI path and access token in the environment variables.
Below is an example configuration:
{
"__bws_plugin": {
"cliPath": "/usr/local/bin/bws",
"accessToken": "<your-access-token>"
},
"secret": "{% bws 'getSecret' 'your-secret-uuid' %}"
}
cliPath
: Path to the bws CLI executable.accessToken
: Your Bitwarden access token.
Get Secret
: Retrieve a secret by its UUID.Get Project
: Retrieve a project by its UUID.
To retrieve a secret by its UUID, use the following template tag in your Insomnia request:
"{% bws 'getSecret' 'your-secret-uuid' 'value' %}"
To retrieve a project by its UUID, use the following template tag in your Insomnia request:
"{% bws 'getProject' 'your-project-uuid' 'name' %}"
You can specify an optional field to filter the value.
For instance, if you only want to get the value
field in the example below:
{
"id": "your-secret-id",
"organizationId": "your-organization-id",
"projectId": "your-project-id",
"key": "your-key",
"value": "your-value",
"note": "",
"creationDate": "2024-01-24T10:46:40.970622500Z",
"revisionDate": "2024-04-09T08:51:11.377613300Z"
}
Use the following template tag:
"{% bws 'getSecret' 'your-secret-id' 'value' %}"
Instead of manually typing the template tags, you can use the autocomplete menu to insert them. Press Ctrl + Space
wherever environment variables can be used to launch the autocomplete menu and select the desired bws operation.
For more information on referencing environment variables, visit the Insomnia documentation.
If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.