-
Notifications
You must be signed in to change notification settings - Fork 0
<fix>[volume]: <description #3123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: zsv_4.10.28
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package org.zstack.header.image; | ||
|
|
||
| import org.zstack.header.message.NeedReplyMessage; | ||
| import org.zstack.header.storage.backup.BackupStorageMessage; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class DeleteFilesOnBackupStorageHostMsg extends NeedReplyMessage implements BackupStorageMessage { | ||
| private String backupStorageUuid; | ||
| private List<String> filesPath; | ||
|
|
||
| @Override | ||
| public String getBackupStorageUuid() { | ||
| return backupStorageUuid; | ||
| } | ||
|
|
||
| public void setBackupStorageUuid(String backupStorageUuid) { | ||
| this.backupStorageUuid = backupStorageUuid; | ||
| } | ||
|
|
||
| public List<String> getFilesPath() { | ||
| return filesPath; | ||
| } | ||
|
|
||
| public void setFilesPath(List<String> filesPath) { | ||
| this.filesPath = filesPath; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| package org.zstack.header.image; | ||
|
|
||
| import org.zstack.header.log.NoLogging; | ||
| import org.zstack.header.message.MessageReply; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| public class DeleteFilesOnBackupStorageHostReply extends MessageReply { | ||
| private String md5sum; | ||
| private long size; | ||
| @NoLogging(type = NoLogging.Type.Uri) | ||
| private String directUploadUrl; | ||
| private String unzipInstallPath; | ||
| private Map<String, Long> filesSize; | ||
|
|
||
| public String getMd5sum() { | ||
| return md5sum; | ||
| } | ||
|
|
||
| public void setMd5sum(String md5sum) { | ||
| this.md5sum = md5sum; | ||
| } | ||
|
|
||
| public long getSize() { | ||
| return size; | ||
| } | ||
|
|
||
| public void setSize(long size) { | ||
| this.size = size; | ||
| } | ||
|
|
||
| public String getDirectUploadUrl() { | ||
| return directUploadUrl; | ||
| } | ||
|
|
||
| public void setDirectUploadUrl(String directUploadUrl) { | ||
| this.directUploadUrl = directUploadUrl; | ||
| } | ||
|
|
||
| public String getUnzipInstallPath() { | ||
| return unzipInstallPath; | ||
| } | ||
|
|
||
| public void setUnzipInstallPath(String unzipInstallPath) { | ||
| this.unzipInstallPath = unzipInstallPath; | ||
| } | ||
|
|
||
| public Map<String, Long> getFilesSize() { | ||
| return filesSize; | ||
| } | ||
|
|
||
| public void setFilesSize(Map<String, Long> filesSize) { | ||
| this.filesSize = filesSize; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package org.zstack.header.image; | ||
|
|
||
| import org.zstack.header.log.NoLogging; | ||
| import org.zstack.header.message.NeedReplyMessage; | ||
| import org.zstack.header.storage.backup.BackupStorageMessage; | ||
|
|
||
| public class UploadFileToBackupStorageHostMsg extends NeedReplyMessage implements BackupStorageMessage { | ||
| private String backupStorageUuid; | ||
| private String taskUuid; | ||
| @NoLogging(type = NoLogging.Type.Uri) | ||
| private String url; | ||
| private String installPath; | ||
|
|
||
| @Override | ||
| public String getBackupStorageUuid() { | ||
| return backupStorageUuid; | ||
| } | ||
|
|
||
| public void setBackupStorageUuid(String backupStorageUuid) { | ||
| this.backupStorageUuid = backupStorageUuid; | ||
| } | ||
|
|
||
| public String getTaskUuid() { | ||
| return taskUuid; | ||
| } | ||
|
|
||
| public void setTaskUuid(String taskUuid) { | ||
| this.taskUuid = taskUuid; | ||
| } | ||
|
|
||
| public String getUrl() { | ||
| return url; | ||
| } | ||
|
|
||
| public void setUrl(String url) { | ||
| this.url = url; | ||
| } | ||
|
|
||
| public String getInstallPath() { | ||
| return installPath; | ||
| } | ||
|
|
||
| public void setInstallPath(String installPath) { | ||
| this.installPath = installPath; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| package org.zstack.header.image; | ||
|
|
||
| import org.zstack.header.log.NoLogging; | ||
| import org.zstack.header.message.MessageReply; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| public class UploadFileToBackupStorageHostReply extends MessageReply { | ||
| private String md5sum; | ||
| private long size; | ||
| @NoLogging(type = NoLogging.Type.Uri) | ||
| private String directUploadUrl; | ||
| private String unzipInstallPath; | ||
| private Map<String, Long> filesSize; | ||
|
|
||
| private String hostname; | ||
| private String sshUsername; | ||
| @NoLogging | ||
| private String sshPassword; | ||
| private Integer sshPort; | ||
|
Comment on lines
+16
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# First, find and examine the UploadFileToBackupStorageHostReply.java file
fd -n "UploadFileToBackupStorageHostReply.java" --type fRepository: MatheMatrix/zstack Length of output: 292 🏁 Script executed: #!/bin/bash
# Examine the file content
cat -n "header/src/main/java/org/zstack/header/image/UploadFileToBackupStorageHostReply.java"Repository: MatheMatrix/zstack Length of output: 2770 🏁 Script executed: #!/bin/bash
# Search for other Reply classes that contain SSH credentials
rg -n "sshPassword|sshUsername" --type=java -g '*Reply.java' -C2Repository: MatheMatrix/zstack Length of output: 2660 🏁 Script executed: #!/bin/bash
# Search for where UploadFileToBackupStorageHostReply is used/instantiated
rg -n "UploadFileToBackupStorageHostReply" --type=java -C2Repository: MatheMatrix/zstack Length of output: 2018 🏁 Script executed: #!/bin/bash
# Check if other sensitive credentials appear in Reply classes
rg -n "@NoLogging" --type=java -g '*Reply.java' -B2 -A2 | head -100Repository: MatheMatrix/zstack Length of output: 5979 为
建议的修改: private String sshUsername;改为: `@NoLogging`
private String sshUsername;🤖 Prompt for AI Agents |
||
|
|
||
| public String getMd5sum() { | ||
| return md5sum; | ||
| } | ||
|
|
||
| public void setMd5sum(String md5sum) { | ||
| this.md5sum = md5sum; | ||
| } | ||
|
|
||
| public long getSize() { | ||
| return size; | ||
| } | ||
|
|
||
| public void setSize(long size) { | ||
| this.size = size; | ||
| } | ||
|
|
||
| public String getDirectUploadUrl() { | ||
| return directUploadUrl; | ||
| } | ||
|
|
||
| public void setDirectUploadUrl(String directUploadUrl) { | ||
| this.directUploadUrl = directUploadUrl; | ||
| } | ||
|
|
||
| public String getUnzipInstallPath() { | ||
| return unzipInstallPath; | ||
| } | ||
|
|
||
| public void setUnzipInstallPath(String unzipInstallPath) { | ||
| this.unzipInstallPath = unzipInstallPath; | ||
| } | ||
|
|
||
| public Map<String, Long> getFilesSize() { | ||
| return filesSize; | ||
| } | ||
|
|
||
| public void setFilesSize(Map<String, Long> filesSize) { | ||
| this.filesSize = filesSize; | ||
| } | ||
|
|
||
| public String getHostname() { | ||
| return hostname; | ||
| } | ||
|
|
||
| public void setHostname(String hostname) { | ||
| this.hostname = hostname; | ||
| } | ||
|
|
||
| public String getSshUsername() { | ||
| return sshUsername; | ||
| } | ||
|
|
||
| public void setSshUsername(String sshUsername) { | ||
| this.sshUsername = sshUsername; | ||
| } | ||
|
|
||
| public String getSshPassword() { | ||
| return sshPassword; | ||
| } | ||
|
|
||
| public void setSshPassword(String sshPassword) { | ||
| this.sshPassword = sshPassword; | ||
| } | ||
|
|
||
| public Integer getSshPort() { | ||
| return sshPort; | ||
| } | ||
|
|
||
| public void setSshPort(Integer sshPort) { | ||
| this.sshPort = sshPort; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package org.zstack.header.storage.backup; | ||
|
|
||
| import org.zstack.header.message.NeedReplyMessage; | ||
|
|
||
| public class GetFileDownloadProgressMsg extends NeedReplyMessage implements BackupStorageMessage { | ||
| private String backupStorageUuid; | ||
| private String taskUuid; | ||
| private String hostname; | ||
|
|
||
| @Override | ||
| public String getBackupStorageUuid() { | ||
| return backupStorageUuid; | ||
| } | ||
|
|
||
| public void setBackupStorageUuid(String backupStorageUuid) { | ||
| this.backupStorageUuid = backupStorageUuid; | ||
| } | ||
|
|
||
| public String getTaskUuid() { | ||
| return taskUuid; | ||
| } | ||
|
|
||
| public void setTaskUuid(String taskUuid) { | ||
| this.taskUuid = taskUuid; | ||
| } | ||
|
|
||
| public String getHostname() { | ||
| return hostname; | ||
| } | ||
|
|
||
| public void setHostname(String hostname) { | ||
| this.hostname = hostname; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| package org.zstack.header.storage.backup; | ||
|
|
||
| import org.zstack.header.message.MessageReply; | ||
|
|
||
| public class GetFileDownloadProgressReply extends MessageReply { | ||
| private boolean completed; | ||
| private int progress; | ||
|
|
||
| private long size; | ||
| private long actualSize; | ||
| private long downloadSize; | ||
| private String installPath; | ||
| private String format; | ||
| private long lastOpTime; | ||
| private boolean supportSuspend; | ||
|
Comment on lines
+5
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 缺少 在 🔎 建议添加 md5sum 字段 public class GetFileDownloadProgressReply extends MessageReply {
private boolean completed;
private int progress;
private long size;
private long actualSize;
private long downloadSize;
private String installPath;
private String format;
private long lastOpTime;
private boolean supportSuspend;
+ private String md5sum;
+
+ public String getMd5sum() {
+ return md5sum;
+ }
+
+ public void setMd5sum(String md5sum) {
+ this.md5sum = md5sum;
+ }🤖 Prompt for AI Agents |
||
|
|
||
| public boolean isCompleted() { | ||
| return completed; | ||
| } | ||
|
|
||
| public void setCompleted(boolean completed) { | ||
| this.completed = completed; | ||
| } | ||
|
|
||
| public int getProgress() { | ||
| return progress; | ||
| } | ||
|
|
||
| public void setProgress(int progress) { | ||
| this.progress = progress; | ||
| } | ||
|
|
||
| public long getSize() { | ||
| return size; | ||
| } | ||
|
|
||
| public void setSize(long size) { | ||
| this.size = size; | ||
| } | ||
|
|
||
| public long getActualSize() { | ||
| return actualSize; | ||
| } | ||
|
|
||
| public void setActualSize(long actualSize) { | ||
| this.actualSize = actualSize; | ||
| } | ||
|
|
||
| public boolean isDownloadComplete() { | ||
| return actualSize > 0 && actualSize == downloadSize; | ||
| } | ||
|
|
||
| public String getInstallPath() { | ||
| return installPath; | ||
| } | ||
|
|
||
| public void setInstallPath(String installPath) { | ||
| this.installPath = installPath; | ||
| } | ||
|
|
||
| public String getFormat() { | ||
| return format; | ||
| } | ||
|
|
||
| public void setFormat(String format) { | ||
| this.format = format; | ||
| } | ||
|
|
||
| public long getLastOpTime() { | ||
| return lastOpTime; | ||
| } | ||
|
|
||
| public void setLastOpTime(long lastOpTime) { | ||
| this.lastOpTime = lastOpTime; | ||
| } | ||
|
|
||
| public long getDownloadSize() { | ||
| return downloadSize; | ||
| } | ||
|
|
||
| public void setDownloadSize(long downloadSize) { | ||
| this.downloadSize = downloadSize; | ||
| } | ||
|
|
||
| public boolean isSupportSuspend() { | ||
| return supportSuspend; | ||
| } | ||
|
|
||
| public void setSupportSuspend(boolean supportSuspend) { | ||
| this.supportSuspend = supportSuspend; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reply 类字段设计与删除操作语义不符。
DeleteFilesOnBackupStorageHostReply包含md5sum、size、directUploadUrl、unzipInstallPath、filesSize等字段,这些通常用于上传/下载操作的响应,与删除操作的语义不匹配。结合
CephBackupStorageBase中的处理器使用了错误的类型(UploadFileToBackupStorageHostReply),建议重新审视此类的设计:简化后的删除响应类示例