-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
> The tgz download interface does not check if the package is blocked, which may pose additional risks for parsing package-lock.json or other lock files. [exp](https://registry.npmmirror.com/joker-su/-/joker-su-1.0.0.tgz) 1. 🛡️ Add validation logic for DownloadPackageVersionTarController#download to check if the package is allowed to be downloaded. 2. 🧶 Add PackageVersionService#findBlockInfo to check if the corresponding package is blocked. 3. ♻️ When a single version is blocked, skip check as per the current manifest logic. --------- > tgz 下载接口没有判断包是否被 block,对于 package-lock.json 或者其他依赖锁文件解析可能会有额外风险,[exp](https://registry.npmmirror.com/joker-su/-/joker-su-1.0.0.tgz) 1. 🛡️ `DownloadPackageVersionTarController#download` 接口新增校验逻辑,判断是否允许下载 2. 🧶 新增 PackageVersionService#findBlockInfo 判断对应包是否被全局拦截 3. ♻️ 单版本被 block 时,考虑到误封场景,按目前 manifest 逻辑,不在 tgz 下载时进行拦截操作 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced the package download process with an additional block check. Now, if a package is flagged, the download will be halted and a clear error response is returned to inform users of the block. - Introduced a method to retrieve block information related to package versions, improving the service's capabilities. - **Tests** - Added new test cases to verify the blocking functionality for package downloads, ensuring the application correctly handles requests for blocked packages. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
3 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters