mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Add uv (Astral Python package manager) support
- Add uv package manager implementation following pip pattern - Configure MITM proxy with CA bundle for PyPI packages - Add shell integration (bash/zsh/fish/PowerShell) - Conditional on --include-python flag - Add 33 comprehensive E2E tests covering: - uv pip install/sync/compile commands - uv add for project dependencies - uv tool install for global tools - uv run --with for ephemeral dependencies - uv sync for project syncing - Malware blocking verification for all methods - Update documentation and package.json - Install uv in Docker test environment
This commit is contained in:
parent
5b6fe659c2
commit
cab3a0aba3
14 changed files with 739 additions and 9 deletions
|
|
@ -0,0 +1,30 @@
|
|||
import { test } from "node:test";
|
||||
import assert from "node:assert";
|
||||
import { createUvPackageManager } from "./createUvPackageManager.js";
|
||||
|
||||
test("createUvPackageManager", async (t) => {
|
||||
await t.test("should create package manager with required interface", () => {
|
||||
const pm = createUvPackageManager();
|
||||
|
||||
assert.ok(pm);
|
||||
assert.strictEqual(typeof pm.runCommand, "function");
|
||||
assert.strictEqual(typeof pm.isSupportedCommand, "function");
|
||||
assert.strictEqual(typeof pm.getDependencyUpdatesForCommand, "function");
|
||||
});
|
||||
|
||||
await t.test("should use proxy-only approach (MITM)", () => {
|
||||
const pm = createUvPackageManager();
|
||||
|
||||
// uv uses proxy-only approach, so it doesn't scan args
|
||||
assert.strictEqual(pm.isSupportedCommand(["pip", "install", "requests"]), false);
|
||||
assert.strictEqual(pm.isSupportedCommand(["add", "requests"]), false);
|
||||
assert.strictEqual(pm.isSupportedCommand([]), false);
|
||||
});
|
||||
|
||||
await t.test("should return empty dependency updates", () => {
|
||||
const pm = createUvPackageManager();
|
||||
|
||||
const result = pm.getDependencyUpdatesForCommand(["pip", "install", "requests"]);
|
||||
assert.deepStrictEqual(result, []);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue