mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-05-12 10:36:57 +00:00
Limit GitHub tokens to github.com download URLs
This commit is contained in:
@@ -223,7 +223,7 @@ describe("download-version", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("does not rewrite non-GitHub URLs", async () => {
|
||||
it("does not send the token to non-GitHub URLs from the default manifest", async () => {
|
||||
mockGetArtifact.mockResolvedValue({
|
||||
archiveFormat: "tar.gz",
|
||||
checksum: "abc123",
|
||||
@@ -241,8 +241,30 @@ describe("download-version", () => {
|
||||
expect(mockDownloadTool).toHaveBeenCalledWith(
|
||||
"https://example.com/uv.tar.gz",
|
||||
undefined,
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
|
||||
it("does not send the token to GitHub lookalike hosts", async () => {
|
||||
mockGetArtifact.mockResolvedValue({
|
||||
archiveFormat: "tar.gz",
|
||||
checksum: "abc123",
|
||||
downloadUrl: "https://github.com.evil.test/uv.tar.gz",
|
||||
});
|
||||
|
||||
await downloadVersion(
|
||||
"unknown-linux-gnu",
|
||||
"x86_64",
|
||||
"0.9.26",
|
||||
undefined,
|
||||
"token",
|
||||
);
|
||||
|
||||
expect(mockDownloadTool).toHaveBeenCalledWith(
|
||||
"https://github.com.evil.test/uv.tar.gz",
|
||||
undefined,
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
|
||||
it("falls back to GitHub Releases when the mirror fails", async () => {
|
||||
|
||||
Reference in New Issue
Block a user