Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-vault

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-vault - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

8

example/auth.js

@@ -7,4 +7,10 @@ // file: example/auth.js

vault.auths()
const options = {
requestOptions: {
followAllRedirects: true,
},
};
vault.auths(options)
.then(console.log)
.catch(console.error);

4

package.json
{
"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);
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc