@appland/scanner 1.63.0 → 1.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/built/check.js +1 -1
- package/built/ruleChecker.js +1 -11
- package/built/rules/secretInLog.js +1 -0
- package/built/rules/slowFunctionCall.js +0 -1
- package/built/scope/commandScope.js +13 -0
- package/doc/rules/secret-in-log.md +1 -0
- package/doc/rules/slow-function-call.md +0 -1
- package/package.json +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@appland/scanner-v1.64.0](https://github.com/applandinc/appmap-js/compare/@appland/scanner-v1.63.0...@appland/scanner-v1.64.0) (2022-08-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Command scope falls back on root events ([3823a1f](https://github.com/applandinc/appmap-js/commit/3823a1f686212db49b87f2995baa2103a4e007d1))
|
|
7
|
+
|
|
1
8
|
# [@appland/scanner-v1.63.0](https://github.com/applandinc/appmap-js/compare/@appland/scanner-v1.62.2...@appland/scanner-v1.63.0) (2022-07-28)
|
|
2
9
|
|
|
3
10
|
|
package/built/check.js
CHANGED
package/built/ruleChecker.js
CHANGED
|
@@ -35,14 +35,7 @@ class RuleChecker {
|
|
|
35
35
|
}
|
|
36
36
|
check(appMapFile, appMapIndex, check, findings) {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
const
|
|
39
|
-
if (numScopesChecked === 0 && check.scope === 'command') {
|
|
40
|
-
yield this.checkScope(appMapFile, appMapIndex, check, 'root', findings);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
checkScope(appMapFile, appMapIndex, check, scope, findings) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const scope = check.scope;
|
|
46
39
|
if ((0, util_1.verbose)()) {
|
|
47
40
|
console.warn(`Checking AppMap ${appMapIndex.appMap.name} with scope ${scope}`);
|
|
48
41
|
}
|
|
@@ -56,9 +49,7 @@ class RuleChecker {
|
|
|
56
49
|
yield events[i];
|
|
57
50
|
}
|
|
58
51
|
};
|
|
59
|
-
let numScopes = 0;
|
|
60
52
|
for (const scope of scopeIterator.scopes(callEvents())) {
|
|
61
|
-
numScopes += 1;
|
|
62
53
|
if ((0, util_1.verbose)()) {
|
|
63
54
|
console.warn(`Scope ${scope.scope}`);
|
|
64
55
|
}
|
|
@@ -75,7 +66,6 @@ class RuleChecker {
|
|
|
75
66
|
yield this.checkEvent(scope.scope, scope.scope, appMapFile, appMapIndex, checkInstance, findings);
|
|
76
67
|
}
|
|
77
68
|
}
|
|
78
|
-
return numScopes;
|
|
79
69
|
});
|
|
80
70
|
}
|
|
81
71
|
checkEvent(event, scope, appMapFile, appMapIndex, checkInstance, findings) {
|
|
@@ -21,15 +21,28 @@ const Command = 'command.perform';
|
|
|
21
21
|
const Job = 'job.perform';
|
|
22
22
|
class CommandScope extends scopeIterator_1.default {
|
|
23
23
|
*scopes(events) {
|
|
24
|
+
let found = false;
|
|
25
|
+
const roots = [];
|
|
24
26
|
for (const event of events) {
|
|
27
|
+
if (event.isCall() && !event.parent) {
|
|
28
|
+
roots.push(event);
|
|
29
|
+
}
|
|
25
30
|
if (event.isCall() &&
|
|
26
31
|
(event.codeObject.labels.has(Command) ||
|
|
27
32
|
event.codeObject.labels.has(Job) ||
|
|
28
33
|
event.httpServerRequest)) {
|
|
34
|
+
found = true;
|
|
29
35
|
yield new ScopeImpl(event);
|
|
30
36
|
this.advanceToReturnEvent(event, events);
|
|
31
37
|
}
|
|
32
38
|
}
|
|
39
|
+
// If no true command is found, yield all root events.
|
|
40
|
+
if (!found) {
|
|
41
|
+
for (let index = 0; index < roots.length; index++) {
|
|
42
|
+
const event = roots[index];
|
|
43
|
+
yield new ScopeImpl(event);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
33
46
|
}
|
|
34
47
|
}
|
|
35
48
|
exports.default = CommandScope;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appland/scanner",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.64.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": "built/cli.js",
|
|
6
6
|
"files": [
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"@appland/sql-parser": "^1.5.0",
|
|
62
62
|
"@types/cli-progress": "^3.9.2",
|
|
63
63
|
"ajv": "^8.8.2",
|
|
64
|
-
"ansi-escapes": "^5.0.0",
|
|
65
64
|
"applicationinsights": "^2.1.4",
|
|
66
65
|
"async": "^3.2.3",
|
|
67
66
|
"chalk": "^4.1.2",
|
|
@@ -86,16 +85,20 @@
|
|
|
86
85
|
},
|
|
87
86
|
"pkg": {
|
|
88
87
|
"targets": [
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
88
|
+
"node16-linux-x64",
|
|
89
|
+
"node16-win-x64",
|
|
90
|
+
"node16-macos-x64",
|
|
91
|
+
"node16-macos-arm64"
|
|
92
92
|
],
|
|
93
93
|
"scripts": [
|
|
94
|
-
"built/scanner/*.js"
|
|
94
|
+
"built/scanner/*.js",
|
|
95
|
+
"built/rules/**/*.js"
|
|
95
96
|
],
|
|
96
97
|
"assets": [
|
|
97
98
|
"built/sampleConfig/*.yml",
|
|
98
|
-
"built/**/*.json"
|
|
99
|
+
"built/**/*.json",
|
|
100
|
+
"package.json",
|
|
101
|
+
"doc/**/*.md"
|
|
99
102
|
],
|
|
100
103
|
"outputPath": "dist"
|
|
101
104
|
}
|