feat: SHA-256 完整性校验体系(端点/下载头/验证页/元数据+GitHub digest 校验)、验证页状态图标、tls_skip_verify 开关 - #20
Merged
Merged
Conversation
…hash 与 GitHub 链接);后台品牌更新为柠泽资源站(miawa)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
四组改动,围绕文件完整性与出站连接可控性,全部向后兼容(v2 纯新增,不动既有响应格式)。
1. 文件 SHA-256 完整性校验(e7ba814)
GET /api/v2/files/integrity?file_path=:返回{file_path, file_name, size, algorithm: "sha256", sha256}/download/响应新增X-Content-SHA256头(HEAD 请求不加,避免未授权探测触发读盘)2. 资产 hash 写入元数据 + 扫描期 GitHub 校验(114c0c7)
ReleaseAssetSimple新增sha256(omitempty),index.json 元数据与 v2 API 自动透传digest字段校验:本地哈希不一致 → 删除重下(最多 2 次)→ 仍不一致告警并记录本地实际哈希(保证元数据与所服务文件一致,从不 error 中断)3. 验证页状态图标(806489d)
4.
tls_skip_verify全局开关(b6dfcc9)tls_skip_verify(默认false),开启后出站 HTTPS 跳过证书校验测试
go test -count=1 ./...通过(含 5 个新增元数据 hash 单测 + integrity 端点测试)