forked from zstackio/zstack
-
Notifications
You must be signed in to change notification settings - Fork 0
<fix>[volume]: <description #3268
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
Open
MatheMatrix
wants to merge
1
commit into
feature-zsv-5.0.0-zmigrate
Choose a base branch
from
sync/tao.gan/zmigrate-ZSV-1@@3
base: feature-zsv-5.0.0-zmigrate
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <error> | ||
| <prefix>ZMigrate</prefix> | ||
|
|
||
| <code> | ||
| <id>1000</id> | ||
| <description>ZCE-X generic error</description> | ||
| </code> | ||
|
|
||
| <code> | ||
| <id>1001</id> | ||
| <description>Failed to connect ZCE-X server</description> | ||
| </code> | ||
|
|
||
| <code> | ||
| <id>1002</id> | ||
| <description>Authorization fails in ZCE-X server</description> | ||
| </code> | ||
|
|
||
| <code> | ||
| <id>1003</id> | ||
| <description>ZCE-X API operation fail</description> | ||
| </code> | ||
| </error> |
79 changes: 79 additions & 0 deletions
79
header/src/main/java/org/zstack/header/storage/backup/CopyFileFromBackupStorageHostMsg.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| package org.zstack.header.storage.backup; | ||
|
|
||
| import org.zstack.header.message.NeedReplyMessage; | ||
|
|
||
| public class CopyFileFromBackupStorageHostMsg extends NeedReplyMessage implements BackupStorageMessage { | ||
| private String backupStorageUuid; | ||
| private String backupStorageHostUuid; | ||
| private String dstHostname; | ||
| private String dstSshPassword; | ||
| private String dstSshUsername; | ||
| private int dstSshPort; | ||
| private String dstFilePath; | ||
| private String targetFilePath; | ||
|
|
||
| @Override | ||
| public String getBackupStorageUuid() { | ||
| return backupStorageUuid; | ||
| } | ||
|
|
||
| public void setBackupStorageUuid(String backupStorageUuid) { | ||
| this.backupStorageUuid = backupStorageUuid; | ||
| } | ||
|
|
||
| public String getBackupStorageHostUuid() { | ||
| return backupStorageHostUuid; | ||
| } | ||
|
|
||
| public void setBackupStorageHostUuid(String backupStorageHostUuid) { | ||
| this.backupStorageHostUuid = backupStorageHostUuid; | ||
| } | ||
|
|
||
| public String getDstHostname() { | ||
| return dstHostname; | ||
| } | ||
|
|
||
| public void setDstHostname(String dstHostname) { | ||
| this.dstHostname = dstHostname; | ||
| } | ||
|
|
||
| public String getDstSshPassword() { | ||
| return dstSshPassword; | ||
| } | ||
|
|
||
| public void setDstSshPassword(String dstSshPassword) { | ||
| this.dstSshPassword = dstSshPassword; | ||
| } | ||
|
|
||
| public String getDstSshUsername() { | ||
| return dstSshUsername; | ||
| } | ||
|
|
||
| public void setDstSshUsername(String dstSshUsername) { | ||
| this.dstSshUsername = dstSshUsername; | ||
| } | ||
|
|
||
| public int getDstSshPort() { | ||
| return dstSshPort; | ||
| } | ||
|
|
||
| public void setDstSshPort(int dstSshPort) { | ||
| this.dstSshPort = dstSshPort; | ||
| } | ||
|
|
||
| public String getDstFilePath() { | ||
| return dstFilePath; | ||
| } | ||
|
|
||
| public void setDstFilePath(String dstFilePath) { | ||
| this.dstFilePath = dstFilePath; | ||
| } | ||
|
|
||
| public String getTargetFilePath() { | ||
| return targetFilePath; | ||
| } | ||
|
|
||
| public void setTargetFilePath(String targetFilePath) { | ||
| this.targetFilePath = targetFilePath; | ||
| } | ||
| } | ||
15 changes: 15 additions & 0 deletions
15
...er/src/main/java/org/zstack/header/storage/backup/CopyFileFromBackupStorageHostReply.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package org.zstack.header.storage.backup; | ||
|
|
||
| import org.zstack.header.message.MessageReply; | ||
|
|
||
| public class CopyFileFromBackupStorageHostReply extends MessageReply { | ||
| private String upgradeScriptPath; | ||
|
|
||
| public String getUpgradeScriptPath() { | ||
| return upgradeScriptPath; | ||
| } | ||
|
|
||
| public void setUpgradeScriptPath(String upgradeScriptPath) { | ||
| this.upgradeScriptPath = upgradeScriptPath; | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
header/src/main/java/org/zstack/header/storage/backup/DeleteFilesOnBackupStorageHostMsg.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package org.zstack.header.storage.backup; | ||
|
|
||
| import org.zstack.header.message.NeedReplyMessage; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class DeleteFilesOnBackupStorageHostMsg extends NeedReplyMessage implements BackupStorageMessage { | ||
| private String backupStorageUuid; | ||
| private String backupStorageHostUuid; | ||
| private List<String> filesPath; | ||
|
|
||
| @Override | ||
| public String getBackupStorageUuid() { | ||
| return backupStorageUuid; | ||
| } | ||
|
|
||
| public void setBackupStorageUuid(String backupStorageUuid) { | ||
| this.backupStorageUuid = backupStorageUuid; | ||
| } | ||
|
|
||
| public String getBackupStorageHostUuid() { | ||
| return backupStorageHostUuid; | ||
| } | ||
|
|
||
| public void setBackupStorageHostUuid(String backupStorageHostUuid) { | ||
| this.backupStorageHostUuid = backupStorageHostUuid; | ||
| } | ||
|
|
||
| public List<String> getFilesPath() { | ||
| return filesPath; | ||
| } | ||
|
|
||
| public void setFilesPath(List<String> filesPath) { | ||
| this.filesPath = filesPath; | ||
| } | ||
| } |
55 changes: 55 additions & 0 deletions
55
...r/src/main/java/org/zstack/header/storage/backup/DeleteFilesOnBackupStorageHostReply.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| package org.zstack.header.storage.backup; | ||
|
|
||
| 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; | ||
|
Comment on lines
+8
to
+14
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. 字段与删除操作语义不匹配,疑似复制粘贴错误。 当前
请确认这是否为预期设计,或者是否应该移除这些与删除操作无关的字段。 🤖 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; | ||
| } | ||
| } | ||
43 changes: 43 additions & 0 deletions
43
header/src/main/java/org/zstack/header/storage/backup/GetFileDownloadProgressMsg.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package org.zstack.header.storage.backup; | ||
|
|
||
| import org.zstack.header.message.NeedReplyMessage; | ||
|
|
||
| public class GetFileDownloadProgressMsg extends NeedReplyMessage implements BackupStorageMessage { | ||
| private String backupStorageUuid; | ||
| private String backupStorageHostUuid; | ||
| private String taskUuid; | ||
| private String hostname; | ||
|
|
||
| @Override | ||
| public String getBackupStorageUuid() { | ||
| return backupStorageUuid; | ||
| } | ||
|
|
||
| public void setBackupStorageUuid(String backupStorageUuid) { | ||
| this.backupStorageUuid = backupStorageUuid; | ||
| } | ||
|
|
||
| public String getBackupStorageHostUuid() { | ||
| return backupStorageHostUuid; | ||
| } | ||
|
|
||
| public void setBackupStorageHostUuid(String backupStorageHostUuid) { | ||
| this.backupStorageHostUuid = backupStorageHostUuid; | ||
| } | ||
|
|
||
| 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; | ||
| } | ||
| } |
122 changes: 122 additions & 0 deletions
122
header/src/main/java/org/zstack/header/storage/backup/GetFileDownloadProgressReply.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| package org.zstack.header.storage.backup; | ||
|
|
||
| import org.zstack.header.message.MessageReply; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| public class GetFileDownloadProgressReply extends MessageReply { | ||
| private boolean completed; | ||
| private int progress; | ||
|
|
||
| private long size; | ||
| private long actualSize; | ||
| private long downloadSize; | ||
| private String installPath; | ||
| private long lastOpTime; | ||
| private boolean supportSuspend; | ||
| private String md5sum; | ||
| private String format; | ||
|
|
||
| private String unzipInstallPath; | ||
| private Map<String, Long> unzipFiles; | ||
|
|
||
| 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; | ||
| } | ||
|
|
||
| public String getMd5sum() { | ||
| return md5sum; | ||
| } | ||
|
|
||
| public void setMd5sum(String md5sum) { | ||
| this.md5sum = md5sum; | ||
| } | ||
|
|
||
| public String getUnzipInstallPath() { | ||
| return unzipInstallPath; | ||
| } | ||
|
|
||
| public void setUnzipInstallPath(String unzipInstallPath) { | ||
| this.unzipInstallPath = unzipInstallPath; | ||
| } | ||
|
|
||
| public Map<String, Long> getUnzipFiles() { | ||
| return unzipFiles; | ||
| } | ||
|
|
||
| public void setUnzipFiles(Map<String, Long> unzipFiles) { | ||
| this.unzipFiles = unzipFiles; | ||
| } | ||
| } |
Oops, something went wrong.
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.
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.
🧩 Analysis chain
🏁 Script executed:
# First, let's examine the full CopyFileFromBackupStorageHostMsg.java file cat header/src/main/java/org/zstack/header/image/CopyFileFromBackupStorageHostMsg.javaRepository: MatheMatrix/zstack
Length of output: 2121
🏁 Script executed:
Repository: MatheMatrix/zstack
Length of output: 9767
🏁 Script executed:
Repository: MatheMatrix/zstack
Length of output: 6807
🏁 Script executed:
Repository: MatheMatrix/zstack
Length of output: 7541
🏁 Script executed:
Repository: MatheMatrix/zstack
Length of output: 3294
在
dstSshPassword字段上添加@NoLogging注解以防止敏感信息泄露。dstSshPassword字段缺少@NoLogging注解。该字段作为明文 String 存储在消息对象中,当消息被序列化用于日志或审计时,敏感的 SSH 密码凭证可能被意外输出。ZStack 整个代码库中对敏感字段的标准做法是使用@NoLogging注解(如APIAddSftpBackupStorageMsg、KVMAgentCommands等)。请在此字段添加该注解以符合安全标准:🤖 Prompt for AI Agents