-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into TIMOB-25656
- Loading branch information
Showing
54 changed files
with
2,808 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
const async = require('async'), | ||
utils = require('./utils'), | ||
modules = require('../support/module/packaged/modules.json'); | ||
|
||
const platforms = Object.keys(modules); | ||
async.map(platforms, (platform, platformNext) => { | ||
const platformModuleNames = Object.keys(modules[platform]); | ||
async.map(platformModuleNames, (modName, modNext) => { | ||
const modObj = modules[platform][modName]; | ||
utils.generateSSRIHashFromURL(modObj.url, function (e, hash) { | ||
if (e) { | ||
return modNext(e); | ||
} | ||
const obj = {}; | ||
modObj.integrity = hash; | ||
obj[modName] = modObj; | ||
modNext(null, obj); | ||
}); | ||
}, (e, mods) => { | ||
if (e) { | ||
return platformNext(e); | ||
} | ||
// Merge the modules array into a single object | ||
const merged = Object.assign({}, ...mods); | ||
const platformObj = {}; | ||
platformObj[platform] = merged; | ||
return platformNext(null, platformObj); | ||
}); | ||
}, (e, results) => { | ||
if (e) { | ||
console.error(e); | ||
process.exit(1); | ||
} | ||
// Merge the platforms array into a single object | ||
const merged = Object.assign({}, ...results); | ||
console.log(JSON.stringify(merged)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
const async = require('async'), | ||
program = require('commander'), | ||
utils = require('./utils'); | ||
|
||
program.parse(process.argv); | ||
|
||
let urls = program.args; | ||
if (urls.length <= 0) { | ||
console.log('Please provide one or more URLs as arguments to this command to generate SSRI "integrity" values for.'); | ||
process.exit(1); | ||
} | ||
console.log(urls); | ||
async.each(urls, function (url, next) { | ||
utils.generateSSRIHashFromURL(url, function (e, hash) { | ||
if (e) { | ||
return next(e); | ||
} | ||
const obj = { | ||
url: url, | ||
integrity: hash | ||
}; | ||
console.log(JSON.stringify(obj)); | ||
return next(null, hash); | ||
}); | ||
}, function (err) { | ||
if (err) { | ||
process.exit(1); | ||
} | ||
process.exit(0); | ||
}); |
Oops, something went wrong.