nsp-reporter-teamcity
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "nsp-reporter-teamcity", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "nsp (Node Security Project) reporter for TeamCity", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "jest", | ||
"lint": "eslint .", | ||
"release": "standard-version" | ||
}, | ||
@@ -23,3 +25,14 @@ "keywords": [ | ||
"teamcity-service-messages": "^0.1.9" | ||
}, | ||
"devDependencies": { | ||
"@jetbrains/eslint-config": "4.0.2", | ||
"babel-eslint": "8.2.3", | ||
"babel-preset-env": "1.6.1", | ||
"eslint": "4.19.1", | ||
"eslint-config-prettier": "2.9.0", | ||
"eslint-plugin-prettier": "2.6.0", | ||
"jest": "22.4.3", | ||
"prettier": "1.12.1", | ||
"standard-version": "4.3.0" | ||
} | ||
} |
@@ -5,11 +5,14 @@ ## nsp reporter for TeamCity | ||
### Changelog | ||
### Configuration | ||
Put `nsp.conf.json` config file in a project root directory to override any of the dafault values: | ||
#### 0.2.0 | ||
Error handler, displays `Error` object and related details. | ||
A bunch of debug information is shown additionally when `--verbose` flag is provided | ||
```json | ||
{ | ||
"nspInspectionTypeId": "nsp-security-inspection", | ||
"nspInspectionName": "NSP security inspection", | ||
"nspInspectionCategory": "security", | ||
"npsInspectionSeverity": "WARNING" | ||
} | ||
``` | ||
#### 0.1.0 | ||
Initial version | ||
[nsp]: https://www.npmjs.com/package/nsp | ||
[nsp]: https://www.npmjs.com/package/nsp |
@@ -0,32 +1,12 @@ | ||
const process = require('process') | ||
const tsm = require('teamcity-service-messages') | ||
exports.success = () => 'success'; | ||
exports.error = (error, args) => console.error(error, | ||
args.verbose && JSON.stringify(args) || ''); | ||
const config = require('../lib/config').getConfig(process.cwd()) | ||
const {successHandler, errorHandler, createCheckSuccessHandler} = require('../lib/reporter') | ||
exports.check = {}; | ||
exports.check.success = (result, args) => { | ||
const nspInspectionTypeId = 'nsp-security-inspection'; | ||
exports.success = successHandler | ||
exports.error = errorHandler | ||
if (result.data.length) { | ||
tsm.inspectionType({ | ||
id: nspInspectionTypeId, | ||
name: 'NSP security inspection', | ||
category: 'security', | ||
description: 'https://www.npmjs.com/package/nsp' | ||
}) | ||
result.data.forEach(elem => { | ||
tsm.inspection({ | ||
typeId: nspInspectionTypeId, | ||
message: `${elem.overview} | ||
version: ${elem.version}, | ||
vulnerable_versions: ${elem.vulnerable_versions}, | ||
patched_versions: ${elem.patched_versions}, | ||
recommendation: ${elem.recommendation}, | ||
advisory: ${elem.advisory}`, | ||
file: `module: "${elem.module}"`, | ||
SEVERITY: 'WARNING' | ||
}) | ||
}); | ||
} | ||
} | ||
exports.check = {} | ||
exports.check.success = createCheckSuccessHandler(tsm, config) |
@@ -14,2 +14,3 @@ { | ||
"dependencies": { | ||
"moment": "2.19.2", | ||
"nsp": "^3.2.1", | ||
@@ -16,0 +17,0 @@ "nsp-reporter-teamcity": "^0.1.0" |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
44348
18
1038
2
18
9
1
1