From 308baa6cbf1075ace2be1d607a563b065ec2ee22 Mon Sep 17 00:00:00 2001 From: duanzhengqiang Date: Tue, 26 Sep 2023 19:06:20 +0800 Subject: [PATCH] Remove useless rc4 config and update document for shardingsphere plugin --- .../content/reference/management/_index.cn.md | 2 +- .../content/reference/management/_index.en.md | 4 ++-- .../optional-plugins/_index.cn.md | 3 ++- .../optional-plugins/_index.en.md | 3 ++- .../encrypt/alter-encrypt-rule.cn.md | 2 +- .../encrypt/alter-encrypt-rule.en.md | 2 +- .../encrypt/create-encrypt-rule.cn.md | 8 ++++---- .../encrypt/create-encrypt-rule.en.md | 8 ++++---- .../distsql/usage/encrypt-rule.cn.md | 2 +- .../distsql/usage/encrypt-rule.en.md | 2 +- .../optional-plugins/_index.cn.md | 2 ++ .../optional-plugins/_index.en.md | 2 ++ .../yaml-config/data-source.cn.md | 2 +- .../yaml-config/data-source.en.md | 2 +- .../config/ProxyConfigurationLoaderTest.java | 9 ++++----- .../conf/config_loader/config-encrypt.yaml | 6 +----- .../test/resources/conf/convert/config-encrypt.yaml | 8 ++------ .../src/test/resources/conf/convert/config-mix.yaml | 13 ++----------- .../test/resources/expected/convert-encrypt.yaml | 4 ++-- .../src/test/resources/expected/convert-mix.yaml | 4 ++-- .../src/main/resources/conf/config-encrypt.yaml | 12 ++---------- 21 files changed, 40 insertions(+), 60 deletions(-) diff --git a/docs/document/content/reference/management/_index.cn.md b/docs/document/content/reference/management/_index.cn.md index 682acfb14bcf8..8b10b03626960 100644 --- a/docs/document/content/reference/management/_index.cn.md +++ b/docs/document/content/reference/management/_index.cn.md @@ -145,7 +145,7 @@ ds_0: ``` ### /metadata/${databaseName}/data_sources/nodes/ds_0/versions/0 -数据库连接池的,不同数据库连接池属性自适配(例如:DBCP,C3P0,Druid,HikariCP)。 +数据库连接池的,不同数据库连接池属性自适配(例如:HikariCP)。 ```yaml ds_0: diff --git a/docs/document/content/reference/management/_index.en.md b/docs/document/content/reference/management/_index.en.md index f8076c5da9f81..b3ca2876ccd8a 100644 --- a/docs/document/content/reference/management/_index.en.md +++ b/docs/document/content/reference/management/_index.en.md @@ -125,7 +125,7 @@ sql-show: true ### /metadata/${databaseName}/data_sources/units/ds_0/versions/0 -Database connection pools, whose properties (e.g. DBCP, C3P0, Druid and HikariCP) are to be configured by the user. +Database connection pools, whose properties (e.g. HikariCP) are to be configured by the user. ```yaml ds_0: @@ -146,7 +146,7 @@ ds_0: ### /metadata/${databaseName}/data_sources/nodes/ds_0/versions/0 -Database connection pools, whose properties (e.g. DBCP, C3P0, Druid and HikariCP) are to be configured by the user. +Database connection pools, whose properties (e.g. HikariCP) are to be configured by the user. ```yaml ds_0: diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/_index.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/_index.cn.md index be62924a0bd7b..0dff524ac5a8a 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/_index.cn.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/_index.cn.md @@ -14,7 +14,6 @@ ShardingSphere 默认情况下仅包含核心 SPI 的实现,在 Git Source 存 - `org.apache.shardingsphere:shardingsphere-cluster-mode-core`,集群模式配置信息持久化定义核心 - `org.apache.shardingsphere:shardingsphere-db-discovery-core`,高可用核心 - `org.apache.shardingsphere:shardingsphere-encrypt-core`,数据加密核心 -- `org.apache.shardingsphere:shardingsphere-encrypt-sm`, SM 加密算法 - `org.apache.shardingsphere:shardingsphere-infra-context`, Context 的内核运行与元数据刷新机制 - `org.apache.shardingsphere:shardingsphere-logging-core`,日志记录核心 - `org.apache.shardingsphere:shardingsphere-mask-core`,数据脱敏核心 @@ -51,3 +50,5 @@ ShardingSphere 默认情况下仅包含核心 SPI 的实现,在 Git Source 存 - `org.apache.shardingsphere:shardingsphere-transaction-xa-narayana`,基于 Narayana 的 XA 分布式事务管理器 - SQL 翻译 - `org.apache.shardingsphere:shardingsphere-sql-translator-jooq-provider`,使用 JooQ 的 SQL 翻译器 + +除了以上可选插件外,ShardingSphere 社区开发者还贡献了大量的插件实现,可以在 [ShardingSphere Plugin](https://github.com/apache/shardingsphere-plugin) 仓库中查看插件的使用说明,ShardingSphere Plugin 仓库中的插件会和 ShardingSphere 保持相同的发布节奏,可以在 https://central.sonatype.com/ 进行检索,并安装到 ShardingSphere 中。 diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/_index.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/_index.en.md index ddae142a7b5ce..d9835bf49e5fa 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/_index.en.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/_index.en.md @@ -14,7 +14,6 @@ All the built-in plugins for ShardingSphere-JDBC are listed below in the form of - `org.apache.shardingsphere:shardingsphere-cluster-mode-core`, the persistent definition core of cluster mode configuration information - `org.apache.shardingsphere:shardingsphere-db-discovery-core`, high availability core - `org.apache.shardingsphere:shardingsphere-encrypt-core`, data encryption core -- `org.apache.shardingsphere:shardingsphere-encrypt-sm`, the SM encrypt algorithm. - `org.apache.shardingsphere:shardingsphere-infra-context`, the kernel operation and metadata refresh mechanism of Context - `org.apache.shardingsphere:shardingsphere-logging-core`, logging core - `org.apache.shardingsphere:shardingsphere-mask-core`, data masking core @@ -51,3 +50,5 @@ All optional plugins are listed below in the form of `groupId:artifactId`. - `org.apache.shardingsphere:shardingsphere-transaction-xa-narayana`, XA distributed transaction manager based on Narayana - SQL translator - `org.apache.shardingsphere:shardingsphere-sql-translator-jooq-provider`, JooQ SQL translator + +In addition to the above optional plugins, ShardingSphere community developers have contributed a number of plugin implementations. These plugins can be found in [ShardingSphere Plugins] (https://github.com/apache/shardingsphere-plugin) repository. Plugins in ShardingSphere Plugin repository would remain the same release plan with ShardingSphere, they can be retrieved at https://central.sonatype.com/, and install into ShardingSphere. 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 5983b73914cb9..b2004759e79f2 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 @@ -77,7 +77,7 @@ 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')))) +(NAME=order_id,CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )); ``` 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 89f22f3cf7a58..69826b334ea42 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 @@ -76,7 +76,7 @@ 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')))) +(NAME=order_id,CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )); ``` 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 837c220105632..3a0bdaff718af 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 @@ -81,12 +81,12 @@ 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')))) +(NAME=order_id, CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))))) )), t_encrypt_2 ( 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')))) +(NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )); ``` @@ -96,12 +96,12 @@ COLUMNS( 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')))) +(NAME=order_id, CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )), t_encrypt_2 ( 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')))) +(NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )); ``` 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 4128ed78ea4bb..62d67492c0fcf 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 @@ -81,12 +81,12 @@ 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')))) +(NAME=order_id, CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )), t_encrypt_2 ( 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')))) +(NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )); ``` @@ -96,12 +96,12 @@ COLUMNS( 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')))) +(NAME=order_id, CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )), t_encrypt_2 ( 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')))) +(NAME=order_id, CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )); ``` 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 67d03e5b9ecb4..71d2701c0c0b1 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 @@ -23,7 +23,7 @@ REGISTER STORAGE UNIT ds_0 ( 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')))) + (NAME=order_id,CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )); ``` 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 fa2af95f53251..4c9a5ca3daa63 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 @@ -23,7 +23,7 @@ REGISTER STORAGE UNIT ds_0 ( 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')))) + (NAME=order_id,CIPHER =order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))) )); ``` diff --git a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.cn.md index 7ebe065776752..f3ce36b58a3f0 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.cn.md @@ -38,3 +38,5 @@ ShardingSphere 默认情况下仅包含核心 SPI 的实现,在 Git Source 存 - `org.apache.shardingsphere:shardingsphere-transaction-xa-narayana`,基于 Narayana 的 XA 分布式事务管理器 - SQL 翻译 - `org.apache.shardingsphere:shardingsphere-sql-translator-jooq-provider`,使用 JooQ 的 SQL 翻译器 + +除了以上可选插件外,ShardingSphere 社区开发者还贡献了大量的插件实现,可以在 [ShardingSphere Plugin](https://github.com/apache/shardingsphere-plugin) 仓库中查看插件的使用说明,ShardingSphere Plugin 仓库中的插件会和 ShardingSphere 保持相同的发布节奏,可以在 https://central.sonatype.com/ 进行检索,并安装到 ShardingSphere 中。 diff --git a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.en.md index f2d85e42cdceb..39fcf767b15f8 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/_index.en.md @@ -38,3 +38,5 @@ All optional plugins are listed below in the form of `groupId:artifactId`. - `org.apache.shardingsphere:shardingsphere-transaction-xa-narayana`, XA distributed transaction manager based on Narayana - SQL translator - `org.apache.shardingsphere:shardingsphere-sql-translator-jooq-provider`, JooQ SQL translator + +In addition to the above optional plugins, ShardingSphere community developers have contributed a number of plugin implementations. These plugins can be found in [ShardingSphere Plugins] (https://github.com/apache/shardingsphere-plugin) repository. Plugins in ShardingSphere Plugin repository would remain the same release plan with ShardingSphere, they can be retrieved at https://central.sonatype.com/, and install into ShardingSphere. diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md index 51cc806077fbe..89876a48539b3 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md @@ -6,7 +6,7 @@ chapter = true ## 背景信息 -ShardingSphere-Proxy 支持常见的数据库连接池: HikariCP、C3P0、DBCP。 +ShardingSphere-Proxy 支持常见的数据库连接池: HikariCP、C3P0、DBCP(C3P0、DBCP 需要从 [shardingsphere-plugin](https://github.com/apache/shardingsphere-plugin) 仓库获取插件)。 可以通过参数 `dataSourceClassName` 指定连接池,当不指定时,默认的的数据库连接池为 HikariCP。 diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md index 0f44b8507578b..22d15576b2a17 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md @@ -6,7 +6,7 @@ chapter = true ## Background -ShardingSphere-Proxy supports common data source connection pools: HikariCP, C3P0, DBCP. +ShardingSphere-Proxy supports common data source connection pools: HikariCP, C3P0, DBCP (C3P0, DBCP need download plugin from [shardingsphere-plugins](https://github.com/apache/shardingsphere-plugin) repository). The connection pool can be specified through the parameter `dataSourceClassName`. When not specified, the default data source connection pool is HikariCP. diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/ProxyConfigurationLoaderTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/ProxyConfigurationLoaderTest.java index 5e6027269f989..f770094f7290c 100644 --- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/ProxyConfigurationLoaderTest.java +++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/ProxyConfigurationLoaderTest.java @@ -125,15 +125,14 @@ private void assertEncryptRuleConfiguration(final YamlProxyDatabaseConfiguration } private void assertEncryptRuleConfiguration(final YamlEncryptRuleConfiguration actual) { - assertThat(actual.getEncryptors().size(), is(2)); + assertThat(actual.getEncryptors().size(), is(1)); assertTrue(actual.getEncryptors().containsKey("aes_encryptor")); - assertTrue(actual.getEncryptors().containsKey("rc4_encryptor")); YamlAlgorithmConfiguration aesEncryptAlgorithmConfig = actual.getEncryptors().get("aes_encryptor"); assertThat(aesEncryptAlgorithmConfig.getType(), is("AES")); assertThat(aesEncryptAlgorithmConfig.getProps().getProperty("aes-key-value"), is("123456abc")); - YamlAlgorithmConfiguration md5EncryptAlgorithmConfig = actual.getEncryptors().get("rc4_encryptor"); - assertThat(md5EncryptAlgorithmConfig.getType(), is("RC4")); - assertThat(md5EncryptAlgorithmConfig.getProps().getProperty("rc4-key-value"), is("123456abc")); + YamlAlgorithmConfiguration md5EncryptAlgorithmConfig = actual.getEncryptors().get("aes_encryptor"); + assertThat(md5EncryptAlgorithmConfig.getType(), is("AES")); + assertThat(md5EncryptAlgorithmConfig.getProps().getProperty("aes-key-value"), is("123456abc")); } private void assertDataSourceConfiguration(final YamlProxyDataSourceConfiguration actual, final String expectedURL) { diff --git a/proxy/backend/core/src/test/resources/conf/config_loader/config-encrypt.yaml b/proxy/backend/core/src/test/resources/conf/config_loader/config-encrypt.yaml index 176e4efb331cc..b039f42205b36 100644 --- a/proxy/backend/core/src/test/resources/conf/config_loader/config-encrypt.yaml +++ b/proxy/backend/core/src/test/resources/conf/config_loader/config-encrypt.yaml @@ -40,13 +40,9 @@ rules: name: cipher: name: name - encryptorName: rc4_encryptor + encryptorName: aes_encryptor encryptors: aes_encryptor: type: AES props: aes-key-value: 123456abc - rc4_encryptor: - type: RC4 - props: - rc4-key-value: 123456abc diff --git a/proxy/backend/core/src/test/resources/conf/convert/config-encrypt.yaml b/proxy/backend/core/src/test/resources/conf/convert/config-encrypt.yaml index ab59b37693a56..d8cddaa74b989 100644 --- a/proxy/backend/core/src/test/resources/conf/convert/config-encrypt.yaml +++ b/proxy/backend/core/src/test/resources/conf/convert/config-encrypt.yaml @@ -44,10 +44,6 @@ rules: type: AES props: aes-key-value: 123456abc - rc4_encryptor: - type: RC4 - props: - rc4-key-value: 123456abc like_encryptor: type: CORE.QUERY_LIKE.FIXTURE tables: @@ -59,11 +55,11 @@ rules: encryptorName: aes_encryptor assistedQuery: name: user_assisted - encryptorName: rc4_encryptor + encryptorName: aes_encryptor likeQuery: name: user_like encryptorName: like_encryptor order_id: cipher: name: order_cipher - encryptorName: rc4_encryptor + encryptorName: aes_encryptor diff --git a/proxy/backend/core/src/test/resources/conf/convert/config-mix.yaml b/proxy/backend/core/src/test/resources/conf/convert/config-mix.yaml index 8999c74c0bea2..8e72891447541 100644 --- a/proxy/backend/core/src/test/resources/conf/convert/config-mix.yaml +++ b/proxy/backend/core/src/test/resources/conf/convert/config-mix.yaml @@ -128,12 +128,6 @@ rules: type: AES props: aes-key-value: 123456abc - rc4_encryptor: - type: RC4 - props: - rc4-key-value: 123456abc - like_encryptor: - type: CHAR_DIGEST_LIKE tables: t_encrypt: columns: @@ -143,11 +137,8 @@ rules: encryptorName: aes_encryptor assistedQuery: name: user_assisted - encryptorName: rc4_encryptor - likeQuery: - name: user_like - encryptorName: like_encryptor + encryptorName: aes_encryptor order_id: cipher: name: order_cipher - encryptorName: rc4_encryptor + encryptorName: aes_encryptor diff --git a/proxy/backend/core/src/test/resources/expected/convert-encrypt.yaml b/proxy/backend/core/src/test/resources/expected/convert-encrypt.yaml index 54ea9b0474e81..40e3b4c7c8859 100644 --- a/proxy/backend/core/src/test/resources/expected/convert-encrypt.yaml +++ b/proxy/backend/core/src/test/resources/expected/convert-encrypt.yaml @@ -31,6 +31,6 @@ PROPERTIES('minPoolSize'='1', 'connectionTimeoutMilliseconds'='30000', 'maxLifet CREATE ENCRYPT RULE t_encrypt ( COLUMNS( -(NAME=user_id, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, LIKE_QUERY_COLUMN=user_like, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='rc4', PROPERTIES('rc4-key-value'='123456abc'))), LIKE_QUERY_ALGORITHM(TYPE(NAME='core.query_like.fixture'))), -(NAME=order_id, CIPHER=order_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='rc4', PROPERTIES('rc4-key-value'='123456abc')))) +(NAME=user_id, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, LIKE_QUERY_COLUMN=user_like, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), LIKE_QUERY_ALGORITHM(TYPE(NAME='core.query_like.fixture'))), +(NAME=order_id, CIPHER=order_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc')))) )); diff --git a/proxy/backend/core/src/test/resources/expected/convert-mix.yaml b/proxy/backend/core/src/test/resources/expected/convert-mix.yaml index 4d8fece6d3b8d..9f0a92fae5da9 100644 --- a/proxy/backend/core/src/test/resources/expected/convert-mix.yaml +++ b/proxy/backend/core/src/test/resources/expected/convert-mix.yaml @@ -63,8 +63,8 @@ TYPE(NAME='random') CREATE ENCRYPT RULE t_encrypt ( COLUMNS( -(NAME=user_id, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, LIKE_QUERY_COLUMN=user_like, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='rc4', PROPERTIES('rc4-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')))) +(NAME=user_id, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_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')))) )); CREATE SHARDING TABLE RULE t_order ( diff --git a/proxy/bootstrap/src/main/resources/conf/config-encrypt.yaml b/proxy/bootstrap/src/main/resources/conf/config-encrypt.yaml index 8c555520681ec..962a84f16e102 100644 --- a/proxy/bootstrap/src/main/resources/conf/config-encrypt.yaml +++ b/proxy/bootstrap/src/main/resources/conf/config-encrypt.yaml @@ -51,10 +51,6 @@ # type: AES # props: # aes-key-value: 123456abc -# rc4_encryptor: -# type: RC4 -# props: -# rc4-key-value: 123456abc # tables: # t_encrypt: # columns: @@ -65,7 +61,7 @@ # order_id: # cipher: # name: order_encrypt -# encryptorName: rc4_encryptor +# encryptorName: aes_encryptor ###################################################################################################### # @@ -102,10 +98,6 @@ # type: AES # props: # aes-key-value: 123456abc -# rc4_encryptor: -# type: RC4 -# props: -# rc4-key-value: 123456abc # tables: # t_encrypt: # columns: @@ -116,4 +108,4 @@ # order_id: # cipher: # name: order_encrypt -# encryptorName: rc4_encryptor +# encryptorName: aes_encryptor