Skip to content

Commit 941c5bc

Browse files
authored
Fixed high security alerts for sdk-testgen codes (#8473)
* Fixed high security alerts for sdk-testgen codes * Fix lint error
1 parent 296a188 commit 941c5bc

3 files changed

Lines changed: 538 additions & 614 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"use strict";
2+
3+
/**
4+
* When using the PNPM package manager, you can use pnpmfile.js to workaround
5+
* dependencies that have mistakes in their package.json file. (This feature is
6+
* functionally similar to Yarn's "resolutions".)
7+
*
8+
* For details, see the PNPM documentation:
9+
* https://pnpm.js.org/docs/en/hooks.html
10+
*
11+
* IMPORTANT: SINCE THIS FILE CONTAINS EXECUTABLE CODE, MODIFYING IT IS LIKELY TO INVALIDATE
12+
* ANY CACHED DEPENDENCY ANALYSIS. After any modification to pnpmfile.js, it's recommended to run
13+
* "rush update --full" so that PNPM will recalculate all version selections.
14+
*/
15+
module.exports = {
16+
hooks: {
17+
readPackage,
18+
},
19+
};
20+
21+
const fixups = {
22+
braces: {
23+
applyTo: ["micromatch"],
24+
with: "3.0.2",
25+
}
26+
};
27+
28+
function readPackage(packageJson, context) {
29+
for (const dep of Object.keys(fixups)) {
30+
const to = fixups[dep];
31+
if (to.applyTo.includes(packageJson.name)) {
32+
context.log(
33+
`Fixed up dependencies for ${packageJson.name} => ${dep}:${to.with}`
34+
);
35+
packageJson.dependencies[dep] = to.with
36+
}
37+
}
38+
39+
return packageJson;
40+
}

0 commit comments

Comments
 (0)