You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/01/02 08:54:24 UTC

[shardingsphere] branch master updated: Improve yaml config document of Proxy. (#14481)

This is an automated email from the ASF dual-hosted git repository.

panjuan 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 d61dddb  Improve yaml config document of Proxy. (#14481)
d61dddb is described below

commit d61dddb505201e7798f06db18fb3e3bb3275304b
Author: Raigor <ra...@gmail.com>
AuthorDate: Sun Jan 2 16:53:41 2022 +0800

    Improve yaml config document of Proxy. (#14481)
---
 .../yaml-config/authentication.cn.md               | 24 +++++++++++++++++++---
 .../yaml-config/authentication.en.md               | 24 +++++++++++++++++++---
 .../{ => yaml-config}/props.cn.md                  |  2 +-
 .../{ => yaml-config}/props.en.md                  |  2 +-
 4 files changed, 44 insertions(+), 8 deletions(-)

diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/authentication.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/authentication.cn.md
index b3f90c4..6704f92 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/authentication.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/authentication.cn.md
@@ -13,19 +13,37 @@ rules:
     users:
       - # 用于登录计算节点的用户名,授权主机和密码的组合。格式:<username>@<hostname>:<password>,hostname 为 % 或空字符串表示不限制授权主机
     provider:
-      type: # 存储节点数据授权的权限提供者类型
+      type: # 存储节点数据授权的权限提供者类型,缺省值为 ALL_PRIVILEGES_PERMITTED
 ```
 
 ## 配置示例
 
+### ALL_PRIVILEGES_PERMITTED
 ```yaml
 rules:
   - !AUTHORITY
     users:
       - root@localhost:root
-      - my_user@pwd
+      - my_user@:pwd
     provider:
-      type: FOO_AUTHORITY_PROVIDER
+      type: ALL_PRIVILEGES_PERMITTED
 ```
 
+### SCHEMA_PRIVILEGES_PERMITTED
+```yaml
+rules:
+  - !AUTHORITY
+    users:
+      - root@:root
+      - my_user@:pwd
+    provider:
+      type: SCHEMA_PRIVILEGES_PERMITTED
+      props:
+        user-schema-mappings: root@=sharding_db, root@=test_db, my_user@127.0.0.1=sharding_db
+```
+以上配置表示:
+- root 用户从任意主机连接时,可访问 `sharding_db`
+- root 用户从任意主机连接时,可访问 `test_db` 
+- my_user 用户仅当从 127.0.0.1 连接时,可访问 `sharding_db`
+
 权限提供者具体实现可以参考 [权限提供者](/cn/dev-manual/proxy)。
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/authentication.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/authentication.en.md
index c8b4da5..b17a25c 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/authentication.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/authentication.en.md
@@ -13,19 +13,37 @@ rules:
     users:
       - # Username, authorized host and password for compute node. Format: <username>@<hostname>:<password>, hostname is % or empty string means do not care about authorized host
     provider:
-      type: # authority provider for storage node
+      type: # authority provider for storage node, the default value is ALL_PRIVILEGES_PERMITTED
 ```
 
 ## Example
 
+### ALL_PRIVILEGES_PERMITTED
 ```yaml
 rules:
   - !AUTHORITY
     users:
       - root@localhost:root
-      - my_user@pwd
+      - my_user@:pwd
     provider:
-      type: FOO_AUTHORITY_PROVIDER
+      type: ALL_PRIVILEGES_PERMITTED
 ```
 
+### SCHEMA_PRIVILEGES_PERMITTED
+```yaml
+rules:
+  - !AUTHORITY
+    users:
+      - root@:root
+      - my_user@:pwd
+    provider:
+      type: SCHEMA_PRIVILEGES_PERMITTED
+      props:
+        user-schema-mappings: root@=sharding_db, root@=test_db, my_user@127.0.0.1=sharding_db
+```
+The above configuration means:
+- The user `root` can access `sharding_db` when connecting from any host
+- The user `root` can access `test_db` when connecting from any host
+- The user `my_user` can access `sharding_db` only when connected from 127.0.0.1
+
 Refer to [Authority Provider](/en/dev-manual/proxy) for more implementations.
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/props.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
similarity index 99%
rename from docs/document/content/user-manual/shardingsphere-proxy/props.cn.md
rename to docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
index 705b8f8..493efde 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/props.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
@@ -1,6 +1,6 @@
 +++
 title = "属性配置"
-weight = 4
+weight = 2
 chapter = true
 +++
 
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/props.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
similarity index 99%
rename from docs/document/content/user-manual/shardingsphere-proxy/props.en.md
rename to docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
index 5320895..3a6a947 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/props.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
@@ -1,6 +1,6 @@
 +++
 title = "Properties"
-weight = 4
+weight = 2
 chapter = true
 +++