Skip to content

Commit

Permalink
Updated installation instructions.
Browse files Browse the repository at this point in the history
- Made clear that Vault Registration is required regardless of installation method.
- Moved parts around to make more logical sense.
  • Loading branch information
marshallwp committed Sep 20, 2024
1 parent 21de211 commit 30e3ff9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Lastly, the `SecretManagement` module can only handle unlock operations, not log
### (Recommended) Utilize API Key for Login
This Module is designed for unattended usage and expects you to implement login via [API Key environmental variables](https://bitwarden.com/help/cli/#using-an-api-key). If setup this way, the `SecretManagement.Warden` extension will use these credentials to silently resolve any "You are not logged in" errors. NOTE: While this means you will effectively always be logged in, you will still need to unlock the vault with your password every session to gain access to secrets.

This is also useful for troubleshooting, as it allows you to assume the user is logged in and that if `Test-SecretVault` returns `false` it's because the vault is either locked or inaccessible.

To configure automatic API Key usage follow the steps below:

1. Retrieve your personal API Key. (See [Get your personal API key](https://bitwarden.com/help/personal-api-key/#get-your-personal-api-key) for more details than the brief below).
Expand Down Expand Up @@ -132,10 +134,15 @@ Alternatively, manually install its Microsoft.PowerShell.SecretManagement depend
* `$HOME\Documents\PowerShell\Modules\SecretManagement.Warden` (Windows)
* `$HOME/.local/share/powershell/Modules/SecretManagement.Warden` (Linux or Mac)


## Register The Secret Vault
Then Register the vault with SecretManagement as usual, e.g. `Register-SecretVault -Name "warden" -ModuleName "SecretManagement.Warden"`

### Optional Settings
If you wish to use any non-default configurations, put them in a hashtable and pass that to `Register-SecretVault` with the `-VaultParameters` parameter.
### Specifying Optional Settings
If you wish to use any non-default configurations, put them in a hashtable and pass that to `Register-SecretVault` with the `-VaultParameters` parameter. Optionally, you can set it as the default vault by also providing the `-DefaultVault` parameter, though this is assumed if you've never registered another vault.

#### Registration Vault Parameters
When registering the vault you can include a HashTable of vault parameters to configure client behavior. These are passed to implementing functions as `$AdditionalParameters`.

Example:
```pwsh
Expand All @@ -147,12 +154,7 @@ $VaultParameters = @{
Register-SecretVault -Name "warden" -ModuleName SecretManagement.Warden -VaultParameters $VaultParameters
```

Optionally, you can set it as the default vault by also providing the `-DefaultVault` parameter, though this is assumed if you've never registered another vault.

### Registration Vault Parameters
When registering the vault you can include a HashTable of vault parameters to configure client behavior. These are passed to implementing functions as `$AdditionalParameters`.

**Supported Vault Parameters**
### Supported Vault Parameters

| Name | Description | Type | Possible Values | Default |
| ---- | ----------- | -----| --------------- | ------- |
Expand All @@ -173,8 +175,6 @@ When you first register a vault using this extension, commands like `Test-Secret

`Unlock-SecretVault` will stall if you specified an invalid URL when configuring the location of the server.

When automating usage of this Module use the API key for login. This way you can assume the user is logged in and that if `Test-SecretVault` returns `false` it's because the vault is either locked or inaccessible.

## Special Thanks
Special Thanks to @TylerLeonhardt for publishing a baseline for this module extension. Please check out his [`LastPass Extention`](https://github.com/TylerLeonhardt/SecretManagement.LastPass)

Expand Down

0 comments on commit 30e3ff9

Please sign in to comment.