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 2019/09/22 15:02:16 UTC
[GitHub] [incubator-shardingsphere] sunbufu commented on a change in pull
request #3079: Fixes #3068 Add a judgment for user's database privileges.
sunbufu commented on a change in pull request #3079: Fixes #3068 Add a judgment for user's database privileges.
URL: https://github.com/apache/incubator-shardingsphere/pull/3079#discussion_r326905471
##########
File path: sharding-proxy/sharding-proxy-frontend/sharding-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/frontend/mysql/auth/MySQLAuthenticationEngine.java
##########
@@ -54,20 +56,31 @@ public void handshake(final ChannelHandlerContext context, final BackendConnecti
@Override
public boolean auth(final ChannelHandlerContext context, final PacketPayload payload, final BackendConnection backendConnection) {
MySQLHandshakeResponse41Packet response41 = new MySQLHandshakeResponse41Packet((MySQLPacketPayload) payload);
- if (authenticationHandler.login(response41.getUsername(), response41.getAuthResponse())) {
- if (!Strings.isNullOrEmpty(response41.getDatabase()) && !LogicSchemas.getInstance().schemaExists(response41.getDatabase())) {
+ final Optional<ProxyUser> user = authenticationHandler.login(response41.getUsername(), response41.getAuthResponse());
+ if (!user.isPresent()) {
Review comment:
OK 👍
----------------------------------------------------------------
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
With regards,
Apache Git Services