fix(cr2-backend): 工作台包凭据拒绝与并发幂等、会话/任务终态收口
- CR-02/05/21:confirm 前解包拒绝凭据文件、清理被拒对象;V176 版本唯一键;并发 confirm 幂等 - CR-07/08/09/10:登录世代回读再签、心跳只停续期、终态任务不被失败回调改写、告警先推送再推进基线 - CR-11:品牌 Gating 写操作限平台超管 - CR-18:关键词分页钳制 + V177 四表 DDL - CR-20:中断恢复标志并上抛 - catch 棘轮按 9 处新增逐条点名更新基线 定向 154 例全绿(0 fail / 0 skip);V174/V175 未回改。
This commit is contained in:
+34
@@ -24,6 +24,9 @@ import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.HexFormat;
|
||||
@@ -351,6 +354,37 @@ public class OssStorageService {
|
||||
return HexFormat.of().formatHex(digest.digest());
|
||||
}
|
||||
|
||||
/**
|
||||
* 把工作台客户端包流式落到本地临时文件,供 confirm 阶段做 zip 内容检查(CR-02)。
|
||||
*
|
||||
* <p>包体上限 512MB,不能整包读入内存;下载按 1MB 块流式拷贝,临时文件由调用方负责删除。
|
||||
* 该方法只做传输,不做内容判定。</p>
|
||||
*/
|
||||
public Path downloadWorkbenchClientObjectToTempFile(String objectKey) {
|
||||
requireWorkbenchClientKey(objectKey);
|
||||
Path temp = null;
|
||||
try {
|
||||
temp = Files.createTempFile("workbench-client-package-", ".zip");
|
||||
try (InputStream stream = buildClient().getObject(GetObjectArgs.builder()
|
||||
.bucket(publicClientBucket())
|
||||
.object(objectKey)
|
||||
.build())) {
|
||||
Files.copy(stream, temp, StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
return temp;
|
||||
} catch (Exception ex) {
|
||||
if (temp != null) {
|
||||
try {
|
||||
Files.deleteIfExists(temp);
|
||||
} catch (Exception cleanupFailure) {
|
||||
log.warn("[oss] 清理工作台安装包临时文件失败 path={} err={}",
|
||||
temp, cleanupFailure.getMessage());
|
||||
}
|
||||
}
|
||||
throw storageFailure("download", objectKey, ex);
|
||||
}
|
||||
}
|
||||
|
||||
/** 工作台客户端包公开下载 URL:优先 download-endpoint(主机 B 反代回源),未配置回退 public-endpoint。 */
|
||||
public String getWorkbenchClientDownloadUrl(String objectKey) {
|
||||
requireWorkbenchClientKey(objectKey);
|
||||
|
||||
Reference in New Issue
Block a user