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

libesvm

Package Overview
Dependencies
Maintainers
3
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libesvm - npm Package Compare versions

Comparing version 3.2.1 to 3.2.2

25

lib/writeShieldConfig.js

@@ -7,6 +7,10 @@ var _ = require('lodash');

var fsExtra = require('fs-extra');
var fs = require('fs');
var copy = Promise.promisify(fsExtra.copy);
var mkdirs = Promise.promisify(fsExtra.mkdirs);
var stat = Promise.promisify(fs.stat);
var readFile = Promise.promisify(fs.readFile);
var outputFile = Promise.promisify(fsExtra.outputFile);
var hash = Promise.promisify(bcrypt.hash);
var yaml = require('js-yaml');

@@ -64,2 +68,16 @@ function copyShieldFiles(basePath, configPath) {

function createRoles(configPath, roles) {
var rolesYml = path.join(configPath, 'shield', 'roles.yml');
return stat(rolesYml).then(function (arg) {
return readFile(rolesYml, 'utf8').then(function (data) {
var rolesConfig = yaml.safeLoad(data);
_.assign(rolesConfig, roles);
return outputFile(rolesYml, yaml.safeDump(rolesConfig));
});
})
.catch(function () {
return Promise.resolve();
});
}
module.exports = function writeShieldConfig(options) {

@@ -71,2 +89,9 @@ return function (configPath) {

.then(createUsersAndRoles(configPath, options.shield.users))
.then(function (result) {
if (options.shield.roles) {
return createRoles(configPath, options.shield.roles);
} else {
return result;
}
})
.thenReturn(configPath);

@@ -73,0 +98,0 @@ }

3

package.json
{
"name": "libesvm",
"version": "3.2.1",
"version": "3.2.2",
"description": "libesvm is a library for managning an Elasticsearch process for development and testing.",

@@ -30,2 +30,3 @@ "main": "index.js",

"glob": "^6.0.1",
"js-yaml": "^3.5.2",
"lodash": "~2.4.1",

@@ -32,0 +33,0 @@ "mkdirp": "~0.5.0",

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