You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "iamhucong (via GitHub)" <gi...@apache.org> on 2024/04/14 08:28:08 UTC

[PR] Add EncryptAlgorithmMetaData defaultProperties. [shardingsphere]

iamhucong opened a new pull request, #30881:
URL: https://github.com/apache/shardingsphere/pull/30881

   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add EncryptAlgorithmMetaData defaultProperties. [shardingsphere]

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on code in PR #30881:
URL: https://github.com/apache/shardingsphere/pull/30881#discussion_r1565428544


##########
features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/spi/EncryptAlgorithmMetaData.java:
##########
@@ -32,4 +34,6 @@ public final class EncryptAlgorithmMetaData {
     private final boolean supportEquivalentFilter;
     
     private final boolean supportLike;
+    
+    private final Properties defaultProperties;

Review Comment:
   Do you think `defaultProps` is better?



##########
features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/YamlEncryptDataNodeRuleConfigurationSwapper.java:
##########
@@ -55,6 +58,8 @@ public final class YamlEncryptDataNodeRuleConfigurationSwapper implements YamlDa
     public Collection<YamlDataNode> swapToDataNodes(final EncryptRuleConfiguration data) {
         Collection<YamlDataNode> result = new LinkedList<>();
         for (Entry<String, AlgorithmConfiguration> entry : data.getEncryptors().entrySet()) {
+            TypedSPILoader.findServiceWithoutInit(EncryptAlgorithm.class, entry.getValue().getType()).map(EncryptAlgorithm::getMetaData).map(EncryptAlgorithmMetaData::getDefaultProperties)

Review Comment:
   Do you think findUninitedService is better?



##########
features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithm.java:
##########
@@ -48,19 +48,27 @@ public final class AESEncryptAlgorithm implements EncryptAlgorithm {
     private static final String DIGEST_ALGORITHM_NAME = "digest-algorithm-name";
     
     @Getter
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, defaultProperties());
     
     private byte[] secretKey;
     
+    private Properties defaultProperties() {

Review Comment:
   Please rename defaultProperties to getDefaultProperties.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add EncryptAlgorithmMetaData defaultProperties. [shardingsphere]

Posted by "iamhucong (via GitHub)" <gi...@apache.org>.
iamhucong closed pull request #30881: Add EncryptAlgorithmMetaData defaultProperties.
URL: https://github.com/apache/shardingsphere/pull/30881


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org