@sap/node-jwt
Advanced tools
Comparing version 1.5.2 to 1.6.2
90
jwt.js
@@ -7,60 +7,56 @@ // Copyright (c) 2016, Markus Strehle, SAP SE | ||
// | ||
var sapjwt_lib_name; | ||
if (process.platform === "win32") { | ||
process.env['SSOEXT_LIB'] = __dirname + '\\deps\\win32\\' + process.arch + '\\sapssoext.dll'; | ||
sapjwt_lib_name = __dirname + '\\deps\\win32\\' + process.arch + '\\sapjwt.dll'; | ||
} | ||
if (process.sapjwtlib) { | ||
return module.exports = process.sapjwtlib; | ||
} | ||
var fs = require('fs'), path = require('path'); | ||
module.exports = process.sapjwtlib; | ||
} else { | ||
var fs = require('fs'), path = require('path'); | ||
// Seed random numbers [gh-82] | ||
Math.random(); | ||
// Seed random numbers [gh-82] | ||
Math.random(); | ||
var oldDir = process.cwd(); | ||
if (process.platform === "win32") { | ||
process.env['PATH'] = process.env['PATH'] + ';' + __dirname + '\\deps\\' + process.platform + '\\' + process.arch; | ||
process.env['SSOEXT_LIB'] = __dirname + '\\deps\\win32\\' + process.arch + '\\sapssoext.dll'; | ||
process.chdir(__dirname + '\\deps\\' + process.platform + '\\' + process.arch); | ||
} else { | ||
if (process.platform === "darwin") { | ||
process.env['LD_LIBRARAY_PATH'] = __dirname + '/deps/' + process.platform + '/' + process.arch; | ||
process.env['SSOEXT_LIB'] = __dirname + '/deps/' + process.platform + '/' + process.arch + '/libsapssoext.dylib'; | ||
} else { | ||
if( process.arch === 'ppc64' ) { | ||
if (process.platform === "win32") { | ||
sapjwt_lib_name = __dirname + '\\deps\\win32\\' + process.arch + '\\sapjwt.dll'; | ||
} else { | ||
if (process.platform === "darwin") { | ||
sapjwt_lib_name = __dirname + '/deps/' + process.platform + '/' + process.arch + '/libsapjwt.dylib'; | ||
} else { | ||
if( process.arch === 'ppc64' ) { | ||
var os = require('os'); | ||
var endianer = os.endianness().toLowerCase(); | ||
if( endianer === 'le' ) { | ||
process.env['LD_LIBRARAY_PATH'] = __dirname + '/deps/' + process.platform + '/' + process.arch + endianer; | ||
process.env['SSOEXT_LIB'] = __dirname + '/deps/' + process.platform + '/' + process.arch + endianer +'/libsapssoext.so'; | ||
sapjwt_lib_name = __dirname + '/deps/' + process.platform + '/' + process.arch + endianer +'/libsapjwt.so'; | ||
} else { | ||
process.env['LD_LIBRARAY_PATH'] = __dirname + '/deps/' + process.platform + '/' + process.arch; | ||
process.env['SSOEXT_LIB'] = __dirname + '/deps/' + process.platform + '/' + process.arch + '/libsapssoext.so'; | ||
sapjwt_lib_name = __dirname + '/deps/' + process.platform + '/' + process.arch + '/libsapjwt.so'; | ||
} | ||
}else { | ||
process.env['LD_LIBRARAY_PATH'] = __dirname + '/deps/' + process.platform + '/' + process.arch; | ||
process.env['SSOEXT_LIB'] = __dirname + '/deps/' + process.platform + '/' + process.arch + '/libsapssoext.so'; | ||
}else { | ||
sapjwt_lib_name = __dirname + '/deps/' + process.platform + '/' + process.arch + '/libsapjwt.so'; | ||
} | ||
} | ||
} | ||
} | ||
process.chdir(oldDir); | ||
// Look for binary for this platform | ||
var v8 = 'v8-'+ /[0-9]+\.[0-9]+/.exec(process.versions.v8)[0]; | ||
var modPath = path.join(__dirname, 'bin', process.platform+ '-'+ process.arch+ '-'+ v8, 'jwt'); | ||
if( process.arch === 'ppc64' ) { | ||
var os = require('os'); | ||
var endianer = os.endianness().toLowerCase(); | ||
if( endianer === 'le' ) { | ||
modPath = path.join(__dirname, 'bin', process.platform+ '-'+ process.arch + endianer + '-'+ v8, 'jwt'); | ||
} | ||
} | ||
try { | ||
fs.statSync(modPath+ '.node'); | ||
} catch (ex) { | ||
// No binary! | ||
throw ex; | ||
//throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-jwt`?'); | ||
} | ||
// Pull in JWT implementation | ||
process.sapjwtlib = module.exports = require(modPath).jwtValidation; | ||
} | ||
// Look for binary for this platform | ||
var v8 = 'v8-'+ /[0-9]+\.[0-9]+/.exec(process.versions.v8)[0]; | ||
var modPath = path.join(__dirname, 'bin', process.platform+ '-'+ process.arch+ '-'+ v8, 'jwt'); | ||
if( process.arch === 'ppc64' ) { | ||
var os = require('os'); | ||
var endianer = os.endianness().toLowerCase(); | ||
if( endianer === 'le' ) { | ||
modPath = path.join(__dirname, 'bin', process.platform+ '-'+ process.arch + endianer + '-'+ v8, 'jwt'); | ||
} | ||
} | ||
try { | ||
fs.statSync(modPath+ '.node'); | ||
} catch (ex) { | ||
// No binary! | ||
throw ex; | ||
//throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-jwt`?'); | ||
} | ||
// Pull in JWT implementation | ||
var jwtValidation = require(modPath).jwtValidation; | ||
// Load SAPJWT library | ||
var jwt = new jwtValidation(sapjwt_lib_name); | ||
process.sapjwtlib = module.exports = jwtValidation; | ||
} |
@@ -1,1 +0,1 @@ | ||
{"bundleDependencies":false,"dependencies":{},"deprecated":false,"description":"JWT validation library for Node.js","devDependencies":{"chai":"^3.5.0","eslint":"^3.2.2","filter-node-package":"^2.1.0","istanbul":"^0.4.5","mocha":"^4.0.1","nock":"^9.0.14","node-style":"^2.0.0","should":"^7.0.1"},"engines":{"node":"<13.0.0"},"keywords":["jwt","security","sap","xs"],"main":"jwt.js","name":"@sap/node-jwt","optionalDependencies":{},"repository":{"type":"git"},"scripts":{"install":"node ./build.js","prepareRelease":"clean-packages && npm prune --production","test":"make test"},"version":"1.5.2","license":"SEE LICENSE IN developer-license-3.1.txt"} | ||
{"bundleDependencies":false,"dependencies":{},"deprecated":false,"description":"JWT validation library for Node.js","devDependencies":{"chai":"^3.5.0","eslint":"^3.2.2","filter-node-package":"^2.1.0","istanbul":"^0.4.5","mocha":"^4.0.1","nock":"^9.0.14","node-style":"^2.0.0","should":"^7.0.1"},"engines":{"node":"<13.0.0"},"keywords":["jwt","security","sap","xs"],"main":"jwt.js","name":"@sap/node-jwt","optionalDependencies":{},"repository":{"type":"git"},"scripts":{"install":"node ./build.js","prepareRelease":"clean-packages && npm prune --production","test":"make test"},"version":"1.6.2","license":"SEE LICENSE IN developer-license-3.1.txt"} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 6 instances 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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 8 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
12350108
4
71
159