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 2023/02/10 14:18:38 UTC

[shardingsphere] branch master updated: Remove useless ShardingSphereUser.auth (#24109)

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 0e394419c35 Remove useless ShardingSphereUser.auth (#24109)
0e394419c35 is described below

commit 0e394419c3559b393e3f25835f2c07d3ae044288
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Feb 10 22:18:27 2023 +0800

    Remove useless ShardingSphereUser.auth (#24109)
---
 .../shardingsphere/infra/metadata/user/ShardingSphereUser.java   | 9 ---------
 .../infra/metadata/user/yaml/config/YamlUserConfiguration.java   | 2 --
 .../infra/metadata/user/yaml/swapper/YamlUserSwapper.java        | 3 +--
 3 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/ShardingSphereUser.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/ShardingSphereUser.java
index 9f047a384c9..4b857b3ba5d 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/ShardingSphereUser.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/ShardingSphereUser.java
@@ -31,17 +31,8 @@ public final class ShardingSphereUser {
     
     private final String password;
     
-    private final String auth;
-    
     public ShardingSphereUser(final String username, final String password, final String hostname) {
         grantee = new Grantee(username, hostname);
         this.password = password;
-        this.auth = null;
-    }
-    
-    public ShardingSphereUser(final String username, final String password, final String hostname, final String auth) {
-        grantee = new Grantee(username, hostname);
-        this.password = password;
-        this.auth = auth;
     }
 }
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/config/YamlUserConfiguration.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/config/YamlUserConfiguration.java
index afbcf04fe4b..47518666d8f 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/config/YamlUserConfiguration.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/config/YamlUserConfiguration.java
@@ -32,8 +32,6 @@ public final class YamlUserConfiguration implements YamlConfiguration {
     
     private String password;
     
-    private String auth;
-    
     @Override
     public String toString() {
         return user.contains("@") ? user + ":" + password : user + "@%:" + password;
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/swapper/YamlUserSwapper.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/swapper/YamlUserSwapper.java
index a0b97d019af..d615119822d 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/swapper/YamlUserSwapper.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/swapper/YamlUserSwapper.java
@@ -39,7 +39,6 @@ public final class YamlUserSwapper implements YamlConfigurationSwapper<YamlUserC
         YamlUserConfiguration result = new YamlUserConfiguration();
         result.setUser(data.getGrantee().toString());
         result.setPassword(data.getPassword());
-        result.setAuth(data.getAuth());
         return result;
     }
     
@@ -49,7 +48,7 @@ public final class YamlUserSwapper implements YamlConfigurationSwapper<YamlUserC
             return null;
         }
         Grantee grantee = convertYamlUserToGrantee(yamlConfig.getUser());
-        return new ShardingSphereUser(grantee.getUsername(), yamlConfig.getPassword(), grantee.getHostname(), yamlConfig.getAuth());
+        return new ShardingSphereUser(grantee.getUsername(), yamlConfig.getPassword(), grantee.getHostname());
     }
     
     private Grantee convertYamlUserToGrantee(final String yamlUser) {