Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Allowing directly wrapping a client, too
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwilcox committed Jan 5, 2017
1 parent d4d0bda commit 036e8fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ instantiated for you, along with the new method `getObjectSecrets`.
Simply pass in the client instance as the value of a property called `client`. The client
will then have a `getObjectSecrets` method.

You may also just pass in a KeyVault client instance. This is detected by the presence of
a function called "getSecret" on the passed-in object.

### With an AAD client certificate

_Not supported_
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function createAndWrapKeyVaultClient(options) {
if (!options) {
throw new Error('No options provided for the key vault resolver.');
}
let client = options.client;
let client = typeof(options) === 'function' && options.getSecret ? options : options.client;
if (options.credentials && !client) {
client = new azureKeyVault.KeyVaultClient(options.credentials);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ospo/keyvault-configuration-resolver",
"version": "0.9.1",
"version": "0.9.2",
"description": "Resolves custom keyvault:// URI values within an object graph using Azure KeyVault",
"main": "lib/index.js",
"engines": {
Expand Down

0 comments on commit 036e8fd

Please sign in to comment.