You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/02/14 07:20:11 UTC

[GitHub] [shardingsphere] tristaZero opened a new issue #9416: [Enhancement] Authentication for the hostname with % instead of an empty string

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


   Hi community,
   
   ShardingSphere new release will have a powerful authentication feature, which will have user, hostname, password and schema authentication.
   
   **This issue is to improve `user@hostname` authentication**. 
   
   ### Background
   Suppose the hostname is a specific value, SS can use this value for checking.  While SS still allows users from any hosts,  what's the value of hostname?
   The current answer is an empty string of `hostname`. 
   This issue aims at using `%` for the above situation instead of an empty string to stay consistent with schema authentication.
   
   ### How
   
   #### Loading part
   - Add `ALL_HOST_NAME("%")` into `PrivilegeType`
   - Check pattern of `user@hostname` (Specially hostname is %  or null) in `swapToObject` of `UserRuleYamlSwapper`
   
   #### Checking part
   - `new Grantee(username, ALL_HOST_NAME.name)` in `PostgreSQLAuthenticationHandler`
   - Modify `equals()` and `hashcode()` `Grantee` to check `%` for unlimited hotnames
   
   #### Tests
   - Add a unit test for `Grantee`
   - Start ShardingProxy with MySQL or PostgreSQL to check whether this function runs well with the following configuration in `server.yaml`
   ```yaml
   authentication:
     users:
       root:
         password: root
         hostname: %
       sharding:
         password: sharding
         hostname: 127.0.0.1
   ```
   
   ### Notice
   - This issue is related with #9326 , which will affect the configuration format.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #9416: [Enhancement] Authentication for the hostname with % instead of an empty string

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #9416:
URL: https://github.com/apache/shardingsphere/issues/9416#issuecomment-784091246


   This issue was fixed by @lmhmhl in #9470


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero closed issue #9416: [Enhancement] Authentication for the hostname with % instead of an empty string

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #9416:
URL: https://github.com/apache/shardingsphere/issues/9416


   


----------------------------------------------------------------
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:
users@infra.apache.org