Sanitize Edge artifact filenames#549
Conversation
Greptile SummaryThis PR sanitizes user-supplied identifiers before using them in local artifact filenames across four build targets, preventing path-traversal writes outside
Confidence Score: 5/5Safe to merge — the sanitisation logic is correct, tests cover the path-traversal regression and the no-filesystem-side-effects guarantee, and the removal of duplicate validator functions eliminates the only inconsistency that existed before. The safeFileStem three-step pipeline correctly collapses repeated path separators, strips leading/trailing dots and dashes with + quantifiers, and falls back to a safe default. The original productId is preserved in plan metadata. Validation in the other three adapters fires before any filesystem operations, which the tests confirm explicitly. No incorrect data flows or broken contracts were found in the changed paths. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Address Edge filename review" | Re-trigger Greptile |
|
CI follow-up: the failing full-suite test job was hitting the existing duplicate package-validator declarations in pkg-flatpak/pkg-snap/pkg-winget, not the browser-edge change. I added the same package-validator cleanup needed for the suite to run independently on this branch. Fresh verification after the update:px --yes pnpm@9.12.0 exec vitest run packages/targets/browser-edge/src/index.test.ts packages/targets/pkg-flatpak/src/index.test.ts packages/targets/pkg-snap/src/index.test.ts packages/targets/pkg-winget/src/index.test.ts -> 4 files / 28 tests passedpx --yes pnpm@9.12.0 --filter @profullstack/sh1pt-target-browser-edge --filter @profullstack/sh1pt-target-pkg-flatpak --filter @profullstack/sh1pt-target-pkg-snap --filter @profullstack/sh1pt-target-pkg-winget typecheck -> passed |
|
Addressed the Greptile follow-up:
Fresh local verification after the update: |
Fixes #548
Summary
Verification
px --yes pnpm@9.12.0 exec vitest run packages/targets/browser-edge/src/index.test.ts -> 1 file / 6 tests passed
px --yes pnpm@9.12.0 --filter @profullstack/sh1pt-target-browser-edge typecheck -> passed