forked from zstackio/zstack
-
Notifications
You must be signed in to change notification settings - Fork 0
5.5.22 unified-hardware QA bug batch: 85182/85184/85190/85350 #4034
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
3
commits into
feature-unifi-host
Choose a base branch
from
sync/jin.ma/cordon-container@@2
base: feature-unifi-host
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
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
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
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
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
26 changes: 0 additions & 26 deletions
26
core/src/main/java/org/zstack/core/encrypt/EncryptFacade.java
This file was deleted.
Oops, something went wrong.
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
40 changes: 40 additions & 0 deletions
40
header/src/main/java/org/zstack/header/core/convert/EncryptFacade.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,40 @@ | ||
| package org.zstack.header.core.convert; | ||
|
|
||
| import org.zstack.header.core.encrypt.EncryptEntityState; | ||
| import org.zstack.header.core.encrypt.EncryptedFieldBundle; | ||
| import org.zstack.header.errorcode.ErrorableValue; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Header-resident interface so header-bound entities (e.g. | ||
| * {@code PhysicalServerAO}) can reference the JPA | ||
| * {@link org.zstack.header.core.convert.PasswordConverter} without pulling in | ||
| * the {@code core} module (header is the upstream of core). | ||
| * | ||
| * <p>Originally lived in {@code org.zstack.core.encrypt}; moved with the | ||
| * {@code PasswordConverter} relocation in ZSTAC-85182.</p> | ||
| */ | ||
| public interface EncryptFacade { | ||
| String encrypt(String decryptString); | ||
|
|
||
| String decrypt(String encryptString); | ||
|
|
||
| ErrorableValue<String> encrypt(String data, String algType); | ||
|
|
||
| ErrorableValue<String> decrypt(String data, String algType); | ||
|
|
||
| void updateEncryptDataStateIfExists(String entity, String column, EncryptEntityState state); | ||
|
|
||
| List<EncryptedFieldBundle> getIntegrityEncryptionBundle(); | ||
|
|
||
| List<EncryptedFieldBundle> getConfidentialityEncryptionBundle(); | ||
|
|
||
| /** | ||
| * @return {@code true} when the global password-encrypt toggle is set to | ||
| * {@code None}; the {@link PasswordConverter} treats this as pass-through | ||
| * so legacy unencrypted columns stay readable. Centralised here so the | ||
| * converter does not need to depend on {@code core.EncryptGlobalConfig}. | ||
| */ | ||
| boolean isEncryptionDisabled(); | ||
| } |
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
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
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
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
2 changes: 1 addition & 1 deletion
2
plugin/ceph/src/main/java/org/zstack/storage/ceph/CephMonAO.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
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
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.
encryptFacade == null不应降级为明文透传Line 39 和 Line 50 把
encryptFacade == null视为“直接返回原值”,会在注入异常/初始化异常时静默写入明文密码,属于 fail-open。建议仅在isEncryptionDisabled()时透传,encryptFacade == null应显式失败(或至少告警并阻断写入)。🔧 建议修复
`@Override` public String convertToDatabaseColumn(String attribute) { - if (encryptFacade == null || encryptFacade.isEncryptionDisabled()) { + if (encryptFacade == null) { + throw new IllegalStateException("EncryptFacade is not initialized"); + } + if (encryptFacade.isEncryptionDisabled()) { return attribute; } if (StringUtils.isEmpty(attribute)) { return attribute; } return encryptFacade.encrypt(attribute); } `@Override` public String convertToEntityAttribute(String dbData) { - if (encryptFacade == null || encryptFacade.isEncryptionDisabled()) { + if (encryptFacade == null) { + throw new IllegalStateException("EncryptFacade is not initialized"); + } + if (encryptFacade.isEncryptionDisabled()) { return dbData; } if (StringUtils.isEmpty(dbData)) { return dbData ; } return encryptFacade.decrypt(dbData); }Also applies to: 50-51
🤖 Prompt for AI Agents