Skip to content

Commit 9c5a5e0

Browse files
MLD-1384 - Drop-unrelated-idea-files-and-https-validator-drive-by
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c6e933c commit 9c5a5e0

6 files changed

Lines changed: 5 additions & 152 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

.idea/go.imports.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/vscode-plugin.iml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.idea/workspace.xml

Lines changed: 0 additions & 97 deletions
This file was deleted.

scripts/validate-package-resolution-hook.mjs

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -106,39 +106,15 @@ function installFakeJf(home, { url = "https://validation.jfrog.io" } = {}) {
106106
}
107107

108108
function startFakeArtifactory(port, countFile) {
109-
const certFile = path.join(path.dirname(countFile), "localhost-cert.pem");
110-
const keyFile = path.join(path.dirname(countFile), "localhost-key.pem");
111-
execFileSync(
112-
"openssl",
113-
[
114-
"req",
115-
"-x509",
116-
"-newkey",
117-
"rsa:2048",
118-
"-nodes",
119-
"-subj",
120-
"/CN=127.0.0.1",
121-
"-keyout",
122-
keyFile,
123-
"-out",
124-
certFile,
125-
"-days",
126-
"1",
127-
],
128-
{ stdio: "ignore" },
129-
);
130109
const server = spawn(
131110
process.execPath,
132111
[
133112
"-e",
134113
`
135-
const https = require("node:https");
114+
const http = require("node:http");
136115
const fs = require("node:fs");
137116
const countFile = ${JSON.stringify(countFile)};
138-
https.createServer({
139-
cert: fs.readFileSync(${JSON.stringify(certFile)}),
140-
key: fs.readFileSync(${JSON.stringify(keyFile)}),
141-
}, (req, res) => {
117+
http.createServer((req, res) => {
142118
if (req.url === "/artifactory/api/repositories/npm-virtual") {
143119
const count = Number(fs.readFileSync(countFile, "utf8") || "0") + 1;
144120
fs.writeFileSync(countFile, String(count));
@@ -375,7 +351,7 @@ function main() {
375351
});
376352
try {
377353
const fakeJfBin = installFakeJf(home, {
378-
url: `https://127.0.0.1:${port}`,
354+
url: `http://127.0.0.1:${port}`,
379355
});
380356
const context = additionalContextOf(
381357
runAdapter(home, {
@@ -389,8 +365,6 @@ function main() {
389365
JF_AGENT_IDENTITY_PROBE: "0",
390366
JFROG_TEST_HARNESS: "1",
391367
JFROG_TEST_IDENTITY_PROBE: "skip",
392-
NODE_TLS_REJECT_UNAUTHORIZED: "0",
393-
NODE_NO_WARNINGS: "1",
394368
JFROG_AGENT_HOOKS_LOG_FILE: path.join(home, "hook.log"),
395369
}),
396370
);
@@ -401,7 +375,7 @@ function main() {
401375
}
402376
if (!context.includes("npm-virtual")) {
403377
throw new Error(
404-
`routing policy missing the verified repo key: ${context}`,
378+
`routing policy missing the verified repo key: ${context.slice(0, 200)}`,
405379
);
406380
}
407381
const verifyCount = readFileSync(verifyCountFile, "utf8");

0 commit comments

Comments
 (0)