tristaZero opened a new issue #9326:
URL: https://github.com/apache/shardingsphere/issues/9326


   Hi community,
   
   ShardingProxy will support `create/drop user` and `grant/revoke` SQL in the 
future, which means ShardingProxy is going to have the privileges checking 
capability (#8966). The basic function is similar to [Privileges Provided by 
MySQL](https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html).
   
   This issue is to do API change for `authentication` in `server.yaml` to 
**remain the simple user configuration**.
   
   ### Comparison for current and intending authentication configuration
   ```sql
   // Current one
   authentication:
     users:
       root:
         password: root
       sharding:
         password: sharding 
   
   // Intending one
   users:
     - username@hostname:password
     - [email protected]:root_pwd
   ```
   Each line with `username`, `hostname` and `password` items will be viewed as 
a user record, where key parts are split by `@` and `:`
   
   ### How
   
   There are two main phases for this work, i.e., the change for`local 
configuraion` and `registry configuration`.
   
   ####Local configuration change
   - Replace `authentication` in `YamlProxyServerConfiguration.java` with a 
collection<String>
   - A new util class is expected to transform user records 
(collection<String>) to a collection<YamlUserConfiguration>
   - `UserYamlSwapper` is still needed to transform `YamlUserConfiguration` and 
`ShardingSphereUser`
   - Delete `UserRuleYamlSwapper` and `YamlUserRuleConfiguration`
   - Fix relevant issue in this project caused by your previous changes
   
   #### Registry configuration change
   - Modify `AUTHENTICATION_NODE` to `USERS_NODE` in `ConfigCenterNode`
   - `convertUsers()` is expected to replace `convertAuthentication()`
   - Fix relevant issue in this project caused by your changes above
   
   ### Notices
   - It is not an easy one, so I suggest anyone who wants to have a try to 
firstly read 
[Privileges](https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/configuration/authentication/)
 and 
[Governance](https://shardingsphere.apache.org/document/current/cn/features/governance/management/config-center/)
   - If you have any question, please be free to comment here.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to