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:
[email protected]