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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to