@contrast/assess
Advanced tools
Comparing version 1.30.0 to 1.31.0
@@ -31,3 +31,3 @@ /* | ||
install() { | ||
depHooks.resolve({ name: 'fastify', version: '>=3.0.0' }, (fastify) => patcher.patch(fastify, { | ||
depHooks.resolve({ name: 'fastify', version: '>=3.2.0' }, (fastify) => patcher.patch(fastify, { | ||
name: 'fastify.constructor', | ||
@@ -34,0 +34,0 @@ patchType, |
@@ -47,51 +47,57 @@ /* | ||
pre(data) { | ||
const origCtx = data.args[0]; | ||
data.args[0] = function(...args) { | ||
patcher.patch(args[0].cookies, 'set', { | ||
name: 'ctx.cookies', | ||
patchType, | ||
pre({ args }) { | ||
const sourceContext = getSourceContext(); | ||
if (!sourceContext) return; | ||
if (data.args?.length === 0) return; | ||
const [origCtx] = data.args; | ||
const [name,, options] = args; | ||
if (typeof origCtx !== 'function') return; | ||
data.args[0] = patcher.patch(origCtx, { | ||
name: 'ctx', | ||
patchType, | ||
pre({ args }) { | ||
patcher.patch(args[0].cookies, 'set', { | ||
name: 'ctx.cookies', | ||
patchType, | ||
pre({ args }) { | ||
const sourceContext = getSourceContext(); | ||
if (!sourceContext) return; | ||
const httpOnly = options?.httpOnly; | ||
const secure = options?.secure; | ||
if (httpOnly && secure) return; | ||
const [name,, options] = args; | ||
const displayArg = inspect(options); | ||
const sessionEvent = createSessionEvent({ | ||
args: [{ | ||
tracked: false, | ||
value: displayArg | ||
}], | ||
context: `ctx.cookies.set(${displayArg})`, | ||
history: [], | ||
name: 'koaCookie', | ||
moduleName: 'koa', | ||
methodName: '', | ||
object: { | ||
tracked: false, | ||
value: 'koa', | ||
}, | ||
result: { | ||
tracked: false, | ||
}, | ||
source: 'P', | ||
stack: [], | ||
tags: {}, | ||
framework: 'koa', | ||
}); | ||
if (!httpOnly) { | ||
handleHttpOnly(sourceContext, name, sessionEvent); | ||
} | ||
const httpOnly = options?.httpOnly; | ||
const secure = options?.secure; | ||
if (httpOnly && secure) return; | ||
if (!secure) { | ||
handleSecure(sourceContext, name, sessionEvent); | ||
const displayArg = inspect(options); | ||
const sessionEvent = createSessionEvent({ | ||
args: [{ | ||
tracked: false, | ||
value: displayArg | ||
}], | ||
context: `ctx.cookies.set(${displayArg})`, | ||
history: [], | ||
name: 'koaCookie', | ||
moduleName: 'koa', | ||
methodName: '', | ||
object: { | ||
tracked: false, | ||
value: 'koa', | ||
}, | ||
result: { | ||
tracked: false, | ||
}, | ||
source: 'P', | ||
stack: [], | ||
tags: {}, | ||
framework: 'koa', | ||
}); | ||
if (!httpOnly) { | ||
handleHttpOnly(sourceContext, name, sessionEvent); | ||
} | ||
if (!secure) { | ||
handleSecure(sourceContext, name, sessionEvent); | ||
} | ||
} | ||
} | ||
}); | ||
return origCtx.apply(this, args); | ||
}; | ||
}); | ||
} | ||
}); | ||
} | ||
@@ -98,0 +104,0 @@ }); |
{ | ||
"name": "@contrast/assess", | ||
"version": "1.30.0", | ||
"version": "1.31.0", | ||
"description": "Contrast service providing framework-agnostic Assess support", | ||
@@ -20,3 +20,3 @@ "license": "SEE LICENSE IN LICENSE", | ||
"dependencies": { | ||
"@contrast/common": "1.21.3", | ||
"@contrast/common": "1.22.0", | ||
"@contrast/distringuish": "^5.0.0", | ||
@@ -23,0 +23,0 @@ "@contrast/scopes": "1.4.1" |
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
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
624606
17689
+ Added@contrast/common@1.22.0(transitive)
- Removed@contrast/common@1.21.3(transitive)
Updated@contrast/common@1.22.0