@contrast/assess 1.30.0 → 1.31.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.
|
@@ -28,7 +28,7 @@ module.exports = function (core) {
|
|
|
28
28
|
|
|
29
29
|
const source = sources.fastifyInstrumentation.fastify = {
|
|
30
30
|
install() {
|
|
31
|
-
depHooks.resolve({ name: 'fastify', version: '>=3.
|
|
31
|
+
depHooks.resolve({ name: 'fastify', version: '>=3.2.0' }, (fastify) => patcher.patch(fastify, {
|
|
32
32
|
name: 'fastify.constructor',
|
|
33
33
|
patchType,
|
|
34
34
|
post({ result: server, funcKey }) {
|
|
@@ -44,55 +44,61 @@ module.exports = function (core) {
|
|
|
44
44
|
name: 'Koa.Application',
|
|
45
45
|
patchType,
|
|
46
46
|
pre(data) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
patcher.patch(args[0].cookies, 'set', {
|
|
50
|
-
name: 'ctx.cookies',
|
|
51
|
-
patchType,
|
|
52
|
-
pre({ args }) {
|
|
53
|
-
const sourceContext = getSourceContext();
|
|
54
|
-
if (!sourceContext) return;
|
|
47
|
+
if (data.args?.length === 0) return;
|
|
48
|
+
const [origCtx] = data.args;
|
|
55
49
|
|
|
56
|
-
|
|
50
|
+
if (typeof origCtx !== 'function') return;
|
|
51
|
+
data.args[0] = patcher.patch(origCtx, {
|
|
52
|
+
name: 'ctx',
|
|
53
|
+
patchType,
|
|
54
|
+
pre({ args }) {
|
|
55
|
+
patcher.patch(args[0].cookies, 'set', {
|
|
56
|
+
name: 'ctx.cookies',
|
|
57
|
+
patchType,
|
|
58
|
+
pre({ args }) {
|
|
59
|
+
const sourceContext = getSourceContext();
|
|
60
|
+
if (!sourceContext) return;
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
const secure = options?.secure;
|
|
60
|
-
if (httpOnly && secure) return;
|
|
62
|
+
const [name,, options] = args;
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
64
|
+
const httpOnly = options?.httpOnly;
|
|
65
|
+
const secure = options?.secure;
|
|
66
|
+
if (httpOnly && secure) return;
|
|
67
|
+
|
|
68
|
+
const displayArg = inspect(options);
|
|
69
|
+
const sessionEvent = createSessionEvent({
|
|
70
|
+
args: [{
|
|
71
|
+
tracked: false,
|
|
72
|
+
value: displayArg
|
|
73
|
+
}],
|
|
74
|
+
context: `ctx.cookies.set(${displayArg})`,
|
|
75
|
+
history: [],
|
|
76
|
+
name: 'koaCookie',
|
|
77
|
+
moduleName: 'koa',
|
|
78
|
+
methodName: '',
|
|
79
|
+
object: {
|
|
80
|
+
tracked: false,
|
|
81
|
+
value: 'koa',
|
|
82
|
+
},
|
|
83
|
+
result: {
|
|
84
|
+
tracked: false,
|
|
85
|
+
},
|
|
86
|
+
source: 'P',
|
|
87
|
+
stack: [],
|
|
88
|
+
tags: {},
|
|
89
|
+
framework: 'koa',
|
|
90
|
+
});
|
|
91
|
+
if (!httpOnly) {
|
|
92
|
+
handleHttpOnly(sourceContext, name, sessionEvent);
|
|
93
|
+
}
|
|
88
94
|
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
if (!secure) {
|
|
96
|
+
handleSecure(sourceContext, name, sessionEvent);
|
|
97
|
+
}
|
|
91
98
|
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
};
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
96
102
|
}
|
|
97
103
|
});
|
|
98
104
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/assess",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"description": "Contrast service providing framework-agnostic Assess support",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"test": "../scripts/test.sh"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contrast/common": "1.
|
|
20
|
+
"@contrast/common": "1.22.0",
|
|
21
21
|
"@contrast/distringuish": "^5.0.0",
|
|
22
22
|
"@contrast/scopes": "1.4.1"
|
|
23
23
|
}
|