Comparing version 7.2.1 to 7.2.2
{ | ||
"name": "ssb-keys", | ||
"description": "keyfile operations for ssb", | ||
"version": "7.2.1", | ||
"version": "7.2.2", | ||
"homepage": "https://github.com/ssbc/ssb-keys", | ||
@@ -6,0 +6,0 @@ "repository": { |
var tape = require('tape') | ||
var ssbkeys = require('../') | ||
var crypto = require('crypto') | ||
var path = '/tmp/ssb-keys_'+Date.now() | ||
var path = require('path') | ||
var os = require('os') | ||
var fs = require('fs') | ||
const keyPath = path.join(os.tmpdir(), `ssb-keys-${Date.now()}`) | ||
console.log(keyPath) | ||
tape('create and load presigil-legacy async', function (t) { | ||
@@ -11,5 +15,5 @@ | ||
keys.id = keys.id.substring(1) | ||
fs.writeFileSync(path, JSON.stringify(keys)) | ||
fs.writeFileSync(keyPath, JSON.stringify(keys)) | ||
var k2 = ssbkeys.loadSync(path) | ||
var k2 = ssbkeys.loadSync(keyPath) | ||
t.equal(k2.id, '@' + keys.id) | ||
@@ -24,5 +28,5 @@ t.end() | ||
keys.id = keys.id.substring(1) | ||
fs.writeFileSync(path, JSON.stringify(keys)) | ||
fs.writeFileSync(keyPath, JSON.stringify(keys)) | ||
ssbkeys.load(path, function (err, k2) { | ||
ssbkeys.load(keyPath, function (err, k2) { | ||
if(err) throw err | ||
@@ -37,9 +41,9 @@ t.equal(k2.id, '@' + keys.id) | ||
fs.writeFileSync(path, 'this file intentionally left blank', 'utf8') | ||
fs.writeFileSync(keyPath, 'this file intentionally left blank', 'utf8') | ||
t.throws(function () { | ||
ssbkeys.createSync(path) | ||
ssbkeys.createSync(keyPath) | ||
}) | ||
ssbkeys.create(path, function (err) { | ||
ssbkeys.create(keyPath, function (err) { | ||
t.ok(err) | ||
fs.unlinkSync(path) | ||
fs.unlinkSync(keyPath) | ||
t.end() | ||
@@ -46,0 +50,0 @@ }) |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
23321
14
507