Skip to content

Commit

Permalink
Remove useless rc4 config and update document for shardingsphere plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
strongduanmu committed Sep 26, 2023
1 parent 898dcc9 commit 308baa6
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 60 deletions.
2 changes: 1 addition & 1 deletion docs/document/content/reference/management/_index.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ ds_0:
```
### /metadata/${databaseName}/data_sources/nodes/ds_0/versions/0
数据库连接池的,不同数据库连接池属性自适配(例如:DBCP,C3P0,Druid,HikariCP)。
数据库连接池的,不同数据库连接池属性自适配(例如:HikariCP)。
```yaml
ds_0:
Expand Down
4 changes: 2 additions & 2 deletions docs/document/content/reference/management/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`,数据脱敏核心
Expand Down Expand Up @@ -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 中。
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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'))))
));
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'))))
));
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'))))
));
```

Expand All @@ -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'))))
));
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'))))
));
```

Expand All @@ -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'))))
));
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'))))
));
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'))))
));
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 中。
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
13 changes: 2 additions & 11 deletions proxy/backend/core/src/test/resources/conf/convert/config-mix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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'))))
));
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
12 changes: 2 additions & 10 deletions proxy/bootstrap/src/main/resources/conf/config-encrypt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
# type: AES
# props:
# aes-key-value: 123456abc
# rc4_encryptor:
# type: RC4
# props:
# rc4-key-value: 123456abc
# tables:
# t_encrypt:
# columns:
Expand All @@ -65,7 +61,7 @@
# order_id:
# cipher:
# name: order_encrypt
# encryptorName: rc4_encryptor
# encryptorName: aes_encryptor

######################################################################################################
#
Expand Down Expand Up @@ -102,10 +98,6 @@
# type: AES
# props:
# aes-key-value: 123456abc
# rc4_encryptor:
# type: RC4
# props:
# rc4-key-value: 123456abc
# tables:
# t_encrypt:
# columns:
Expand All @@ -116,4 +108,4 @@
# order_id:
# cipher:
# name: order_encrypt
# encryptorName: rc4_encryptor
# encryptorName: aes_encryptor

0 comments on commit 308baa6

Please sign in to comment.