@asymmetrik/yadda-secret
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "@asymmetrik/yadda-secret", | ||
"description": "Client secret library", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "author": "contributors", |
@@ -37,4 +37,2 @@ 'use strict'; | ||
this.store = new SecretStore({ table, awsOpts: { region }, kmsKey }); | ||
else | ||
throw new Error('Region & Table are not defined, are you in a Yadda environment?'); | ||
@@ -51,4 +49,3 @@ return this.store; | ||
retrieveFromKMS(value){ | ||
//Wrap in promise to catch errors calling `this.storage` | ||
return this.storage.getSecret({ name: value }); | ||
return Promise.resolve(this.storage ? this.storage.getSecret({ name: value }) : null); | ||
} | ||
@@ -75,2 +72,5 @@ | ||
return undefined; | ||
// If the value is falsey, return it since it won't have a constructor | ||
if (!target[name]) | ||
return target[name]; | ||
@@ -77,0 +77,0 @@ // Handle KMS Variables separately |
13290