Skip to content

Commit d84c65b

Browse files
remove compatible encrypt config (#29750)
1 parent 5e97062 commit d84c65b

File tree

31 files changed

+2
-1305
lines changed

31 files changed

+2
-1305
lines changed

docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.cn.md

-39
Original file line numberDiff line numberDiff line change
@@ -93,45 +93,6 @@ rules:
9393
YamlShardingSphereDataSourceFactory.createDataSource(getFile());
9494
```
9595

96-
为了保持对低版本 YAML 配置的兼容,ShardingSphere 通过 `COMPATIBLE_ENCRYPT` 提供了如下的兼容配置,该配置会在后续版本中删除,建议及时升级最新 YAML 配置。
97-
98-
```yaml
99-
dataSources:
100-
unique_ds:
101-
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
102-
driverClassName: com.mysql.jdbc.Driver
103-
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
104-
username: root
105-
password:
106-
107-
rules:
108-
- !COMPATIBLE_ENCRYPT
109-
tables:
110-
t_user:
111-
columns:
112-
username:
113-
cipherColumn: username
114-
encryptorName: aes_encryptor
115-
assistedQueryColumn: assisted_query_username
116-
assistedQueryEncryptorName: assisted_encryptor
117-
likeQueryColumn: like_query_username
118-
likeQueryEncryptorName: like_encryptor
119-
pwd:
120-
cipherColumn: pwd
121-
encryptorName: aes_encryptor
122-
assistedQueryColumn: assisted_query_pwd
123-
assistedQueryEncryptorName: assisted_encryptor
124-
encryptors:
125-
aes_encryptor:
126-
type: AES
127-
props:
128-
aes-key-value: 123456abc
129-
assisted_encryptor:
130-
type: MD5
131-
like_encryptor:
132-
type: CHAR_DIGEST_LIKE
133-
```
134-
13596
## 相关参考
13697

13798
- [核心特性:数据加密](/cn/features/encrypt/)

docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.en.md

-39
Original file line numberDiff line numberDiff line change
@@ -94,45 +94,6 @@ Read the YAML configuration to create a data source according to the createDataS
9494
YamlShardingSphereDataSourceFactory.createDataSource(getFile());
9595
```
9696

97-
In order to keep compatibility with earlier YAML configuration, ShardingSphere provides following compatible configuration through 'COMPATIBLE_ENCRYPT', which will be removed in future versions, and it is recommended to upgrade latest YAML configuration.
98-
99-
```yaml
100-
dataSources:
101-
unique_ds:
102-
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
103-
driverClassName: com.mysql.jdbc.Driver
104-
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
105-
username: root
106-
password:
107-
108-
rules:
109-
- !COMPATIBLE_ENCRYPT
110-
tables:
111-
t_user:
112-
columns:
113-
username:
114-
cipherColumn: username
115-
encryptorName: aes_encryptor
116-
assistedQueryColumn: assisted_query_username
117-
assistedQueryEncryptorName: assisted_encryptor
118-
likeQueryColumn: like_query_username
119-
likeQueryEncryptorName: like_encryptor
120-
pwd:
121-
cipherColumn: pwd
122-
encryptorName: aes_encryptor
123-
assistedQueryColumn: assisted_query_pwd
124-
assistedQueryEncryptorName: assisted_encryptor
125-
encryptors:
126-
aes_encryptor:
127-
type: AES
128-
props:
129-
aes-key-value: 123456abc
130-
assisted_encryptor:
131-
type: MD5
132-
like_encryptor:
133-
type: CHAR_DIGEST_LIKE
134-
```
135-
13697
## Related References
13798

13899
- [Core Feature: Data Encryption](/en/features/encrypt/)

features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/api/config/CompatibleEncryptRuleConfiguration.java

-57
This file was deleted.

features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/checker/CompatibleEncryptRuleConfigurationChecker.java

-53
This file was deleted.

features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/metadata/nodepath/CompatibleEncryptRuleNodePathProvider.java

-45
This file was deleted.

features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java

-18
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.shardingsphere.encrypt.rule;
1919

2020
import lombok.Getter;
21-
import org.apache.shardingsphere.encrypt.api.config.CompatibleEncryptRuleConfiguration;
2221
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
2322
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
2423
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
@@ -62,23 +61,6 @@ public EncryptRule(final String databaseName, final EncryptRuleConfiguration rul
6261
}
6362
}
6463

65-
/**
66-
* Encrypt rule constructor.
67-
*
68-
* @deprecated deprecated by compatible encrypt rule configuration
69-
*/
70-
@Deprecated
71-
public EncryptRule(final String databaseName, final CompatibleEncryptRuleConfiguration ruleConfig) {
72-
this.databaseName = databaseName;
73-
configuration = ruleConfig;
74-
Map<String, EncryptAlgorithm> encryptors = new LinkedHashMap<>();
75-
ruleConfig.getEncryptors().forEach((key, value) -> encryptors.put(key, TypedSPILoader.getService(EncryptAlgorithm.class, value.getType(), value.getProps())));
76-
for (EncryptTableRuleConfiguration each : ruleConfig.getTables()) {
77-
tables.put(each.getName().toLowerCase(), new EncryptTable(each, encryptors));
78-
tableNamesMapper.put(each.getName());
79-
}
80-
}
81-
8264
private void checkEncryptorType(final EncryptColumnRuleConfiguration columnRuleConfig, final Map<String, EncryptAlgorithm> encryptors) {
8365
ShardingSpherePreconditions.checkState(encryptors.containsKey(columnRuleConfig.getCipher().getEncryptorName())
8466
&& encryptors.get(columnRuleConfig.getCipher().getEncryptorName()).getMetaData().isSupportDecrypt(),

features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/builder/CompatibleEncryptRuleBuilder.java

-55
This file was deleted.

0 commit comments

Comments
 (0)