feat(agent): Agent 远程恢复同样校验备份 SHA-256(补全 #75) (#76)

AgentRestoreSpec/RestoreSpec 新增 Checksum 并由 GetAgentRestoreSpec 透传;Agent ExecuteRestore 在解压前比对 SHA-256,不匹配即中止还原。两条恢复路径完整性保证一致。
This commit is contained in:
Wu Qing
2026-05-27 00:40:49 +08:00
committed by GitHub
parent 45bc210313
commit e63b8f0be8
4 changed files with 27 additions and 0 deletions
@@ -463,6 +463,8 @@ type AgentRestoreSpec struct {
Storage AgentStorageTargetConfig `json:"storage"`
StoragePath string `json:"storagePath"`
FileName string `json:"fileName"`
// Checksum 源备份对象的 SHA-256(小写 hex);Agent 在还原前据此校验完整性。
Checksum string `json:"checksum,omitempty"`
}
// AgentRestoreUpdate Agent 回传的增量更新。
@@ -549,6 +551,7 @@ func (s *RestoreService) GetAgentRestoreSpec(ctx context.Context, node *model.No
},
StoragePath: backupRecord.StoragePath,
FileName: backupRecord.FileName,
Checksum: backupRecord.Checksum,
}, nil
}