@sei-atl/devops
Advanced tools
+7
-0
@@ -63,4 +63,11 @@ #!/usr/bin/env node | ||
| break; | ||
| case "print-epoch": | ||
| let epoch = (new Date()).getTime()+""; | ||
| console.log(epoch); | ||
| break; | ||
| case "pre-package-yaml": | ||
| require('..lib/utils.js').prePackageYaml(args); | ||
| break; | ||
| default: | ||
| console.log("you need to supply a command"); | ||
| } |
+13
-0
@@ -185,3 +185,16 @@ const encryptionHelper = require('@sei-atl/encryption-helper'); | ||
| }); | ||
| }, | ||
| prePackageYaml: (args) => { | ||
| let yamlBoost = require('yaml-boost'); | ||
| let fs = require('fs'); | ||
| let inPath = args.in; | ||
| let outPath = args.out; | ||
| let loaded = yamlBoost.load(inPath, args); | ||
| let dumped = yamlBoost.dump(loaded); | ||
| fs.writeFileSync(outPath,dumped); | ||
| } | ||
| }; |
+2
-1
| { | ||
| "name": "@sei-atl/devops", | ||
| "version": "1.0.16", | ||
| "version": "1.0.17", | ||
| "description": "", | ||
@@ -22,2 +22,3 @@ "main": "./lib/index.js", | ||
| "unidecode": "^0.1.8", | ||
| "yaml-boost": "^1.9.0", | ||
| "yamljs": "^0.3.0" | ||
@@ -24,0 +25,0 @@ }, |
+19
-0
| let { assert, expect } = require('../../node_modules/chai'); | ||
| let utils = require('../../lib/utils.js'); | ||
| let fs = require('fs'); | ||
@@ -14,2 +15,20 @@ describe('Testing the devops cli', function() { | ||
| }); | ||
| describe('Testing prePackage', function() { | ||
| it('should pre package a yaml template', function(done) { | ||
| let uid = (new Date()).getTime()+""; | ||
| let inPath = "/tmp/"+uid; | ||
| let outPath = "/tmp/packaged-"+uid; | ||
| fs.writeFileSync("/tmp/"+uid,"Test:\n Test2: value"); | ||
| utils.prePackageYaml({ | ||
| in: inPath, | ||
| out: outPath | ||
| }); | ||
| let packaged = fs.readFileSync(outPath,'utf8'); | ||
| expect(packaged).to.equal("Test:\n Test2: value\n"); | ||
| fs.unlinkSync(inPath); | ||
| fs.unlinkSync(outPath); | ||
| done(); | ||
| }); | ||
| }); | ||
| }); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
21148
5.51%613
5.87%9
12.5%6
50%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added