fix(release): 完成官方发布身份与 legacy CAS 归属保护
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s

This commit is contained in:
2026-09-13 15:34:42 +08:00
parent 5bae90cb14
commit 37d49c9793
11 changed files with 416 additions and 67 deletions
+15 -2
View File
@@ -2325,8 +2325,16 @@ fn verify_localized_distribution_manifest_at(
.ok_or_else(|| {
anyhow::anyhow!("localized distribution 缺少 source official manifest")
})?;
let source_mapping_identity =
crate::official_download::official_distribution_mapping_identity(&official_manifest);
let official_anchor =
crate::official_download::verify_official_distribution_publication_at(
official_release_root,
&manifest.official_release_id,
)
.map_err(anyhow::Error::msg)?
.ok_or_else(|| {
anyhow::anyhow!("localized distribution 缺少 official publication anchor")
})?;
let source_mapping_identity = official_anchor.mapping_identity.clone();
let expected_destination_index =
crate::official_download::official_distribution_destination_index(&official_manifest)
.map_err(anyhow::Error::msg)?;
@@ -4196,6 +4204,11 @@ mod tests {
serde_json::to_vec(&official_manifest).unwrap(),
)
.unwrap();
crate::official_download::write_official_distribution_publication_anchor_at(
&official,
"official-v1",
)
.unwrap();
let manifest = bat_patch::build_patch_manifest(
&official,