node-vault
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -483,5 +483,14 @@ 'use strict'; | ||
tokenLookup: { | ||
method: 'GET', | ||
path: '/auth/token/lookup/{{token}}', | ||
method: 'POST', | ||
path: '/auth/token/lookup', | ||
schema: { | ||
req: { | ||
type: 'object', | ||
properties: { | ||
token: { | ||
type: 'string' | ||
} | ||
}, | ||
required: ['token'] | ||
}, | ||
res: { | ||
@@ -522,5 +531,14 @@ type: 'object', | ||
tokenLookupAccesspr: { | ||
method: 'GET', | ||
path: '/auth/token/lookup-accessor/{{accessor}}', | ||
method: 'POST', | ||
path: '/auth/token/lookup-accessor', | ||
schema: { | ||
req: { | ||
type: 'object', | ||
properties: { | ||
accessor: { | ||
type: 'string' | ||
} | ||
}, | ||
required: ['accessor'] | ||
}, | ||
res: { | ||
@@ -527,0 +545,0 @@ type: 'object', |
@@ -25,3 +25,15 @@ 'use strict'; | ||
if (response.statusCode !== 200 && response.statusCode !== 204) { | ||
return Promise.reject(new Error(response.body.errors[0])); | ||
// handle health response not as error | ||
if (response.request.path.match(/health/) !== null) { | ||
return Promise.resolve(response.body); | ||
} | ||
var message = void 0; | ||
if (response.body.errors && response.body.errors.length > 0) { | ||
message = response.body.errors[0]; | ||
} else { | ||
message = 'Status ' + response.statusCode; | ||
} | ||
var error = new Error(message); | ||
error.response = response; | ||
return Promise.reject(error); | ||
} | ||
@@ -104,2 +116,10 @@ return Promise.resolve(response.body); | ||
client.list = function (path, requestOptions) { | ||
debug('list ' + path); | ||
var options = Object.assign({}, config.requestOptions, requestOptions); | ||
options.path = '/' + path; | ||
options.method = 'LIST'; | ||
return client.request(options).then(handleVaultResponse); | ||
}; | ||
client.delete = function (path, requestOptions) { | ||
@@ -106,0 +126,0 @@ debug('delete ' + path); |
{ | ||
"name": "node-vault", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Javascript client for HashiCorp's Vault", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29260
1005