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

electron-installer-codesign

Package Overview
Dependencies
Maintainers
28
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-installer-codesign - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0

96

index.js

@@ -10,2 +10,3 @@ /* eslint no-console:0 */

var figures = require('figures');
var sign = require('electron-osx-sign');
var debug = require('debug')('electron-installer-codesign');

@@ -34,14 +35,7 @@

function runCodesign(src, opts, fn) {
var args = [
'-s',
opts.identity,
'-vvv',
'--deep',
'--force',
'--options',
'runtime',
src
];
run('codesign', args, function(err) {
sign({
app: src,
hardenedRuntime: true,
identity: opts.identity
}, (err) => {
if (err) {

@@ -53,3 +47,3 @@ fn(new Error('codesign failed ' + path.basename(src)

fn(null, src);
});
})
}

@@ -72,58 +66,5 @@

function _filterFiles(files, fn) {
async.parallel(files.map(function(file) {
return function(cb) {
fs.lstat(file, function(err, stat) {
if (err) {
return cb(err);
}
if (!stat.isFile()) {
return cb(null, null);
}
/**
* @durran: Allow only the Electron symlink to not get skipped.
* @see: COMPASS-101.
*/
if (stat.isSymbolicLink() && file.indexOf('Electron') > -1) {
return cb(null, file);
}
if (stat.isSymbolicLink() && file.indexOf('Contents/MacOS') > -1) {
return cb(null, null);
}
cb(null, file);
});
};
}), function(_err, _files) {
if (_err) {
return fn(_err);
}
fn(null, _files.filter(function(f) {
return f !== null;
}));
});
}
function _collectFiles(pattern, opts, fn) {
glob.glob(pattern, function(err, files) {
if (err) {
return fn(err);
}
if (files.length === 0) {
return fn(new Error('No files found for '
+ opts.appPath + '/' + pattern));
}
fn(null, files);
});
}
function codesign(pattern, opts, fn) {
async.waterfall([
function(cb) {
_collectFiles(pattern, opts, cb);
},
function(files, cb) {
_filterFiles(files, cb);
},
function(files, cb) {
_signAll(files, opts, cb);

@@ -134,18 +75,2 @@ }

function verify(src, fn) {
debug('verifying signature on `%s`...', src);
var args = [
'--verify',
'-vvv',
src
];
run('codesign', args, function(err) {
if (err) {
return fn(err);
}
fn(null, src);
});
}
/**

@@ -179,7 +104,3 @@ * @param {String} commonName

cleanup.bind(null, opts),
codesign.bind(null, opts.appPath + '/Contents/Frameworks/*', opts),
codesign.bind(null, opts.appPath + '/Contents/MacOS/*', opts),
codesign.bind(null, opts.appPath + '/Contents/Resources/*', opts),
codesign.bind(null, opts.appPath, opts),
verify.bind(null, opts.appPath)
codesign.bind(null, opts.appPath, opts)
], done);

@@ -190,3 +111,2 @@ };

module.exports.codesign = codesign;
module.exports.verify = verify;

@@ -193,0 +113,0 @@ module.exports.printWarning = function() {

3

package.json
{
"name": "electron-installer-codesign",
"description": "Sign your electron apps on OSX.",
"version": "0.3.2",
"version": "0.4.0",
"author": "Lucas Hrabovsky <lucas@mongodb.com> (http://imlucas.com)",

@@ -29,2 +29,3 @@ "homepage": "http://github.com/mongodb-js/electron-installer-codesign",

"electron-installer-run": "^0.1.0",
"electron-osx-sign": "^0.4.16",
"figures": "^2.0.0",

@@ -31,0 +32,0 @@ "glob": "^7.1.1",

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