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 2022/11/26 09:10:19 UTC
[shardingsphere] branch master updated: Update yaml-config rules on encrypt document (#22436)
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 153906668df Update yaml-config rules on encrypt document (#22436)
153906668df is described below
commit 153906668df5023f1437a686c18f453544c2d2fe
Author: gxxiong <xi...@foxmail.com>
AuthorDate: Sat Nov 26 17:10:10 2022 +0800
Update yaml-config rules on encrypt document (#22436)
Signed-off-by: gxxiong <xi...@foxmail.com>
Signed-off-by: gxxiong <xi...@foxmail.com>
---
.../yaml-config/rules/encrypt.cn.md | 27 +++++++++++++++++-----
.../yaml-config/rules/encrypt.en.md | 27 +++++++++++++++++-----
.../yaml-config/rules/mix.cn.md | 21 ++++++++++++-----
.../yaml-config/rules/mix.en.md | 23 ++++++++++++------
4 files changed, 73 insertions(+), 25 deletions(-)
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.cn.md
index 9a01c3ab116..1065987deaf 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.cn.md
@@ -16,10 +16,13 @@ rules:
<table-name> (+): # 加密表名称
columns:
<column-name> (+): # 加密列名称
+ plainColumn (?): # 原文列名称
cipherColumn: # 密文列名称
+ encryptorName: # 密文列加密算法名称
assistedQueryColumn (?): # 查询辅助列名称
- plainColumn (?): # 原文列名称
- encryptorName: # 加密算法名称
+ assistedQueryEncryptorName: # 查询辅助列加密算法名称
+ likeQueryColumn (?): # 模糊查询列名称
+ likeQueryEncryptorName: # 模糊查询列加密算法名称
queryWithCipherColumn(?): # 该表是否使用加密列进行查询
# 加密算法配置
@@ -60,18 +63,30 @@ rules:
username:
plainColumn: username_plain
cipherColumn: username
- encryptorName: name-encryptor
+ encryptorName: name_encryptor
+ assistedQueryColumn: assisted_query_username
+ assistedQueryEncryptorName: assisted_encryptor
+ likeQueryColumn: like_query_username
+ likeQueryEncryptorName: like_encryptor
pwd:
cipherColumn: pwd
- assistedQueryColumn: assisted_query_pwd
encryptorName: pwd_encryptor
+ assistedQueryColumn: assisted_query_pwd
+ assistedQueryEncryptorName: assisted_encryptor
+ queryWithCipherColumn: true
encryptors:
- name-encryptor:
+ name_encryptor:
+ type: AES
+ props:
+ aes-key-value: 123456abc
+ assisted_encryptor:
type: AES
props:
aes-key-value: 123456abc
+ like_encryptor:
+ type: CHAR_DIGEST_LIKE
pwd_encryptor:
- type: assistedTest
+ type: MD5
```
然后通过 YamlShardingSphereDataSourceFactory 的 createDataSource 方法创建数据源。
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.en.md
index 82144b0e163..f86f35d6b4e 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.en.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/encrypt.en.md
@@ -17,10 +17,13 @@ rules:
<table-name> (+): # Encrypt table name
columns:
<column-name> (+): # Encrypt logic column name
+ plainColumn (?): # Plain column name
cipherColumn: # Cipher column name
+ encryptorName: # Cipher encrypt algorithm name
assistedQueryColumn (?): # Assisted query column name
- plainColumn (?): # Plain column name
- encryptorName: # Encrypt algorithm name
+ assistedQueryEncryptorName: # Assisted query encrypt algorithm name
+ likeQueryColumn (?): # Like query column name
+ likeQueryEncryptorName: # Like query encrypt algorithm name
queryWithCipherColumn(?): # The current table whether query with cipher column for data encrypt.
# Encrypt algorithm configuration
@@ -61,18 +64,30 @@ rules:
username:
plainColumn: username_plain
cipherColumn: username
- encryptorName: name-encryptor
+ encryptorName: name_encryptor
+ assistedQueryColumn: assisted_query_username
+ assistedQueryEncryptorName: assisted_encryptor
+ likeQueryColumn: like_query_username
+ likeQueryEncryptorName: like_encryptor
pwd:
cipherColumn: pwd
- assistedQueryColumn: assisted_query_pwd
encryptorName: pwd_encryptor
+ assistedQueryColumn: assisted_query_pwd
+ assistedQueryEncryptorName: assisted_encryptor
+ queryWithCipherColumn: true
encryptors:
- name-encryptor:
+ name_encryptor:
+ type: AES
+ props:
+ aes-key-value: 123456abc
+ assisted_encryptor:
type: AES
props:
aes-key-value: 123456abc
+ like_encryptor:
+ type: CHAR_DIGEST_LIKE
pwd_encryptor:
- type: assistedTest
+ type: MD5
```
Read the YAML configuration to create a data source according to the createDataSource method of YamlShardingSphereDataSourceFactory.
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/mix.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/mix.cn.md
index e1e9ac9b539..bf51869ac98 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/mix.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/mix.cn.md
@@ -82,13 +82,15 @@ rules:
tables:
<table-name>: # 加密表名称
columns:
- <column-name>: # 加密列名称
- plainColumn: # 原文列名称
+ <column-name> (+): # 加密列名称
+ plainColumn (?): # 原文列名称
cipherColumn: # 密文列名称
- encryptorName: # 加密算法名称
- <column-name>: # 加密列名称
- cipherColumn: # 密文列名称
- encryptorName: # 加密算法名称
+ encryptorName: # 密文列加密算法名称
+ assistedQueryColumn (?): # 查询辅助列名称
+ assistedQueryEncryptorName: # 查询辅助列加密算法名称
+ likeQueryColumn (?): # 模糊查询列名称
+ likeQueryEncryptorName: # 模糊查询列加密算法名称
+ queryWithCipherColumn(?): # 该表是否使用加密列进行查询
```
## 配置示例
@@ -167,6 +169,8 @@ rules:
aes-key-value: 123456abc
md5_encryptor:
type: MD5
+ like_encryptor:
+ type: CHAR_DIGEST_LIKE
tables:
t_encrypt:
columns:
@@ -174,7 +178,12 @@ rules:
plainColumn: user_plain
cipherColumn: user_cipher
encryptorName: aes_encryptor
+ assistedQueryColumn: assisted_query_user
+ assistedQueryEncryptorName: aes_encryptor
+ likeQueryColumn: like_query_user
+ likeQueryEncryptorName: like_encryptor
order_id:
cipherColumn: order_cipher
encryptorName: md5_encryptor
+ queryWithCipherColumn: true
```
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/mix.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/mix.en.md
index 3efcb911121..c980400316e 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/mix.en.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/mix.en.md
@@ -83,13 +83,15 @@ rules:
tables:
<table-name>: # Encryption table name
columns:
- <column-name>: # Encryption name
- plainColumn: # Plaincolumn name
- cipherColumn: # Ciphercolumn name
- encryptorName: # Encryption algorithm name
- <column-name>: # Encryption column name
- cipherColumn: # Ciphercolumn name
- encryptorName: # Encryption algorithm name
+ <column-name> (+): # Encrypt logic column name
+ plainColumn (?): # Plain column name
+ cipherColumn: # Cipher column name
+ encryptorName: # Cipher encrypt algorithm name
+ assistedQueryColumn (?): # Assisted query column name
+ assistedQueryEncryptorName: # Assisted query encrypt algorithm name
+ likeQueryColumn (?): # Like query column name
+ likeQueryEncryptorName: # Like query encrypt algorithm name
+ queryWithCipherColumn(?): # The current table whether query with cipher column for data encrypt.
```
## Samples
@@ -168,6 +170,8 @@ rules:
aes-key-value: 123456abc
md5_encryptor:
type: MD5
+ like_encryptor:
+ type: CHAR_DIGEST_LIKE
tables:
t_encrypt:
columns:
@@ -175,7 +179,12 @@ rules:
plainColumn: user_plain
cipherColumn: user_cipher
encryptorName: aes_encryptor
+ assistedQueryColumn: assisted_query_user
+ assistedQueryEncryptorName: aes_encryptor
+ likeQueryColumn: like_query_user
+ likeQueryEncryptorName: like_encryptor
order_id:
cipherColumn: order_cipher
encryptorName: md5_encryptor
+ queryWithCipherColumn: true
```