node-vault
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -7,4 +7,10 @@ // file: example/auth.js | ||
vault.auths() | ||
const options = { | ||
requestOptions: { | ||
followAllRedirects: true, | ||
}, | ||
}; | ||
vault.auths(options) | ||
.then(console.log) | ||
.catch(console.error); |
{ | ||
"name": "node-vault", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Javascript client for HashiCorp's Vault", | ||
"main": "./lib/node-vault.js", | ||
"main": "./src/index.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ "test": "_mocha --recursive", |
# node-vault | ||
[![Build Status](https://img.shields.io/travis/kr1sp1n/node-vault/javascript.svg?style=flat-square)](https://travis-ci.org/kr1sp1n/node-vault) | ||
[![Coverage Status](https://img.shields.io/coveralls/kr1sp1n/node-vault/javascript.svg?style=flat-square)](https://coveralls.io/r/kr1sp1n/node-vault) | ||
[![Build Status](https://img.shields.io/travis/kr1sp1n/node-vault/master.svg?style=flat-square)](https://travis-ci.org/kr1sp1n/node-vault) | ||
[![Coverage Status](https://img.shields.io/coveralls/kr1sp1n/node-vault/master.svg?style=flat-square)](https://coveralls.io/r/kr1sp1n/node-vault) | ||
[![Download Status](https://img.shields.io/npm/dm/node-vault.svg?style=flat-square)](https://www.npmjs.com/package/node-vault) | ||
@@ -6,0 +6,0 @@ [![Dependency Status](https://img.shields.io/david/kr1sp1n/node-vault.svg?style=flat-square)](https://david-dm.org/kr1sp1n/node-vault) |
@@ -5,2 +5,22 @@ module.exports = { | ||
path: '/sys/seal-status', | ||
schema: { | ||
res: { | ||
type: 'object', | ||
properties: { | ||
sealed: { | ||
type: 'boolean', | ||
}, | ||
t: { | ||
type: 'number', | ||
}, | ||
n: { | ||
type: 'number', | ||
}, | ||
progress: { | ||
type: 'number', | ||
}, | ||
}, | ||
required: ['sealed', 't', 'n', 'progress'], | ||
}, | ||
}, | ||
}, | ||
@@ -7,0 +27,0 @@ initialized: { |
@@ -112,3 +112,3 @@ module.exports = function (config) { | ||
// Validate via json schema. | ||
if (config.schema !== undefined) { | ||
if (config.schema !== undefined && config.schema.req !== undefined) { | ||
valid = tv4.validate(options.json, config.schema.req); | ||
@@ -115,0 +115,0 @@ if (!valid) { |
const should = require('should'); | ||
const vault = require('./../src/index.js')(); | ||
// use json schema in commands.js validate response | ||
const commands = require('./../src/commands.js'); | ||
const tv4 = require('tv4'); | ||
const assert = require('assert'); | ||
describe('node-vault integration', () => { | ||
it('should initialize a vault server', (done) => { | ||
vault.init({ secret_shares: 1, secret_threshold: 1 }) | ||
.then((result) => { | ||
vault.token = result.root_token; | ||
result.should.have.property('keys'); | ||
result.should.have.property('root_token'); | ||
return done(); | ||
}) | ||
.catch(done); | ||
const validResult = (commandName, result) => { | ||
const schema = commands[commandName].schema.res; | ||
return tv4.validate(result, schema); | ||
}; | ||
describe('integration', () => { | ||
describe('node-vault', () => { | ||
it('should initialize a vault server', (done) => { | ||
vault.init({ secret_shares: 1, secret_threshold: 1 }) | ||
.then((result) => { | ||
vault.token = result.root_token; | ||
assert(validResult('init', result)); | ||
return done(); | ||
}) | ||
.catch(done); | ||
}); | ||
it('should show the current status of the vault server', (done) => { | ||
vault.status() | ||
.then((result) => { | ||
assert(validResult('status', result)); | ||
return done(); | ||
}) | ||
.catch(done); | ||
}); | ||
}); | ||
}); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
35318
830
0