Skip to content

Commit

Permalink
Don't error when no secret path is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
briananstett committed Mar 2, 2021
1 parent 035014d commit 2cc40f0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pipelines:
caches:
- node
name: Deploying to npm.24g.dev
image: node:10-alpine
image: node:12-alpine
script:
- npm install
- npm run lint
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ function getAwsRequestUrl(region) {
module.exports = async function getSecret(secretPath, options = {}) {
// To be backwards compatible, we still use the KEY_NAME env var.
// When secret manager is fully deprecated, we should swap this to SECRET_PATH
let path = secretPath;
if (!path) path = process.env.SECRET_PATH || process.env.KEY_NAME;
const path = secretPath || process.env.SECRET_PATH || process.env.KEY_NAME;

// No secret was passed. No SECRET_PATH || KEY_NAME environment variable set.
if (!path) return {};

// Default bypassCache to false
const bypassCache = options.bypassCache || false;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@24g/vault",
"version": "1.0.22",
"version": "1.1.0",
"description": "Module for interacting with Vault",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 2cc40f0

Please sign in to comment.