You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2024/07/24 05:54:19 UTC
(shardingsphere) branch master updated: Change the digest-algorithm-name property of AESEncryptAlgorithm to require. (#32236)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 9fdd423d5d8 Change the digest-algorithm-name property of AESEncryptAlgorithm to require. (#32236)
9fdd423d5d8 is described below
commit 9fdd423d5d8a1ca0aee58cb5a4c76200e2a5ca6a
Author: Cong Hu <ia...@gmail.com>
AuthorDate: Wed Jul 24 13:54:12 2024 +0800
Change the digest-algorithm-name property of AESEncryptAlgorithm to require. (#32236)
---
.../common-config/builtin-algorithm/encrypt.cn.md | 8 +++----
.../common-config/builtin-algorithm/encrypt.en.md | 8 +++----
.../encrypt/alter-encrypt-rule.cn.md | 4 ++--
.../encrypt/alter-encrypt-rule.en.md | 4 ++--
.../encrypt/create-encrypt-rule.cn.md | 16 ++++++-------
.../encrypt/create-encrypt-rule.en.md | 16 ++++++-------
.../distsql/usage/encrypt-rule.cn.md | 6 ++---
.../distsql/usage/encrypt-rule.en.md | 6 ++---
.../encrypt/config/EncryptRuleConfiguration.java | 27 ++--------------------
.../encrypt/spi/EncryptAlgorithmMetaData.java | 4 ----
.../assisted/MD5AssistedEncryptAlgorithm.java | 2 +-
.../algorithm/standard/AESEncryptAlgorithm.java | 14 +++--------
.../standard/AESEncryptAlgorithmTest.java | 22 ++++--------------
.../fixture/CoreEncryptAlgorithmFixture.java | 4 +---
.../CoreQueryAssistedEncryptAlgorithmFixture.java | 4 +---
.../CoreQueryLikeEncryptAlgorithmFixture.java | 4 +---
.../encrypt/rule/EncryptRuleTest.java | 13 -----------
.../core/src/test/resources/yaml/encrypt-rule.yaml | 2 ++
.../fixture/DistSQLEncryptAlgorithmFixture.java | 4 +---
.../update/CreateEncryptRuleExecutorTest.java | 2 +-
.../infra/spi/type/typed/TypedSPILoader.java | 20 ----------------
.../conf/config_loader/database-encrypt.yaml | 1 +
.../resources/conf/convert/database-encrypt.yaml | 1 +
.../test/resources/conf/convert/database-mix.yaml | 1 +
.../resources/conf/import/database-encrypt.yaml | 1 +
.../src/main/resources/conf/database-encrypt.yaml | 1 +
.../encrypt/JDBCEncryptAlgorithmFixture.java | 4 +---
.../JDBCQueryAssistedEncryptAlgorithmFixture.java | 4 +---
.../e2e/fixture/ITEncryptLikeAlgorithmFixture.java | 2 +-
.../resources/env/common/migration-command.xml | 2 +-
.../rdl/dataset/distsql_rdl/alter_encrypt_rule.xml | 2 +-
.../src/test/resources/cases/rdl/e2e-rdl-alter.xml | 4 ++--
.../test/resources/cases/rdl/e2e-rdl-create.xml | 2 +-
.../src/test/resources/cases/rdl/e2e-rdl-drop.xml | 2 +-
...dbtbl-with-readwrite-splitting-and-encrypt.yaml | 1 +
...dbtbl-with-readwrite-splitting-and-encrypt.yaml | 1 +
...dbtbl-with-readwrite-splitting-and-encrypt.yaml | 1 +
.../rules.yaml | 1 +
.../encrypt/proxy/conf/mysql/database-encrypt.yaml | 1 +
.../proxy/conf/opengauss/database-encrypt.yaml | 1 +
.../proxy/conf/postgresql/database-encrypt.yaml | 1 +
.../test/resources/env/scenario/encrypt/rules.yaml | 1 +
.../database-encrypt-readwrite-splitting.yaml | 1 +
.../database-encrypt-readwrite-splitting.yaml | 1 +
.../database-encrypt-readwrite-splitting.yaml | 1 +
.../encrypt_and_readwrite_splitting/rules.yaml | 1 +
.../proxy/conf/mysql/database-encrypt-shadow.yaml | 1 +
.../conf/opengauss/database-encrypt-shadow.yaml | 1 +
.../conf/postgresql/database-encrypt-shadow.yaml | 1 +
.../env/scenario/encrypt_shadow/rules.yaml | 1 +
.../proxy/conf/mysql/database-mask-encrypt.yaml | 1 +
.../conf/opengauss/database-mask-encrypt.yaml | 1 +
.../conf/postgresql/database-mask-encrypt.yaml | 1 +
.../resources/env/scenario/mask_encrypt/rules.yaml | 1 +
.../conf/mysql/database-mask-encrypt-sharding.yaml | 1 +
.../opengauss/database-mask-encrypt-sharding.yaml | 1 +
.../postgresql/database-mask-encrypt-sharding.yaml | 1 +
.../env/scenario/mask_encrypt_sharding/rules.yaml | 1 +
.../conf/mysql/database-sharding-and-encrypt.yaml | 1 +
.../opengauss/database-sharding-and-encrypt.yaml | 1 +
.../postgresql/database-sharding-and-encrypt.yaml | 1 +
.../env/scenario/sharding_and_encrypt/rules.yaml | 1 +
.../mysql/database-sharding-encrypt-shadow.yaml | 1 +
.../database-sharding-encrypt-shadow.yaml | 1 +
.../database-sharding-encrypt-shadow.yaml | 1 +
.../scenario/sharding_encrypt_shadow/rules.yaml | 1 +
.../src/main/resources/sql/supported/rdl/alter.xml | 8 +++----
.../main/resources/sql/supported/rdl/create.xml | 12 +++++-----
.../RewriteEncryptLikeAlgorithmFixture.java | 2 +-
.../RewriteNormalEncryptAlgorithmFixture.java | 4 +---
...ewriteQueryAssistedEncryptAlgorithmFixture.java | 4 +---
.../RewriteQueryLikeEncryptAlgorithmFixture.java | 4 +---
.../scenario/encrypt/config/query-with-cipher.yaml | 1 +
.../TestQueryAssistedShardingEncryptAlgorithm.java | 4 +---
.../test-native/yaml/features/encrypt.yaml | 3 ++-
75 files changed, 116 insertions(+), 175 deletions(-)
diff --git a/docs/document/content/user-manual/common-config/builtin-algorithm/encrypt.cn.md b/docs/document/content/user-manual/common-config/builtin-algorithm/encrypt.cn.md
index b28f71cf534..06e3b98a9bb 100644
--- a/docs/document/content/user-manual/common-config/builtin-algorithm/encrypt.cn.md
+++ b/docs/document/content/user-manual/common-config/builtin-algorithm/encrypt.cn.md
@@ -17,10 +17,10 @@ weight = 5
可配置属性:
-| *名称* | *数据类型* | *说明* |
-|-----------------------|--------|------------------------------|
-| aes-key-value | String | AES 使用的 KEY |
-| digest-algorithm-name | String | AES KEY 的摘要算法 (可选,默认值:SHA-1) |
+| *名称* | *数据类型* | *说明* |
+|-----------------------|--------|---------------|
+| aes-key-value | String | AES 使用的 KEY |
+| digest-algorithm-name | String | AES KEY 的摘要算法 |
### 辅助查询加密算法
diff --git a/docs/document/content/user-manual/common-config/builtin-algorithm/encrypt.en.md b/docs/document/content/user-manual/common-config/builtin-algorithm/encrypt.en.md
index ef973157ee8..d0199ae8f74 100644
--- a/docs/document/content/user-manual/common-config/builtin-algorithm/encrypt.en.md
+++ b/docs/document/content/user-manual/common-config/builtin-algorithm/encrypt.en.md
@@ -17,10 +17,10 @@ Type: AES
Attributes:
-| *Name* | *DataType* | *Description* |
-|-----------------------|------------|-----------------------------------------------------|
-| aes-key-value | String | AES KEY |
-| digest-algorithm-name | String | AES KEY DIGEST ALGORITHM (optional, default: SHA-1) |
+| *Name* | *DataType* | *Description* |
+|-----------------------|------------|--------------------------|
+| aes-key-value | String | AES KEY |
+| digest-algorithm-name | String | AES KEY DIGEST ALGORITHM |
### Assisted Encrypt Algorithm
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/alter-encrypt-rule.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/alter-encrypt-rule.cn.md
index 11f82c85c7c..4c4d119eb23 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/alter-encrypt-rule.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/alter-encrypt-rule.cn.md
@@ -76,8 +76,8 @@ value ::=
```sql
ALTER ENCRYPT RULE t_encrypt (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id,CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id,CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
));
```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/alter-encrypt-rule.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/alter-encrypt-rule.en.md
index 9d4b44e6131..76a0414ea26 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/alter-encrypt-rule.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/alter-encrypt-rule.en.md
@@ -75,8 +75,8 @@ value ::=
```sql
ALTER ENCRYPT RULE t_encrypt (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id,CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id,CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
));
```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/create-encrypt-rule.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/create-encrypt-rule.cn.md
index e1b55355ccc..5722be0c1de 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/create-encrypt-rule.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/create-encrypt-rule.cn.md
@@ -80,13 +80,13 @@ value ::=
```sql
CREATE ENCRYPT RULE t_encrypt (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id,CIPHER =order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id,CIPHER =order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
)),
t_encrypt_2 (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id, CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id, CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
));
```
@@ -95,13 +95,13 @@ COLUMNS(
```sql
CREATE ENCRYPT RULE IF NOT EXISTS t_encrypt (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id,CIPHER =order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id,CIPHER =order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
)),
t_encrypt_2 (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id,CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id,CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
));
```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/create-encrypt-rule.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/create-encrypt-rule.en.md
index 59cc93acb35..bf26dd9416a 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/create-encrypt-rule.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/encrypt/create-encrypt-rule.en.md
@@ -80,13 +80,13 @@ value ::=
```sql
CREATE ENCRYPT RULE t_encrypt (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id,CIPHER =order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id,CIPHER =order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
)),
t_encrypt_2 (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id, CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id, CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
));
```
@@ -95,13 +95,13 @@ COLUMNS(
```sql
CREATE ENCRYPT RULE IF NOT EXISTS t_encrypt (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id,CIPHER =order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id,CIPHER =order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
)),
t_encrypt_2 (
COLUMNS(
-(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
-(NAME=order_id,CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
+(NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
+(NAME=order_id,CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
));
```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.cn.md
index 71d2701c0c0..e532b93d024 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.cn.md
@@ -22,8 +22,8 @@ REGISTER STORAGE UNIT ds_0 (
```sql
CREATE ENCRYPT RULE t_encrypt (
COLUMNS(
- (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))),
- (NAME=order_id,CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))
+ (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1')))),
+ (NAME=order_id,CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))
));
```
@@ -43,7 +43,7 @@ CREATE TABLE `t_encrypt` (
```sql
ALTER ENCRYPT RULE t_encrypt (
COLUMNS(
- (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))
+ (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))
));
```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.en.md
index 4c9a5ca3daa..c8238bae7f7 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.en.md
@@ -22,8 +22,8 @@ REGISTER STORAGE UNIT ds_0 (
```sql
CREATE ENCRYPT RULE t_encrypt (
COLUMNS(
- (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))),
- (NAME=order_id,CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))
+ (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1')))),
+ (NAME=order_id,CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))
));
```
@@ -43,7 +43,7 @@ CREATE TABLE `t_encrypt` (
```sql
ALTER ENCRYPT RULE t_encrypt (
COLUMNS(
- (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))
+ (NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))
));
```
diff --git a/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/config/EncryptRuleConfiguration.java b/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/config/EncryptRuleConfiguration.java
index 744f1f216ce..3b56adb14e8 100644
--- a/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/config/EncryptRuleConfiguration.java
+++ b/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/config/EncryptRuleConfiguration.java
@@ -18,23 +18,19 @@
package org.apache.shardingsphere.encrypt.config;
import lombok.Getter;
+import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.encrypt.config.rule.EncryptTableRuleConfiguration;
-import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
-import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.config.rule.function.EnhancedRuleConfiguration;
import org.apache.shardingsphere.infra.config.rule.scope.DatabaseRuleConfiguration;
-import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
/**
* Encrypt rule configuration.
*/
+@RequiredArgsConstructor
@Getter
public final class EncryptRuleConfiguration implements DatabaseRuleConfiguration, EnhancedRuleConfiguration {
@@ -42,25 +38,6 @@ public final class EncryptRuleConfiguration implements DatabaseRuleConfiguration
private final Map<String, AlgorithmConfiguration> encryptors;
- public EncryptRuleConfiguration(final Collection<EncryptTableRuleConfiguration> tables, final Map<String, AlgorithmConfiguration> encryptors) {
- this.tables = tables;
- this.encryptors = rebuildEncryptorsWithDefaultProperties(encryptors);
- }
-
- private Map<String, AlgorithmConfiguration> rebuildEncryptorsWithDefaultProperties(final Map<String, AlgorithmConfiguration> encryptors) {
- Map<String, AlgorithmConfiguration> result = new HashMap<>(encryptors.size(), 1F);
- for (Entry<String, AlgorithmConfiguration> entry : encryptors.entrySet()) {
- // todo Replace with MultiSourceProperties, MultiSourceProperties need support marshal.
- Properties props = new Properties();
- props.putAll(entry.getValue().getProps());
- Properties defaultProps = TypedSPILoader.findUninitedService(EncryptAlgorithm.class, entry.getValue().getType()).map(EncryptAlgorithm::getMetaData)
- .map(EncryptAlgorithmMetaData::getDefaultProps).orElseGet(Properties::new);
- defaultProps.forEach(props::putIfAbsent);
- result.put(entry.getKey(), new AlgorithmConfiguration(entry.getValue().getType(), props));
- }
- return result;
- }
-
@Override
public boolean isEmpty() {
return tables.isEmpty();
diff --git a/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/spi/EncryptAlgorithmMetaData.java b/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/spi/EncryptAlgorithmMetaData.java
index c3c8eebae97..557ed66ace5 100644
--- a/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/spi/EncryptAlgorithmMetaData.java
+++ b/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/spi/EncryptAlgorithmMetaData.java
@@ -21,8 +21,6 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import java.util.Properties;
-
/**
* Encrypt algorithm meta data.
*/
@@ -36,6 +34,4 @@ public final class EncryptAlgorithmMetaData {
private final boolean supportEquivalentFilter;
private final boolean supportLike;
-
- private final Properties defaultProps;
}
diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/assisted/MD5AssistedEncryptAlgorithm.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/assisted/MD5AssistedEncryptAlgorithm.java
index 474ab334afe..1a9d9c28279 100644
--- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/assisted/MD5AssistedEncryptAlgorithm.java
+++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/assisted/MD5AssistedEncryptAlgorithm.java
@@ -34,7 +34,7 @@ import java.util.Properties;
public final class MD5AssistedEncryptAlgorithm implements EncryptAlgorithm {
@Getter
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
private MessageDigestAlgorithm digestAlgorithm;
diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithm.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithm.java
index fe55f067bf8..228c22b8620 100644
--- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithm.java
+++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithm.java
@@ -21,13 +21,11 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.SneakyThrows;
import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.codec.digest.MessageDigestAlgorithms;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
-import org.apache.shardingsphere.infra.util.props.MultiSourceProperties;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
@@ -48,26 +46,20 @@ 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, getDefaultProperties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
private byte[] secretKey;
- private Properties getDefaultProperties() {
- Properties result = new Properties();
- result.setProperty(DIGEST_ALGORITHM_NAME, MessageDigestAlgorithms.SHA_1);
- return result;
- }
-
@Override
public void init(final Properties props) {
- Properties multiSourceProperties = new MultiSourceProperties(props, metaData.getDefaultProps());
- secretKey = getSecretKey(multiSourceProperties);
+ secretKey = getSecretKey(props);
}
private byte[] getSecretKey(final Properties props) {
String aesKey = props.getProperty(AES_KEY);
ShardingSpherePreconditions.checkNotEmpty(aesKey, () -> new AlgorithmInitializationException(this, "%s can not be null or empty", AES_KEY));
String digestAlgorithm = props.getProperty(DIGEST_ALGORITHM_NAME);
+ ShardingSpherePreconditions.checkNotEmpty(digestAlgorithm, () -> new AlgorithmInitializationException(this, "%s can not be null or empty", DIGEST_ALGORITHM_NAME));
return Arrays.copyOf(DigestUtils.getDigest(digestAlgorithm.toUpperCase()).digest(aesKey.getBytes(StandardCharsets.UTF_8)), 16);
}
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithmTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithmTest.java
index f8d8cc9bb4c..7eab0b6bdbe 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithmTest.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithmTest.java
@@ -26,11 +26,9 @@ import org.apache.shardingsphere.test.util.PropertiesBuilder;
import org.apache.shardingsphere.test.util.PropertiesBuilder.Property;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.mockito.Answers;
import org.mockito.MockedStatic;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertNull;
@@ -45,27 +43,17 @@ class AESEncryptAlgorithmTest {
@BeforeEach
void setUp() {
- encryptAlgorithm = TypedSPILoader.getService(EncryptAlgorithm.class, "AES", PropertiesBuilder.build(new Property("aes-key-value", "test")));
+ encryptAlgorithm = TypedSPILoader.getService(EncryptAlgorithm.class, "AES", PropertiesBuilder.build(new Property("aes-key-value", "test"), new Property("digest-algorithm-name", "SHA-1")));
}
@Test
- void assertDefaultDigestAlgorithm() throws NoSuchAlgorithmException {
- MockedStatic<DigestUtils> digestUtilsMockedStatic = mockStatic(DigestUtils.class);
- digestUtilsMockedStatic.when(() -> DigestUtils.getDigest("SHA-1")).thenReturn(MessageDigest.getInstance("SHA-1"));
- TypedSPILoader.getService(EncryptAlgorithm.class, "AES", PropertiesBuilder.build(new Property("aes-key-value", "test")));
+ void assertDigestAlgorithm() {
+ MockedStatic<DigestUtils> digestUtilsMockedStatic = mockStatic(DigestUtils.class, Answers.CALLS_REAL_METHODS);
+ TypedSPILoader.getService(EncryptAlgorithm.class, "AES", PropertiesBuilder.build(new Property("aes-key-value", "test"), new Property("digest-algorithm-name", "SHA-1")));
digestUtilsMockedStatic.verify(() -> DigestUtils.getDigest("SHA-1"), times(1));
digestUtilsMockedStatic.close();
}
- @Test
- void assertSHA512DigestAlgorithm() throws NoSuchAlgorithmException {
- MockedStatic<DigestUtils> digestUtilsMockedStatic = mockStatic(DigestUtils.class);
- digestUtilsMockedStatic.when(() -> DigestUtils.getDigest("SHA-512")).thenReturn(MessageDigest.getInstance("SHA-512"));
- TypedSPILoader.getService(EncryptAlgorithm.class, "AES", PropertiesBuilder.build(new Property("aes-key-value", "test"), new Property("digest-algorithm-name", "SHA-512")));
- digestUtilsMockedStatic.verify(() -> DigestUtils.getDigest("SHA-512"), times(1));
- digestUtilsMockedStatic.close();
- }
-
@Test
void assertCreateNewInstanceWithoutAESKey() {
assertThrows(AlgorithmInitializationException.class, () -> TypedSPILoader.getService(EncryptAlgorithm.class, "AES"));
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java
index 217a205948f..1a817ef8bda 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class CoreEncryptAlgorithmFixture implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java
index 0ed7c190530..d91d66573c8 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class CoreQueryAssistedEncryptAlgorithmFixture implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryLikeEncryptAlgorithmFixture.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryLikeEncryptAlgorithmFixture.java
index a3c5a8a80af..6295a91591e 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryLikeEncryptAlgorithmFixture.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryLikeEncryptAlgorithmFixture.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class CoreQueryLikeEncryptAlgorithmFixture implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, false, true, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, false, true);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java
index 57e1e0e1112..a38f1160aa4 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.encrypt.rule;
-import org.apache.commons.codec.digest.MessageDigestAlgorithms;
import org.apache.shardingsphere.encrypt.config.EncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.config.rule.EncryptColumnItemRuleConfiguration;
import org.apache.shardingsphere.encrypt.config.rule.EncryptColumnRuleConfiguration;
@@ -94,18 +93,6 @@ class EncryptRuleTest {
assertThat(pwdColumnConfig.getLikeQuery().get().getEncryptorName(), is("like_query_test_encryptor"));
}
- @Test
- void assertAESEncryptRuleDefaultProps() {
- EncryptRuleConfiguration defaultPropsEncryptRuleConfig = new EncryptRuleConfiguration(Collections.emptyList(),
- Collections.singletonMap("aes_encryptor", new AlgorithmConfiguration("AES", new Properties())));
- assertThat(defaultPropsEncryptRuleConfig.getEncryptors().get("aes_encryptor").getProps().getProperty(DIGEST_ALGORITHM_NAME), is(MessageDigestAlgorithms.SHA_1));
- Properties props = new Properties();
- props.put(DIGEST_ALGORITHM_NAME, MessageDigestAlgorithms.SHA_256);
- EncryptRuleConfiguration sha256EncryptRuleConfig = new EncryptRuleConfiguration(Collections.emptyList(),
- Collections.singletonMap("aes_encryptor", new AlgorithmConfiguration("AES", props)));
- assertThat(sha256EncryptRuleConfig.getEncryptors().get("aes_encryptor").getProps().getProperty(DIGEST_ALGORITHM_NAME), is(MessageDigestAlgorithms.SHA_256));
- }
-
private Map<String, AlgorithmConfiguration> getEncryptors(final AlgorithmConfiguration standardEncryptConfig, final AlgorithmConfiguration queryAssistedEncryptConfig,
final AlgorithmConfiguration queryLikeEncryptConfig) {
Map<String, AlgorithmConfiguration> result = new HashMap<>(3, 1F);
diff --git a/features/encrypt/core/src/test/resources/yaml/encrypt-rule.yaml b/features/encrypt/core/src/test/resources/yaml/encrypt-rule.yaml
index dd8f745457f..d60b40d2d25 100644
--- a/features/encrypt/core/src/test/resources/yaml/encrypt-rule.yaml
+++ b/features/encrypt/core/src/test/resources/yaml/encrypt-rule.yaml
@@ -32,7 +32,9 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
assisted_encryptor:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
diff --git a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/DistSQLEncryptAlgorithmFixture.java b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/DistSQLEncryptAlgorithmFixture.java
index 3225950e500..5a331f4553e 100644
--- a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/DistSQLEncryptAlgorithmFixture.java
+++ b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/DistSQLEncryptAlgorithmFixture.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class DistSQLEncryptAlgorithmFixture implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutorTest.java b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutorTest.java
index 5a3b0b72d21..7f3faf8a04c 100644
--- a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutorTest.java
+++ b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutorTest.java
@@ -88,7 +88,7 @@ class CreateEncryptRuleExecutorTest {
private CreateEncryptRuleStatement createAESEncryptRuleSQLStatement(final boolean ifNotExists) {
EncryptColumnSegment encryptColumnSegment = new EncryptColumnSegment("user_id",
- new EncryptColumnItemSegment("user_cipher", new AlgorithmSegment("AES", PropertiesBuilder.build(new Property("aes-key-value", "abc")))),
+ new EncryptColumnItemSegment("user_cipher", new AlgorithmSegment("AES", PropertiesBuilder.build(new Property("aes-key-value", "abc"), new Property("digest-algorithm-name", "SHA-1")))),
new EncryptColumnItemSegment("assisted_column", null),
new EncryptColumnItemSegment("like_column", null));
Collection<EncryptRuleSegment> rules = new LinkedList<>();
diff --git a/infra/spi/src/main/java/org/apache/shardingsphere/infra/spi/type/typed/TypedSPILoader.java b/infra/spi/src/main/java/org/apache/shardingsphere/infra/spi/type/typed/TypedSPILoader.java
index 08b1177c7c4..4d0c534e75e 100644
--- a/infra/spi/src/main/java/org/apache/shardingsphere/infra/spi/type/typed/TypedSPILoader.java
+++ b/infra/spi/src/main/java/org/apache/shardingsphere/infra/spi/type/typed/TypedSPILoader.java
@@ -65,26 +65,6 @@ public final class TypedSPILoader {
return Optional.empty();
}
- /**
- * Find uninited service.
- *
- * @param serviceInterface typed SPI service interface
- * @param type type
- * @param <T> SPI class type
- * @return found service
- */
- public static <T extends TypedSPI> Optional<T> findUninitedService(final Class<T> serviceInterface, final Object type) {
- if (null == type) {
- return findDefaultService(serviceInterface);
- }
- for (T each : ShardingSphereServiceLoader.getServiceInstances(serviceInterface)) {
- if (matchesType(type, each)) {
- return Optional.of(each);
- }
- }
- return Optional.empty();
- }
-
private static <T extends TypedSPI> Optional<T> findDefaultService(final Class<T> serviceInterface) {
for (T each : ShardingSphereServiceLoader.getServiceInstances(serviceInterface)) {
if (!each.isDefault()) {
diff --git a/proxy/backend/core/src/test/resources/conf/config_loader/database-encrypt.yaml b/proxy/backend/core/src/test/resources/conf/config_loader/database-encrypt.yaml
index b039f42205b..0dd2c560e8c 100644
--- a/proxy/backend/core/src/test/resources/conf/config_loader/database-encrypt.yaml
+++ b/proxy/backend/core/src/test/resources/conf/config_loader/database-encrypt.yaml
@@ -46,3 +46,4 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
diff --git a/proxy/backend/core/src/test/resources/conf/convert/database-encrypt.yaml b/proxy/backend/core/src/test/resources/conf/convert/database-encrypt.yaml
index b5402a83f68..373de309cc1 100644
--- a/proxy/backend/core/src/test/resources/conf/convert/database-encrypt.yaml
+++ b/proxy/backend/core/src/test/resources/conf/convert/database-encrypt.yaml
@@ -44,6 +44,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
like_encryptor:
type: CORE.QUERY_LIKE.FIXTURE
tables:
diff --git a/proxy/backend/core/src/test/resources/conf/convert/database-mix.yaml b/proxy/backend/core/src/test/resources/conf/convert/database-mix.yaml
index 1d48e74363b..6609a270eae 100644
--- a/proxy/backend/core/src/test/resources/conf/convert/database-mix.yaml
+++ b/proxy/backend/core/src/test/resources/conf/convert/database-mix.yaml
@@ -128,6 +128,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_encrypt:
columns:
diff --git a/proxy/backend/core/src/test/resources/conf/import/database-encrypt.yaml b/proxy/backend/core/src/test/resources/conf/import/database-encrypt.yaml
index 8db3648f7d7..bbcba986dda 100644
--- a/proxy/backend/core/src/test/resources/conf/import/database-encrypt.yaml
+++ b/proxy/backend/core/src/test/resources/conf/import/database-encrypt.yaml
@@ -46,6 +46,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_encrypt:
columns:
diff --git a/proxy/bootstrap/src/main/resources/conf/database-encrypt.yaml b/proxy/bootstrap/src/main/resources/conf/database-encrypt.yaml
index 0132c7b0a2e..f72593a56b2 100644
--- a/proxy/bootstrap/src/main/resources/conf/database-encrypt.yaml
+++ b/proxy/bootstrap/src/main/resources/conf/database-encrypt.yaml
@@ -98,6 +98,7 @@
# type: AES
# props:
# aes-key-value: 123456abc
+# digest-algorithm-name: SHA-1
# tables:
# t_encrypt:
# columns:
diff --git a/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java b/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java
index afc013ee7b8..22e04596b5c 100644
--- a/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java
+++ b/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class JDBCEncryptAlgorithmFixture implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java b/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java
index 1fdf369fdd9..76835ff8537 100644
--- a/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java
+++ b/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class JDBCQueryAssistedEncryptAlgorithmFixture implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/e2e/fixture/src/test/java/org/apache/shardingsphere/test/e2e/fixture/ITEncryptLikeAlgorithmFixture.java b/test/e2e/fixture/src/test/java/org/apache/shardingsphere/test/e2e/fixture/ITEncryptLikeAlgorithmFixture.java
index f6bba771213..51ab4fa60b5 100644
--- a/test/e2e/fixture/src/test/java/org/apache/shardingsphere/test/e2e/fixture/ITEncryptLikeAlgorithmFixture.java
+++ b/test/e2e/fixture/src/test/java/org/apache/shardingsphere/test/e2e/fixture/ITEncryptLikeAlgorithmFixture.java
@@ -53,7 +53,7 @@ public final class ITEncryptLikeAlgorithmFixture implements EncryptAlgorithm {
private static final int MAX_NUMERIC_LETTER_CHAR = 255;
@Getter
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true);
private int delta;
diff --git a/test/e2e/operation/pipeline/src/test/resources/env/common/migration-command.xml b/test/e2e/operation/pipeline/src/test/resources/env/common/migration-command.xml
index 7b455d37552..1659848eba4 100644
--- a/test/e2e/operation/pipeline/src/test/resources/env/common/migration-command.xml
+++ b/test/e2e/operation/pipeline/src/test/resources/env/common/migration-command.xml
@@ -63,7 +63,7 @@
<create-target-order-table-encrypt-rule>
CREATE ENCRYPT RULE t_order (
- COLUMNS((NAME=status, CIPHER=status,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))))
+ COLUMNS((NAME=status, CIPHER=status,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))))
</create-target-order-table-encrypt-rule>
<create-target-order-table-rule>
diff --git a/test/e2e/sql/src/test/resources/cases/rdl/dataset/distsql_rdl/alter_encrypt_rule.xml b/test/e2e/sql/src/test/resources/cases/rdl/dataset/distsql_rdl/alter_encrypt_rule.xml
index 57cdd9bf3d6..a147aaad499 100644
--- a/test/e2e/sql/src/test/resources/cases/rdl/dataset/distsql_rdl/alter_encrypt_rule.xml
+++ b/test/e2e/sql/src/test/resources/cases/rdl/dataset/distsql_rdl/alter_encrypt_rule.xml
@@ -29,5 +29,5 @@
<column name="like_query_type" />
<column name="like_query_props" />
</metadata>
- <row values="t_user| pwd| pwd_cipher| | | AES| {"aes-key-value":"123456abcd","digest-algorithm-name":"SHA-1"}| | | | "/>
+ <row values="t_user| pwd| pwd_cipher| | | AES| {"aes-key-value":"123456abcd","digest-algorithm-name":"SHA-256"}| | | | "/>
</dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-alter.xml b/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-alter.xml
index 4269a102ef2..cf7593a6a98 100644
--- a/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-alter.xml
+++ b/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-alter.xml
@@ -32,9 +32,9 @@
</assertion>
</test-case>
- <test-case sql="ALTER ENCRYPT RULE t_user (COLUMNS((NAME=pwd,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abcd'))))));" db-types="MySQL, PostgreSQL">
+ <test-case sql="ALTER ENCRYPT RULE t_user (COLUMNS((NAME=pwd,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abcd', 'digest-algorithm-name'='SHA-256'))))));" db-types="MySQL, PostgreSQL">
<assertion expected-data-file="alter_encrypt_rule.xml">
- <initial-sql sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))));" />
+ <initial-sql sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))));" />
<assertion-sql sql="SHOW ENCRYPT TABLE RULE t_user;" />
<destroy-sql sql="DROP ENCRYPT RULE t_user " />
</assertion>
diff --git a/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-create.xml b/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-create.xml
index 0fd373ebd50..94443e317e5 100644
--- a/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-create.xml
+++ b/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-create.xml
@@ -31,7 +31,7 @@
</assertion>
</test-case>
- <test-case sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))));" db-types="MySQL, PostgreSQL">
+ <test-case sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))));" db-types="MySQL, PostgreSQL">
<assertion expected-data-file="create_encrypt_rule.xml">
<assertion-sql sql="SHOW ENCRYPT TABLE RULE t_user;" />
<destroy-sql sql="DROP ENCRYPT RULE t_user " />
diff --git a/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-drop.xml b/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-drop.xml
index 757db49f204..6fbffca21c1 100644
--- a/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-drop.xml
+++ b/test/e2e/sql/src/test/resources/cases/rdl/e2e-rdl-drop.xml
@@ -34,7 +34,7 @@
<test-case sql="DROP ENCRYPT RULE t_user;" db-types="MySQL, PostgreSQL">
<assertion expected-data-file="drop_encrypt_rule.xml">
- <initial-sql sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))));" />
+ <initial-sql sql="CREATE ENCRYPT RULE t_user (COLUMNS((NAME=pwd,CIPHER=pwd_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))));" />
<assertion-sql sql="SHOW ENCRYPT TABLE RULE t_user;" />
</assertion>
</test-case>
diff --git a/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/mysql/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/mysql/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml
index 8af27775556..92696046e61 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/mysql/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/mysql/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml
@@ -359,6 +359,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/opengauss/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/opengauss/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml
index f4d0e4ffb64..31304f65f45 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/opengauss/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/opengauss/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml
@@ -358,6 +358,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/postgresql/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/postgresql/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml
index f6b4f034731..1cc40d88c24 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/postgresql/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/postgresql/database-dbtbl-with-readwrite-splitting-and-encrypt.yaml
@@ -358,6 +358,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/rules.yaml b/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/rules.yaml
index 36c3802a4ef..0cc032bf645 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/rules.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/rules.yaml
@@ -170,6 +170,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/mysql/database-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/mysql/database-encrypt.yaml
index ee5acbda668..e6117f6d8d8 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/mysql/database-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/mysql/database-encrypt.yaml
@@ -38,6 +38,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
like_encryptor:
type: IT.ENCRYPT.LIKE.FIXTURE
props:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/opengauss/database-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/opengauss/database-encrypt.yaml
index ed3a7d99c7c..fb0ddc0f888 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/opengauss/database-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/opengauss/database-encrypt.yaml
@@ -38,6 +38,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
like_encryptor:
type: IT.ENCRYPT.LIKE.FIXTURE
props:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/postgresql/database-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/postgresql/database-encrypt.yaml
index a5030de3a71..95964326845 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/postgresql/database-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt/proxy/conf/postgresql/database-encrypt.yaml
@@ -38,6 +38,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
like_encryptor:
type: IT.ENCRYPT.LIKE.FIXTURE
props:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt/rules.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt/rules.yaml
index a4c0b5294e4..fd9c35a3ab5 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt/rules.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt/rules.yaml
@@ -25,6 +25,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
like_encryptor:
type: IT.ENCRYPT.LIKE.FIXTURE
props:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/mysql/database-encrypt-readwrite-splitting.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/mysql/database-encrypt-readwrite-splitting.yaml
index 3ebb3fdc1b9..75ff973caba 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/mysql/database-encrypt-readwrite-splitting.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/mysql/database-encrypt-readwrite-splitting.yaml
@@ -58,6 +58,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/opengauss/database-encrypt-readwrite-splitting.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/opengauss/database-encrypt-readwrite-splitting.yaml
index b6ec04773ac..37b847dab95 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/opengauss/database-encrypt-readwrite-splitting.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/opengauss/database-encrypt-readwrite-splitting.yaml
@@ -58,6 +58,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/postgresql/database-encrypt-readwrite-splitting.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/postgresql/database-encrypt-readwrite-splitting.yaml
index 2502c0d615f..965c17a239f 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/postgresql/database-encrypt-readwrite-splitting.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/proxy/conf/postgresql/database-encrypt-readwrite-splitting.yaml
@@ -58,6 +58,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/rules.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/rules.yaml
index e81438a2465..bd6b8e125a4 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/rules.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt_and_readwrite_splitting/rules.yaml
@@ -36,6 +36,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/mysql/database-encrypt-shadow.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/mysql/database-encrypt-shadow.yaml
index 1709fb1f10f..0e21fa0738d 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/mysql/database-encrypt-shadow.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/mysql/database-encrypt-shadow.yaml
@@ -125,6 +125,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_shadow:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/opengauss/database-encrypt-shadow.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/opengauss/database-encrypt-shadow.yaml
index e2cd01be5f8..ce47764155b 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/opengauss/database-encrypt-shadow.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/opengauss/database-encrypt-shadow.yaml
@@ -124,6 +124,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_shadow:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/postgresql/database-encrypt-shadow.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/postgresql/database-encrypt-shadow.yaml
index 22f1a8e4ba9..6412c5aabd0 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/postgresql/database-encrypt-shadow.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/proxy/conf/postgresql/database-encrypt-shadow.yaml
@@ -124,6 +124,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_shadow:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/rules.yaml b/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/rules.yaml
index 3027b606fc1..9dd2ad77473 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/rules.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/encrypt_shadow/rules.yaml
@@ -103,6 +103,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_shadow:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/mysql/database-mask-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/mysql/database-mask-encrypt.yaml
index 9c2c17c503e..580e39e60ef 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/mysql/database-mask-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/mysql/database-mask-encrypt.yaml
@@ -62,6 +62,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/opengauss/database-mask-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/opengauss/database-mask-encrypt.yaml
index 923f8dbd291..29398e01d2e 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/opengauss/database-mask-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/opengauss/database-mask-encrypt.yaml
@@ -62,6 +62,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/postgresql/database-mask-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/postgresql/database-mask-encrypt.yaml
index 8383db0fe6b..75f8d874b34 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/postgresql/database-mask-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/proxy/conf/postgresql/database-mask-encrypt.yaml
@@ -62,6 +62,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/rules.yaml b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/rules.yaml
index f8135b95679..51efa3f3988 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/rules.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt/rules.yaml
@@ -49,6 +49,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/mysql/database-mask-encrypt-sharding.yaml b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/mysql/database-mask-encrypt-sharding.yaml
index a051358fb7a..609f3159250 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/mysql/database-mask-encrypt-sharding.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/mysql/database-mask-encrypt-sharding.yaml
@@ -143,6 +143,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/opengauss/database-mask-encrypt-sharding.yaml b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/opengauss/database-mask-encrypt-sharding.yaml
index b1b323bf71b..10039575253 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/opengauss/database-mask-encrypt-sharding.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/opengauss/database-mask-encrypt-sharding.yaml
@@ -143,6 +143,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/postgresql/database-mask-encrypt-sharding.yaml b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/postgresql/database-mask-encrypt-sharding.yaml
index af22efdcf1a..37918966222 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/postgresql/database-mask-encrypt-sharding.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/proxy/conf/postgresql/database-mask-encrypt-sharding.yaml
@@ -143,6 +143,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/rules.yaml b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/rules.yaml
index ef8d76e643b..705cd0fd8da 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/rules.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/mask_encrypt_sharding/rules.yaml
@@ -49,6 +49,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/mysql/database-sharding-and-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/mysql/database-sharding-and-encrypt.yaml
index 5cf05cde67f..36b88306a90 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/mysql/database-sharding-and-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/mysql/database-sharding-and-encrypt.yaml
@@ -213,6 +213,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/opengauss/database-sharding-and-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/opengauss/database-sharding-and-encrypt.yaml
index 2f6f1782656..2d6296c3ffa 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/opengauss/database-sharding-and-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/opengauss/database-sharding-and-encrypt.yaml
@@ -213,6 +213,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/postgresql/database-sharding-and-encrypt.yaml b/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/postgresql/database-sharding-and-encrypt.yaml
index 94bdde57eec..01d46c94411 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/postgresql/database-sharding-and-encrypt.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/postgresql/database-sharding-and-encrypt.yaml
@@ -213,6 +213,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/rules.yaml b/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/rules.yaml
index 631f73404a7..175485bcae8 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/rules.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/sharding_and_encrypt/rules.yaml
@@ -119,6 +119,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_user:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/mysql/database-sharding-encrypt-shadow.yaml b/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/mysql/database-sharding-encrypt-shadow.yaml
index 4b4cbe9c34d..8e23067cec1 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/mysql/database-sharding-encrypt-shadow.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/mysql/database-sharding-encrypt-shadow.yaml
@@ -307,6 +307,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_shadow:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/opengauss/database-sharding-encrypt-shadow.yaml b/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/opengauss/database-sharding-encrypt-shadow.yaml
index 4a61fecb607..138fc9133d2 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/opengauss/database-sharding-encrypt-shadow.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/opengauss/database-sharding-encrypt-shadow.yaml
@@ -307,6 +307,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_shadow:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/postgresql/database-sharding-encrypt-shadow.yaml b/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/postgresql/database-sharding-encrypt-shadow.yaml
index 86c64207d76..7f77b91d2ab 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/postgresql/database-sharding-encrypt-shadow.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/proxy/conf/postgresql/database-sharding-encrypt-shadow.yaml
@@ -307,6 +307,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_shadow:
columns:
diff --git a/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/rules.yaml b/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/rules.yaml
index 670d1f8ee73..0db62d1c5ed 100644
--- a/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/rules.yaml
+++ b/test/e2e/sql/src/test/resources/env/scenario/sharding_encrypt_shadow/rules.yaml
@@ -123,6 +123,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
tables:
t_shadow:
columns:
diff --git a/test/it/parser/src/main/resources/sql/supported/rdl/alter.xml b/test/it/parser/src/main/resources/sql/supported/rdl/alter.xml
index 255b9aaf879..3eba35aa5e9 100644
--- a/test/it/parser/src/main/resources/sql/supported/rdl/alter.xml
+++ b/test/it/parser/src/main/resources/sql/supported/rdl/alter.xml
@@ -26,10 +26,10 @@
<sql-case id="alter-storage-unit-single-with-properties" value="ALTER STORAGE UNIT ds_0(HOST='127.0.0.1',PORT=3306,DB='test0',USER='ROOT',PASSWORD='123456',PROPERTIES('maxPoolSize'='30'));" db-types="ShardingSphere" />
<sql-case id="alter-storage-unit-url-single-with-empty-properties" value="ALTER STORAGE UNIT ds_0(URL='jdbc:mysql://127.0.0.1:3306/test0',USER='ROOT',PROPERTIES())" db-types="ShardingSphere" />
<sql-case id="alter-storage-unit-url-single-with-properties" value="ALTER STORAGE UNIT ds_0(URL='jdbc:mysql://127.0.0.1:3306/test0',USER='ROOT',PASSWORD='123456',PROPERTIES('maxPoolSize'='30'))" db-types="ShardingSphere" />
- <sql-case id="alter-encrypt-rule" value="ALTER ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
- <sql-case id="alter-encrypt-rule-with-assisted-query-column" value="ALTER ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY_COLUMN=assisted_column, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5'))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
- <sql-case id="alter-encrypt-rule-with-like-query-column" value="ALTER ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,LIKE_QUERY_COLUMN=like_column, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))), LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
- <sql-case id="alter-encrypt-rule-with-query-with-cipher-column" value="ALTER ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="alter-encrypt-rule" value="ALTER ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="alter-encrypt-rule-with-assisted-query-column" value="ALTER ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY_COLUMN=assisted_column, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5'))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="alter-encrypt-rule-with-like-query-column" value="ALTER ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,LIKE_QUERY_COLUMN=like_column, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))), LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="alter-encrypt-rule-with-query-with-cipher-column" value="ALTER ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
<sql-case id="alter-default-shadow-algorithm" value="ALTER DEFAULT SHADOW ALGORITHM TYPE(NAME='SQL_HINT')" db-types="ShardingSphere" />
<sql-case id="alter-shadow-rule" value="ALTER SHADOW RULE shadow_rule(SOURCE=demo_ds,SHADOW=demo_ds_shadow,t_order(TYPE(NAME='REGEX_MATCH',PROPERTIES('operation'='insert','column'='user_id','regex'='[1]')),TYPE(NAME='SQL_HINT')))" db-types="ShardingSphere" />
<sql-case id="alter-sharding-auto-table-rule" value="ALTER SHARDING TABLE RULE t_order (STORAGE_UNITS(ms_group_0,ms_group_1), SHARDING_COLUMN=order_id, TYPE(NAME='hash_mod',PROPERTIES('sharding-count'='4')),KEY_GENERATE_STRATEGY(COLUMN=another_id,TYPE(NAME='snowflake')))" db-types="ShardingSphere" />
diff --git a/test/it/parser/src/main/resources/sql/supported/rdl/create.xml b/test/it/parser/src/main/resources/sql/supported/rdl/create.xml
index be20ff4dba4..08ec77bbad2 100644
--- a/test/it/parser/src/main/resources/sql/supported/rdl/create.xml
+++ b/test/it/parser/src/main/resources/sql/supported/rdl/create.xml
@@ -39,10 +39,10 @@
<sql-case id="create-readwrite-splitting-rule" value="CREATE READWRITE_SPLITTING RULE ms_group_0 (WRITE_STORAGE_UNIT=primary_ds, READ_STORAGE_UNITS(replica_ds_0,replica_ds_1), TYPE(NAME='random'))" db-types="ShardingSphere" />
<sql-case id="create-readwrite-splitting-rule-if-not-exists" value="CREATE READWRITE_SPLITTING RULE IF NOT EXISTS ms_group_0 (WRITE_STORAGE_UNIT=primary_ds, READ_STORAGE_UNITS(replica_ds_0,replica_ds_1), TYPE(NAME='random'))" db-types="ShardingSphere" />
<sql-case id="create-readwrite-splitting-rule-with-transactional-read-query-strategy" value="CREATE READWRITE_SPLITTING RULE ms_group_0 (WRITE_STORAGE_UNIT=primary_ds, READ_STORAGE_UNITS(replica_ds_0,replica_ds_1), TRANSACTIONAL_READ_QUERY_STRATEGY='DYNAMIC', TYPE(NAME='random'))" db-types="ShardingSphere" />
- <sql-case id="create-encrypt-rule" value="CREATE ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
- <sql-case id="create-encrypt-rule-if-not-exists" value="CREATE ENCRYPT RULE IF NOT EXISTS t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
- <sql-case id="create-encrypt-rule-with-assisted-query-column" value="CREATE ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY_COLUMN=assisted_column, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5'))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
- <sql-case id="create-encrypt-rule-with-like-query-column" value="CREATE ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,LIKE_QUERY_COLUMN=like_column, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))), LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="create-encrypt-rule" value="CREATE ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="create-encrypt-rule-if-not-exists" value="CREATE ENCRYPT RULE IF NOT EXISTS t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="create-encrypt-rule-with-assisted-query-column" value="CREATE ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY_COLUMN=assisted_column, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5'))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="create-encrypt-rule-with-like-query-column" value="CREATE ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,CIPHER=user_cipher,LIKE_QUERY_COLUMN=like_column, ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))), LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
<sql-case id="create-shadow-rule" value="CREATE SHADOW RULE shadow_rule(SOURCE=demo_ds,SHADOW=demo_ds_shadow,t_order(TYPE(NAME='REGEX_MATCH',PROPERTIES('operation'='insert','column'='user_id','regex'='[1]')),TYPE(NAME='SQL_HINT')))" db-types="ShardingSphere" />
<sql-case id="create-shadow-rule-if-not-exists" value="CREATE SHADOW RULE IF NOT EXISTS shadow_rule(SOURCE=demo_ds,SHADOW=demo_ds_shadow,t_order(TYPE(NAME='REGEX_MATCH',PROPERTIES('operation'='insert','column'='user_id','regex'='[1]')),TYPE(NAME='SQL_HINT')))" db-types="ShardingSphere" />
<sql-case id="create-default-sharding-table-strategy-with-lower-case" value="create default sharding table strategy(type='standard', sharding_column=order_id, SHARDING_ALGORITHM(TYPE(NAME='INLINE',PROPERTIES('algorithm-expression'='t_order_${order_id % 2}'))))" db-types="ShardingSphere" />
@@ -71,8 +71,8 @@
<sql-case id="create-sharding-auto-table-rule-with-quota" value="CREATE SHARDING TABLE RULE `t_order` (STORAGE_UNITS(ms_group_0,ms_group_1), SHARDING_COLUMN=order_id,TYPE(NAME='hash_mod',PROPERTIES('sharding-count'='4')), KEY_GENERATE_STRATEGY(COLUMN=another_id,TYPE(NAME='snowflake')))" db-types="ShardingSphere" />
<sql-case id="create-broadcast-table-rule-with-quota" value="CREATE BROADCAST TABLE RULE `t_1`,`t_2` " db-types="ShardingSphere" />
<sql-case id="create-readwrite-splitting-rule-with-quota" value="CREATE READWRITE_SPLITTING RULE `ms_group_0` (WRITE_STORAGE_UNIT=primary_ds, READ_STORAGE_UNITS(replica_ds_0,replica_ds_1), TYPE(NAME='random'))" db-types="ShardingSphere" />
- <sql-case id="create-encrypt-rule-with-quota" value="CREATE ENCRYPT RULE `encrypt` (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
- <sql-case id="create-encrypt-rule-with-query-with-cipher-column" value="CREATE ENCRYPT RULE `encrypt` (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="create-encrypt-rule-with-quota" value="CREATE ENCRYPT RULE `encrypt` (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1')))), (NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='RC4',PROPERTIES('rc4-key-value'='123456abc'))))))" db-types="ShardingSphere" />
+ <sql-case id="create-encrypt-rule-with-query-with-cipher-column" value="CREATE ENCRYPT RULE `encrypt` (COLUMNS((NAME=user_id,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))))" db-types="ShardingSphere" />
<sql-case id="create-shadow-rule-with-quota" value="CREATE SHADOW RULE `shadow_rule`(SOURCE=demo_ds,SHADOW=demo_ds_shadow,t_order(TYPE(NAME='REGEX_MATCH',PROPERTIES('operation'='insert','column'='user_id','regex'='[1]')),TYPE(NAME='SQL_HINT')))" db-types="ShardingSphere" />
<sql-case id="single-register-migration-source-storage-unit" value="REGISTER MIGRATION SOURCE STORAGE UNIT ds_0 (URL='jdbc:mysql://127.0.0.1:3306/test0',USER='ROOT',PASSWORD='123456');" db-types="ShardingSphere" />
<sql-case id="create-mask-rule" value="CREATE MASK RULE t_mask (COLUMNS((NAME=phone_number,TYPE(NAME='MASK_FROM_X_TO_Y', PROPERTIES('from-x'=1, 'to-y'=2, 'replace-char'='*'))), (NAME=address,TYPE(NAME=MD5))));" db-types="ShardingSphere" />
diff --git a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteEncryptLikeAlgorithmFixture.java b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteEncryptLikeAlgorithmFixture.java
index c23e7f9ee17..12f9dd31a48 100644
--- a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteEncryptLikeAlgorithmFixture.java
+++ b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteEncryptLikeAlgorithmFixture.java
@@ -53,7 +53,7 @@ public final class RewriteEncryptLikeAlgorithmFixture implements EncryptAlgorith
private static final int MAX_NUMERIC_LETTER_CHAR = 255;
@Getter
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true);
private int delta;
diff --git a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteNormalEncryptAlgorithmFixture.java b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteNormalEncryptAlgorithmFixture.java
index 8c8c65dd3c9..3cc88541078 100644
--- a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteNormalEncryptAlgorithmFixture.java
+++ b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteNormalEncryptAlgorithmFixture.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class RewriteNormalEncryptAlgorithmFixture implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryAssistedEncryptAlgorithmFixture.java b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryAssistedEncryptAlgorithmFixture.java
index 27950fb3e41..e3c1a88245c 100644
--- a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryAssistedEncryptAlgorithmFixture.java
+++ b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryAssistedEncryptAlgorithmFixture.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class RewriteQueryAssistedEncryptAlgorithmFixture implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryLikeEncryptAlgorithmFixture.java b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryLikeEncryptAlgorithmFixture.java
index c2cccdbab1c..21913c0ac51 100644
--- a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryLikeEncryptAlgorithmFixture.java
+++ b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryLikeEncryptAlgorithmFixture.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class RewriteQueryLikeEncryptAlgorithmFixture implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/it/rewriter/src/test/resources/scenario/encrypt/config/query-with-cipher.yaml b/test/it/rewriter/src/test/resources/scenario/encrypt/config/query-with-cipher.yaml
index c0ee0ebf2cf..7a0a5660d55 100644
--- a/test/it/rewriter/src/test/resources/scenario/encrypt/config/query-with-cipher.yaml
+++ b/test/it/rewriter/src/test/resources/scenario/encrypt/config/query-with-cipher.yaml
@@ -137,6 +137,7 @@ rules:
type: AES
props:
aes-key-value: 123456abc
+ digest-algorithm-name: SHA-1
rewrite_it_like_encryptor_fixture:
type: IT.ENCRYPT.LIKE.FIXTURE
props:
diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/algorithm/TestQueryAssistedShardingEncryptAlgorithm.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/algorithm/TestQueryAssistedShardingEncryptAlgorithm.java
index 2743bb1d4f8..3bbf6ee4846 100644
--- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/algorithm/TestQueryAssistedShardingEncryptAlgorithm.java
+++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/algorithm/TestQueryAssistedShardingEncryptAlgorithm.java
@@ -22,12 +22,10 @@ import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
-import java.util.Properties;
-
@Getter
public final class TestQueryAssistedShardingEncryptAlgorithm implements EncryptAlgorithm {
- private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
+ private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
@Override
public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/native/src/test/resources/test-native/yaml/features/encrypt.yaml b/test/native/src/test/resources/test-native/yaml/features/encrypt.yaml
index dfe52b7f685..9ae9b794b0d 100644
--- a/test/native/src/test/resources/test-native/yaml/features/encrypt.yaml
+++ b/test/native/src/test/resources/test-native/yaml/features/encrypt.yaml
@@ -51,10 +51,11 @@ rules:
type: AES
props:
aes-key-value: 123456
+ digest-algorithm-name: SHA-1
assisted_encryptor:
type: assistedTest
props:
aes-key-value: 123456
-
+ digest-algorithm-name: SHA-1
props:
sql-show: false