Comparing version 7.0.15 to 7.0.16
{ | ||
"name": "ssb-keys", | ||
"description": "keyfile operations for ssb", | ||
"version": "7.0.15", | ||
"version": "7.0.16", | ||
"homepage": "https://github.com/ssbc/ssb-keys", | ||
@@ -19,3 +19,3 @@ "repository": { | ||
"scripts": { | ||
"test": "tape test/" | ||
"test": "tape test/*" | ||
}, | ||
@@ -22,0 +22,0 @@ "author": "Paul Frazee <pfrazee@gmail.com>", |
@@ -33,3 +33,3 @@ 'use strict' | ||
function constructKeys(keys, legacy) { | ||
if(!keys) throw new Error('*must* pass in keys') | ||
if(!keys) throw new Error('*must* pass in keys') | ||
@@ -93,3 +93,3 @@ return [ | ||
if(err) return cb(err) | ||
fs.writeFile(filename, keyfile, {mode: 0x100}, function(err) { | ||
fs.writeFile(filename, keyfile, {mode: 0x100, flag: 'wx'}, function(err) { | ||
if (err) return cb(err) | ||
@@ -106,3 +106,3 @@ cb(null, keys) | ||
mkdirp.sync(path.dirname(filename)) | ||
fs.writeFileSync(filename, keyfile, {mode: 0x100}) | ||
fs.writeFileSync(filename, keyfile, {mode: 0x100, flag: 'wx'}) | ||
return keys | ||
@@ -109,0 +109,0 @@ } |
@@ -33,1 +33,14 @@ var tape = require('tape') | ||
tape('prevent clobbering existing keys', function (t) { | ||
fs.writeFileSync(path, 'this file intentionally left blank', 'utf8') | ||
t.throws(function () { | ||
ssbkeys.createSync(path) | ||
}) | ||
ssbkeys.create(path, function (err) { | ||
t.ok(err) | ||
fs.unlinkSync(path) | ||
t.end() | ||
}) | ||
}) |
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
18308
458