Socket
Socket
Sign inDemoInstall

electron-osx-sign

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-osx-sign - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

4

index.d.ts

@@ -17,3 +17,3 @@ declare module "electron-osx-sign" {

'identity-validation'?: boolean;
ignore?: string;
ignore?: string | ((file: string) => boolean);
'pre-auto-entitlements'?: boolean;

@@ -23,5 +23,7 @@ 'pre-embed-provisioning-profile'?: boolean;

'requirements'?: string;
'signature-flags'?: string | ((file: string) => string[]);
'signature-size'?: number;
'type'?: string;
version?: string;
entitlementsForFile?: (file: string, codeSignArgs: string[]) => string | null;
}

@@ -28,0 +30,0 @@

{
"name": "electron-osx-sign",
"version": "0.5.0",
"version": "0.6.0",
"description": "Codesign Electron macOS apps",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -169,33 +169,2 @@ /**

let optionsArguments = []
if (opts['signature-flags']) {
if (Array.isArray(opts['signature-flags'])) {
optionsArguments = [...opts['signature-flags']]
} else {
const flags = opts['signature-flags'].split(',').map(function (flag) { return flag.trim() })
optionsArguments = [...flags]
}
}
if (opts.hardenedRuntime || opts['hardened-runtime'] || optionsArguments.includes('runtime')) {
// Hardened runtime since darwin 17.7.0 --> macOS 10.13.6
if (compareVersion(osRelease, '17.7.0') >= 0) {
optionsArguments.push('runtime')
} else {
// Remove runtime if passed in with --signature-flags
debuglog('Not enabling hardened runtime, current macOS version too low, requires 10.13.6 and higher')
optionsArguments = optionsArguments.filter(function (element, index) { return element !== 'runtime' })
}
}
if (opts['restrict']) {
optionsArguments.push('restrict')
debugwarn('This flag is to be deprecated, consider using --signature-flags=restrict instead')
}
if (optionsArguments.length) {
args.push('--options', [...new Set(optionsArguments)].join(','))
}
var promise

@@ -221,2 +190,36 @@ /**

let optionsArguments = []
if (opts['signature-flags']) {
if (Array.isArray(opts['signature-flags'])) {
optionsArguments = [...opts['signature-flags']]
} else if (typeof opts['signature-flags'] === 'function') {
const flags = opts['signature-flags'](filePath)
optionsArguments = [...flags]
} else {
const flags = opts['signature-flags'].split(',').map(function (flag) { return flag.trim() })
optionsArguments = [...flags]
}
}
if (opts.hardenedRuntime || opts['hardened-runtime'] || optionsArguments.includes('runtime')) {
// Hardened runtime since darwin 17.7.0 --> macOS 10.13.6
if (compareVersion(osRelease, '17.7.0') >= 0) {
optionsArguments.push('runtime')
} else {
// Remove runtime if passed in with --signature-flags
debuglog('Not enabling hardened runtime, current macOS version too low, requires 10.13.6 and higher')
optionsArguments = optionsArguments.filter(function (element, index) { return element !== 'runtime' })
}
}
if (opts['restrict']) {
optionsArguments.push('restrict')
debugwarn('This flag is to be deprecated, consider using --signature-flags=restrict instead')
}
if (optionsArguments.length) {
args.push('--options', [...new Set(optionsArguments)].join(','))
}
let entitlementsFile = opts['entitlements-inherit']

@@ -227,3 +230,3 @@ if (filePath.includes('Library/LoginItems')) {

const clonedArgs = args.concat([]);
const clonedArgs = args.concat([])
if (opts.entitlementsForFile) {

@@ -238,9 +241,9 @@ entitlementsFile = opts.entitlementsForFile(filePath, clonedArgs) || entitlementsFile

const clonedArgs = args.concat([]);
const clonedArgs = args.concat([])
let entitlementsFile = opts.entitlements
if (opts.entitlementsForFile) {
entitlementsFile = opts.entitlementsForFile(opts.app, clonedArgs) || entitlementsFile;
entitlementsFile = opts.entitlementsForFile(opts.app, clonedArgs) || entitlementsFile
}
return execFileAsync('codesign', clonedArgs.concat('--entitlements', opts.entitlements, opts.app))
return execFileAsync('codesign', clonedArgs.concat('--entitlements', entitlementsFile, opts.app))
})

@@ -247,0 +250,0 @@ } else {

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