Commit 166ceec
feat(package-manager): add comprehensive hash verification for packageManager field
Support Corepack-style packageManager format with integrity hashes:
- Parse format: package@version+algorithm.hash (e.g., yarn@1.22.22+sha512.abc...)
- Support multiple hash algorithms: SHA1, SHA224, SHA256, SHA512
- Verify downloaded package integrity against expected hash
- Re-verify cached packages when hash is provided
- Add proper error handling for hash mismatches
This ensures package manager binaries are authentic and haven't been tampered with,
improving security for monorepo installations.
Examples:
- yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e
- pnpm@8.15.0+sha256.1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
- npm@10.5.0+sha1.abcd1234567890abcdef1234567890abcdef1234
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 6b163db commit 166ceec
7 files changed
Lines changed: 466 additions & 48 deletions
File tree
- crates
- vite_error
- src
- vite_package_manager
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
156 | 165 | | |
157 | 166 | | |
158 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
0 commit comments