diff --git a/.changeset/spotty-showers-prove.md b/.changeset/spotty-showers-prove.md new file mode 100644 index 00000000..d67261d6 --- /dev/null +++ b/.changeset/spotty-showers-prove.md @@ -0,0 +1,7 @@ +--- +"@nodesecure/conformance": minor +"@nodesecure/github": minor +"@nodesecure/gitlab": minor +--- + +chore(httpie): move from @myunisoft/httpie to @openally/httpie diff --git a/package-lock.json b/package-lock.json index 6e72b019..de4aaf7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12624,7 +12624,7 @@ "spdx-expression-parse": "^4.0.0" }, "devDependencies": { - "@myunisoft/httpie": "^5.0.1", + "@openally/httpie": "^1.0.0", "@types/spdx-expression-parse": "^3.0.5", "node-estree": "^4.0.0" }, @@ -12681,7 +12681,7 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@myunisoft/httpie": "^5.0.0", + "@openally/httpie": "^1.0.0", "tar-fs": "^3.0.5" }, "devDependencies": { @@ -12696,7 +12696,7 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@myunisoft/httpie": "^5.0.0", + "@openally/httpie": "^1.0.0", "tar-fs": "^3.0.6" }, "devDependencies": { diff --git a/workspaces/conformance/package.json b/workspaces/conformance/package.json index f5b6b74e..68cfeb52 100644 --- a/workspaces/conformance/package.json +++ b/workspaces/conformance/package.json @@ -35,7 +35,7 @@ }, "homepage": "https://github.com/NodeSecure/tree/master/workspaces/conformance#readme", "devDependencies": { - "@myunisoft/httpie": "^5.0.1", + "@openally/httpie": "^1.0.0", "@types/spdx-expression-parse": "^3.0.5", "node-estree": "^4.0.0" }, diff --git a/workspaces/conformance/scripts/fetchSpdxLicenses.js b/workspaces/conformance/scripts/fetchSpdxLicenses.js index 87bbf1ab..7ef82b51 100644 --- a/workspaces/conformance/scripts/fetchSpdxLicenses.js +++ b/workspaces/conformance/scripts/fetchSpdxLicenses.js @@ -2,7 +2,7 @@ import fs from "node:fs"; // Import Third-party Dependencies -import httpie from "@myunisoft/httpie"; +import * as httpie from "@openally/httpie"; import * as astring from "astring"; import { ESTree, Helpers, VarDeclaration } from "node-estree"; diff --git a/workspaces/github/package.json b/workspaces/github/package.json index 43b79419..8efc4e9c 100644 --- a/workspaces/github/package.json +++ b/workspaces/github/package.json @@ -32,7 +32,7 @@ }, "homepage": "https://github.com/NodeSecure/scanner/tree/master/workspaces/github#readme", "dependencies": { - "@myunisoft/httpie": "^5.0.0", + "@openally/httpie": "^1.0.0", "tar-fs": "^3.0.5" }, "devDependencies": { diff --git a/workspaces/github/src/functions/download.ts b/workspaces/github/src/functions/download.ts index 6fc40f0b..ff6e1213 100644 --- a/workspaces/github/src/functions/download.ts +++ b/workspaces/github/src/functions/download.ts @@ -3,12 +3,14 @@ import * as path from "node:path"; import { createWriteStream } from "node:fs"; // Import Third-party Dependencies -import httpie from "@myunisoft/httpie"; +import * as httpie from "@openally/httpie"; // CONSTANTS const kGithubURL = new URL("https://github.com/"); const kDefaultBranch = "main"; +const agent = new httpie.Agent().compose(httpie.interceptors.redirect({ maxRedirections: 1 })); + export interface DownloadOptions { /** * The destination (location) to extract the tar.gz @@ -71,7 +73,7 @@ export async function download( "Accept-Encoding": "gzip, deflate", Authorization: typeof token === "string" ? `token ${token}` : void 0 }, - maxRedirections: 1 + agent }); await writableCallback(() => createWriteStream(location)); diff --git a/workspaces/gitlab/package.json b/workspaces/gitlab/package.json index 3eb20a5b..bcec455b 100644 --- a/workspaces/gitlab/package.json +++ b/workspaces/gitlab/package.json @@ -30,7 +30,7 @@ }, "homepage": "https://github.com/NodeSecure/scanner/tree/master/workspaces/gitlab#readme", "dependencies": { - "@myunisoft/httpie": "^5.0.0", + "@openally/httpie": "^1.0.0", "tar-fs": "^3.0.6" }, "devDependencies": { diff --git a/workspaces/gitlab/src/functions/download.ts b/workspaces/gitlab/src/functions/download.ts index ab21165b..6c0c18f7 100644 --- a/workspaces/gitlab/src/functions/download.ts +++ b/workspaces/gitlab/src/functions/download.ts @@ -5,7 +5,7 @@ import { } from "node:fs"; // Import Third-party Dependencies -import httpie from "@myunisoft/httpie"; +import * as httpie from "@openally/httpie"; // Import Internal Dependencies import * as utils from "../utils.js"; @@ -51,6 +51,8 @@ export interface DownloadResult { branch: string; } +const agent = new httpie.Agent().compose(httpie.interceptors.redirect({ maxRedirections: 1 })); + export async function download( repository: string, options: DownloadOptions = Object.create(null) @@ -73,7 +75,7 @@ export async function download( const repositoryURL = new URL(utils.getRepositoryPath(repository), gitlab); const { data: gitlabManifest } = await httpie.get(repositoryURL, { headers, - maxRedirections: 1 + agent }); const wantedBranch = typeof branch === "string" ? branch : gitlabManifest.default_branch; @@ -86,7 +88,7 @@ export async function download( ); const writableCallback = httpie.stream("GET", archiveURL, { headers: { ...headers, "Accept-Encoding": "gzip, deflate" }, - maxRedirections: 1 + agent }); await writableCallback(() => createWriteStream(location));