You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by su...@apache.org on 2023/02/12 15:52:13 UTC
[shardingsphere] branch master updated: Add AuthenticationMethod (#24131)
This is an automated email from the ASF dual-hosted git repository.
sunnianjun 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 c4412e1cc30 Add AuthenticationMethod (#24131)
c4412e1cc30 is described below
commit c4412e1cc302cbd9b82bf9b40f0f9cbcf9d25be5
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun Feb 12 23:52:06 2023 +0800
Add AuthenticationMethod (#24131)
---
.../protocol/constant/AuthenticationMethod.java} | 22 +++++++++++-----------
.../protocol/{ => constant}/CommonConstants.java | 2 +-
.../db/protocol/netty/ChannelAttrInitializer.java | 2 +-
.../protocol/netty/ChannelAttrInitializerTest.java | 2 +-
.../mysql/codec/MySQLPacketCodecEngine.java | 2 +-
.../mysql/constant/MySQLAuthenticationMethod.java | 13 +++++++------
.../protocol/mysql/constant/MySQLServerInfo.java | 2 +-
.../packet/handshake/MySQLHandshakePacket.java | 2 +-
.../mysql/constant/MySQLServerInfoTest.java | 2 +-
.../packet/handshake/MySQLHandshakePacketTest.java | 8 ++++----
.../MySQLHandshakeResponse41PacketTest.java | 8 ++++----
.../codec/OpenGaussPacketCodecEngine.java | 2 +-
.../codec/PostgreSQLPacketCodecEngine.java | 2 +-
.../constant/PostgreSQLAuthenticationMethod.java | 3 ++-
.../postgresql/constant/PostgreSQLServerInfo.java | 2 +-
.../constant/PostgreSQLServerInfoTest.java | 2 +-
.../netty/MySQLBinlogEventPacketDecoder.java | 2 +-
.../client/netty/MySQLCommandPacketDecoder.java | 2 +-
.../ingest/client/netty/MySQLNegotiateHandler.java | 2 +-
.../client/netty/MySQLNegotiatePackageDecoder.java | 2 +-
.../netty/MySQLBinlogEventPacketDecoderTest.java | 2 +-
.../netty/MySQLCommandPacketDecoderTest.java | 2 +-
.../client/netty/MySQLNegotiateHandlerTest.java | 2 +-
.../netty/MySQLNegotiatePackageDecoderTest.java | 2 +-
.../mysql/executor/MySQLSetCharsetExecutor.java | 2 +-
.../executor/PostgreSQLSetCharsetExecutor.java | 2 +-
.../proxy/version/ShardingSphereProxyVersion.java | 2 +-
.../frontend/command/CommandExecutorTask.java | 2 +-
.../netty/FrontendChannelInboundHandler.java | 2 +-
.../frontend/command/CommandExecutorTaskTest.java | 2 +-
.../authentication/MySQLAuthenticationEngine.java | 2 +-
.../authentication/MySQLAuthenticationHandler.java | 8 ++++----
.../MySQLClearPasswordAuthenticator.java | 2 +-
.../MySQLNativePasswordAuthenticator.java | 2 +-
.../frontend/mysql/MySQLFrontendEngineTest.java | 2 +-
.../MySQLAuthenticationEngineTest.java | 2 +-
.../MySQLAuthenticationHandlerTest.java | 2 +-
.../OpenGaussAuthenticationEngine.java | 2 +-
.../OpenGaussAuthenticationEngineTest.java | 2 +-
.../PostgreSQLAuthenticationEngine.java | 2 +-
.../PostgreSQLAuthenticationEngineTest.java | 2 +-
41 files changed, 67 insertions(+), 65 deletions(-)
diff --git a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethodTest.java b/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/constant/AuthenticationMethod.java
similarity index 66%
rename from db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethodTest.java
rename to db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/constant/AuthenticationMethod.java
index 860b3991007..295a6b399e4 100644
--- a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethodTest.java
+++ b/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/constant/AuthenticationMethod.java
@@ -15,17 +15,17 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.db.protocol.mysql.constant;
+package org.apache.shardingsphere.db.protocol.constant;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-public final class MySQLAuthenticationMethodTest {
+/**
+ * Authentication method.
+ */
+public interface AuthenticationMethod {
- @Test
- public void assertGetMethodName() {
- assertThat(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName(), is("mysql_native_password"));
- }
+ /**
+ * Get authentication method name.
+ *
+ * @return authentication method name
+ */
+ String getMethodName();
}
diff --git a/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/CommonConstants.java b/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/constant/CommonConstants.java
similarity index 95%
rename from db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/CommonConstants.java
rename to db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/constant/CommonConstants.java
index e23d8d76992..ab5ac6248d1 100644
--- a/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/CommonConstants.java
+++ b/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/constant/CommonConstants.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.db.protocol;
+package org.apache.shardingsphere.db.protocol.constant;
import io.netty.util.AttributeKey;
import lombok.AccessLevel;
diff --git a/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/netty/ChannelAttrInitializer.java b/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/netty/ChannelAttrInitializer.java
index 561463f040b..8fa85981fa5 100644
--- a/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/netty/ChannelAttrInitializer.java
+++ b/db-protocol/core/src/main/java/org/apache/shardingsphere/db/protocol/netty/ChannelAttrInitializer.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.db.protocol.netty;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import java.nio.charset.Charset;
diff --git a/db-protocol/core/src/test/java/org/apache/shardingsphere/db/protocol/netty/ChannelAttrInitializerTest.java b/db-protocol/core/src/test/java/org/apache/shardingsphere/db/protocol/netty/ChannelAttrInitializerTest.java
index 796cea51c5a..df6f8d1a840 100644
--- a/db-protocol/core/src/test/java/org/apache/shardingsphere/db/protocol/netty/ChannelAttrInitializerTest.java
+++ b/db-protocol/core/src/test/java/org/apache/shardingsphere/db/protocol/netty/ChannelAttrInitializerTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.db.protocol.netty;
import io.netty.channel.ChannelHandlerContext;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.junit.Test;
import java.nio.charset.Charset;
diff --git a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngine.java b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngine.java
index b1e50337054..0dc9b2797fe 100644
--- a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngine.java
+++ b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngine.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.db.protocol.mysql.codec;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.CompositeByteBuf;
import io.netty.channel.ChannelHandlerContext;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.codec.DatabasePacketCodecEngine;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConstants;
import org.apache.shardingsphere.db.protocol.mysql.packet.MySQLPacket;
diff --git a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethod.java b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethod.java
index a2f234ac385..3aec7fd4636 100644
--- a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethod.java
+++ b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethod.java
@@ -19,23 +19,24 @@ package org.apache.shardingsphere.db.protocol.mysql.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.db.protocol.constant.AuthenticationMethod;
/**
* MySQL client/server protocol authentication method.
*
- * @see <a href="https://dev.mysql.com/doc/internals/en/authentication-method.html">Authentication Method</a>
+ * @see <a href="https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_authentication_methods.html">Authentication Method</a>
*/
@RequiredArgsConstructor
@Getter
-public enum MySQLAuthenticationMethod {
+public enum MySQLAuthenticationMethod implements AuthenticationMethod {
- OLD_PASSWORD_AUTHENTICATION("mysql_old_password"),
+ OLD_PASSWORD("mysql_old_password"),
- SECURE_PASSWORD_AUTHENTICATION("mysql_native_password"),
+ NATIVE("mysql_native_password"),
- CLEAR_TEXT_AUTHENTICATION("mysql_clear_password"),
+ CLEAR_TEXT("mysql_clear_password"),
- WINDOWS_NATIVE_AUTHENTICATION("authentication_windows_client"),
+ WINDOWS_NATIVE("authentication_windows_client"),
SHA256("sha256_password");
diff --git a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLServerInfo.java b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLServerInfo.java
index 5a034a47106..553fddc8d88 100644
--- a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLServerInfo.java
+++ b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLServerInfo.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.db.protocol.mysql.constant;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
diff --git a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakePacket.java b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakePacket.java
index 32c8900d6e4..a4e59ba2857 100644
--- a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakePacket.java
+++ b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakePacket.java
@@ -60,7 +60,7 @@ public final class MySQLHandshakePacket implements MySQLPacket {
statusFlag = MySQLStatusFlag.SERVER_STATUS_AUTOCOMMIT;
capabilityFlagsUpper = MySQLCapabilityFlag.calculateHandshakeCapabilityFlagsUpper();
this.authPluginData = authPluginData;
- authPluginName = MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName();
+ authPluginName = MySQLAuthenticationMethod.NATIVE.getMethodName();
}
public MySQLHandshakePacket(final MySQLPacketPayload payload) {
diff --git a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLServerInfoTest.java b/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLServerInfoTest.java
index 7797a9c4c57..570ade5a17e 100644
--- a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLServerInfoTest.java
+++ b/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLServerInfoTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.db.protocol.mysql.constant;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
diff --git a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakePacketTest.java b/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakePacketTest.java
index a03a778889a..3c8a85358f1 100644
--- a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakePacketTest.java
+++ b/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakePacketTest.java
@@ -65,7 +65,7 @@ public final class MySQLHandshakePacketTest {
@Test
public void assertNewWithClientPluginAuthPayload() {
when(payload.readInt1()).thenReturn(MySQLServerInfo.PROTOCOL_VERSION, MySQLServerInfo.DEFAULT_CHARSET.getId(), 0);
- when(payload.readStringNul()).thenReturn(MySQLServerInfo.getDefaultServerVersion(), MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName());
+ when(payload.readStringNul()).thenReturn(MySQLServerInfo.getDefaultServerVersion(), MySQLAuthenticationMethod.NATIVE.getMethodName());
when(payload.readStringNulByBytes()).thenReturn(part1, part2);
when(payload.readInt4()).thenReturn(1000);
when(payload.readInt2()).thenReturn(
@@ -80,7 +80,7 @@ public final class MySQLHandshakePacketTest {
assertThat(actual.getAuthPluginData().getAuthPluginDataPart1(), is(part1));
assertThat(actual.getAuthPluginData().getAuthPluginDataPart2(), is(part2));
verify(payload).skipReserved(10);
- assertThat(actual.getAuthPluginName(), is(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName()));
+ assertThat(actual.getAuthPluginName(), is(MySQLAuthenticationMethod.NATIVE.getMethodName()));
}
@Test
@@ -104,7 +104,7 @@ public final class MySQLHandshakePacketTest {
public void assertWriteWithClientPluginAuth() {
MySQLAuthPluginData authPluginData = new MySQLAuthPluginData(part1, part2);
MySQLHandshakePacket actual = new MySQLHandshakePacket(1000, authPluginData);
- actual.setAuthPluginName(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION);
+ actual.setAuthPluginName(MySQLAuthenticationMethod.NATIVE);
actual.write(payload);
verify(payload).writeInt1(MySQLServerInfo.PROTOCOL_VERSION);
verify(payload).writeStringNul(MySQLServerInfo.getDefaultServerVersion());
@@ -117,6 +117,6 @@ public final class MySQLHandshakePacketTest {
verify(payload).writeInt1(authPluginData.getAuthenticationPluginData().length + 1);
verify(payload).writeReserved(10);
verify(payload).writeStringNul(new String(authPluginData.getAuthPluginDataPart2()));
- verify(payload).writeStringNul(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName());
+ verify(payload).writeStringNul(MySQLAuthenticationMethod.NATIVE.getMethodName());
}
}
diff --git a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakeResponse41PacketTest.java b/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakeResponse41PacketTest.java
index d26a627ec3c..ed1e931bd8a 100644
--- a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakeResponse41PacketTest.java
+++ b/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/handshake/MySQLHandshakeResponse41PacketTest.java
@@ -59,7 +59,7 @@ public final class MySQLHandshakeResponse41PacketTest {
public void assertNewWithPayloadWithAuthPluginName() {
when(payload.readInt1()).thenReturn(MySQLServerInfo.DEFAULT_CHARSET.getId());
when(payload.readInt4()).thenReturn(MySQLCapabilityFlag.CLIENT_PLUGIN_AUTH.getValue(), 1000);
- when(payload.readStringNul()).thenReturn("root", MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName());
+ when(payload.readStringNul()).thenReturn("root", MySQLAuthenticationMethod.NATIVE.getMethodName());
when(payload.readStringNulByBytes()).thenReturn(new byte[]{1});
MySQLHandshakeResponse41Packet actual = new MySQLHandshakeResponse41Packet(payload);
assertThat(actual.getMaxPacketSize(), is(1000));
@@ -68,7 +68,7 @@ public final class MySQLHandshakeResponse41PacketTest {
assertThat(actual.getAuthResponse(), is(new byte[]{1}));
assertThat(actual.getCapabilityFlags(), is(MySQLCapabilityFlag.CLIENT_PLUGIN_AUTH.getValue()));
assertNull(actual.getDatabase());
- assertThat(actual.getAuthPluginName(), is(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName()));
+ assertThat(actual.getAuthPluginName(), is(MySQLAuthenticationMethod.NATIVE.getMethodName()));
verify(payload).skipReserved(23);
}
@@ -125,7 +125,7 @@ public final class MySQLHandshakeResponse41PacketTest {
public void assertWriteWithAuthPluginName() {
MySQLHandshakeResponse41Packet actual = new MySQLHandshakeResponse41Packet(100, MySQLServerInfo.DEFAULT_CHARSET.getId(), "root");
actual.setAuthResponse(new byte[]{1});
- actual.setAuthPluginName(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION);
+ actual.setAuthPluginName(MySQLAuthenticationMethod.NATIVE);
actual.write(payload);
verify(payload).writeInt4(MySQLCapabilityFlag.CLIENT_PLUGIN_AUTH.getValue());
verify(payload).writeInt4(100);
@@ -133,7 +133,7 @@ public final class MySQLHandshakeResponse41PacketTest {
verify(payload).writeReserved(23);
verify(payload).writeStringNul("root");
verify(payload).writeStringNul(new String(new byte[]{1}));
- verify(payload).writeStringNul(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName());
+ verify(payload).writeStringNul(MySQLAuthenticationMethod.NATIVE.getMethodName());
}
@Test
diff --git a/db-protocol/opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java b/db-protocol/opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
index 7c15f7a0808..0e5676cbce3 100644
--- a/db-protocol/opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
+++ b/db-protocol/opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.db.protocol.opengauss.codec;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.CompositeByteBuf;
import io.netty.channel.ChannelHandlerContext;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.codec.DatabasePacketCodecEngine;
import org.apache.shardingsphere.db.protocol.opengauss.packet.command.OpenGaussCommandPacketType;
import org.apache.shardingsphere.db.protocol.opengauss.packet.command.generic.OpenGaussErrorResponsePacket;
diff --git a/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java b/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
index 6d7dca90a1b..8eb9de501b6 100644
--- a/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
+++ b/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.codec;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.CompositeByteBuf;
import io.netty.channel.ChannelHandlerContext;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.codec.DatabasePacketCodecEngine;
import org.apache.shardingsphere.dialect.postgresql.vendor.PostgreSQLVendorError;
import org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLMessageSeverityLevel;
diff --git a/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLAuthenticationMethod.java b/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLAuthenticationMethod.java
index 4fdfcc89df0..18425e37c76 100644
--- a/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLAuthenticationMethod.java
+++ b/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLAuthenticationMethod.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.db.protocol.constant.AuthenticationMethod;
/**
* PostgreSQL password authentication method.
@@ -27,7 +28,7 @@ import lombok.RequiredArgsConstructor;
*/
@RequiredArgsConstructor
@Getter
-public enum PostgreSQLAuthenticationMethod {
+public enum PostgreSQLAuthenticationMethod implements AuthenticationMethod {
MD5("md5"),
diff --git a/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLServerInfo.java b/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLServerInfo.java
index e33e9e1c2c4..40782fa4aef 100644
--- a/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLServerInfo.java
+++ b/db-protocol/postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLServerInfo.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.constant;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
/**
* ShardingSphere-Proxy's information for PostgreSQL.
diff --git a/db-protocol/postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLServerInfoTest.java b/db-protocol/postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLServerInfoTest.java
index 71bb9b0a75b..adc50cc4af7 100644
--- a/db-protocol/postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLServerInfoTest.java
+++ b/db-protocol/postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/constant/PostgreSQLServerInfoTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.constant;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
diff --git a/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoder.java b/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoder.java
index e30a2ac3b23..0f62bb7e887 100644
--- a/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoder.java
+++ b/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoder.java
@@ -29,7 +29,7 @@ import org.apache.shardingsphere.data.pipeline.mysql.ingest.binlog.event.DeleteR
import org.apache.shardingsphere.data.pipeline.mysql.ingest.binlog.event.PlaceholderEvent;
import org.apache.shardingsphere.data.pipeline.mysql.ingest.binlog.event.UpdateRowsEvent;
import org.apache.shardingsphere.data.pipeline.mysql.ingest.binlog.event.WriteRowsEvent;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLBinlogEventType;
import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.MySQLBinlogEventHeader;
import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.management.MySQLBinlogFormatDescriptionEventPacket;
diff --git a/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLCommandPacketDecoder.java b/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLCommandPacketDecoder.java
index b1bbab61b46..e11947cd5e8 100644
--- a/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLCommandPacketDecoder.java
+++ b/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLCommandPacketDecoder.java
@@ -21,7 +21,7 @@ import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import org.apache.shardingsphere.data.pipeline.mysql.ingest.client.InternalResultSet;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.MySQLColumnDefinition41Packet;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.MySQLFieldCountPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.text.MySQLTextResultSetRowPacket;
diff --git a/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandler.java b/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandler.java
index 6805ab0828b..a5f4026897f 100644
--- a/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandler.java
+++ b/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandler.java
@@ -72,7 +72,7 @@ public final class MySQLNegotiateHandler extends ChannelInboundHandlerAdapter {
MySQLHandshakeResponse41Packet handshakeResponsePacket = new MySQLHandshakeResponse41Packet(MAX_PACKET_SIZE, CHARACTER_SET, username);
handshakeResponsePacket.setAuthResponse(generateAuthResponse(handshake.getAuthPluginData().getAuthenticationPluginData()));
handshakeResponsePacket.setCapabilityFlags(generateClientCapability());
- handshakeResponsePacket.setAuthPluginName(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION);
+ handshakeResponsePacket.setAuthPluginName(MySQLAuthenticationMethod.NATIVE);
ctx.channel().writeAndFlush(handshakeResponsePacket);
serverInfo = new ServerInfo();
serverInfo.setServerVersion(new ServerVersion(handshake.getServerVersion()));
diff --git a/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiatePackageDecoder.java b/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiatePackageDecoder.java
index 1adcd261ad3..7e0e63d5b33 100644
--- a/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiatePackageDecoder.java
+++ b/kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiatePackageDecoder.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.data.pipeline.mysql.ingest.client.netty;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.packet.MySQLPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLOKPacket;
diff --git a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoderTest.java b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoderTest.java
index c824c814ce3..a3d5f3c7162 100644
--- a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoderTest.java
+++ b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoderTest.java
@@ -27,7 +27,7 @@ import org.apache.shardingsphere.data.pipeline.mysql.ingest.binlog.BinlogContext
import org.apache.shardingsphere.data.pipeline.mysql.ingest.binlog.event.DeleteRowsEvent;
import org.apache.shardingsphere.data.pipeline.mysql.ingest.binlog.event.UpdateRowsEvent;
import org.apache.shardingsphere.data.pipeline.mysql.ingest.binlog.event.WriteRowsEvent;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLBinaryColumnType;
import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.MySQLBinlogTableMapEventPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.MySQLBinlogColumnDef;
diff --git a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLCommandPacketDecoderTest.java b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLCommandPacketDecoderTest.java
index cdf063e8ceb..fea0f4929ae 100644
--- a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLCommandPacketDecoderTest.java
+++ b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLCommandPacketDecoderTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.data.pipeline.mysql.ingest.client.netty;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import org.apache.shardingsphere.data.pipeline.mysql.ingest.client.InternalResultSet;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLEofPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLOKPacket;
diff --git a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandlerTest.java b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandlerTest.java
index 661cc933f12..d8b2b7852d7 100644
--- a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandlerTest.java
+++ b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandlerTest.java
@@ -74,7 +74,7 @@ public final class MySQLNegotiateHandlerTest {
@Test
public void assertChannelReadHandshakeInitPacket() throws ReflectiveOperationException {
MySQLHandshakePacket handshakePacket = new MySQLHandshakePacket(0, new MySQLAuthPluginData(new byte[8], new byte[12]));
- handshakePacket.setAuthPluginName(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION);
+ handshakePacket.setAuthPluginName(MySQLAuthenticationMethod.NATIVE);
mysqlNegotiateHandler.channelRead(channelHandlerContext, handshakePacket);
verify(channel).writeAndFlush(ArgumentMatchers.any(MySQLHandshakeResponse41Packet.class));
ServerInfo serverInfo = (ServerInfo) Plugins.getMemberAccessor().get(MySQLNegotiateHandler.class.getDeclaredField("serverInfo"), mysqlNegotiateHandler);
diff --git a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiatePackageDecoderTest.java b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiatePackageDecoderTest.java
index 086b037ae43..f7f7c1d2c34 100644
--- a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiatePackageDecoderTest.java
+++ b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiatePackageDecoderTest.java
@@ -21,7 +21,7 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.packet.handshake.MySQLAuthMoreDataPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.handshake.MySQLAuthSwitchRequestPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.handshake.MySQLHandshakePacket;
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/MySQLSetCharsetExecutor.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/MySQLSetCharsetExecutor.java
index edf4ff578a3..8792fff794f 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/MySQLSetCharsetExecutor.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/MySQLSetCharsetExecutor.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.proxy.backend.handler.admin.mysql.executor;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLServerInfo;
import org.apache.shardingsphere.dialect.mysql.exception.UnknownCharsetException;
import org.apache.shardingsphere.proxy.backend.handler.admin.mysql.MySQLSessionVariableHandler;
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/executor/PostgreSQLSetCharsetExecutor.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/executor/PostgreSQLSetCharsetExecutor.java
index e5236fb8885..61fffd6858b 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/executor/PostgreSQLSetCharsetExecutor.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/executor/PostgreSQLSetCharsetExecutor.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.proxy.backend.handler.admin.postgresql.executor;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.dialect.exception.data.InvalidParameterValueException;
import org.apache.shardingsphere.proxy.backend.handler.admin.postgresql.PostgreSQLCharacterSets;
import org.apache.shardingsphere.proxy.backend.handler.admin.postgresql.PostgreSQLSessionVariableHandler;
diff --git a/proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/version/ShardingSphereProxyVersion.java b/proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/version/ShardingSphereProxyVersion.java
index a2f0ab819bd..2e2715cd616 100644
--- a/proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/version/ShardingSphereProxyVersion.java
+++ b/proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/version/ShardingSphereProxyVersion.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.version;
import com.google.common.base.Strings;
import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.infra.autogen.version.ShardingSphereVersion;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
diff --git a/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTask.java b/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTask.java
index 33b7c927f21..ce96123c391 100644
--- a/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTask.java
+++ b/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTask.java
@@ -21,7 +21,7 @@ import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.packet.CommandPacket;
import org.apache.shardingsphere.db.protocol.packet.CommandPacketType;
import org.apache.shardingsphere.db.protocol.packet.DatabasePacket;
diff --git a/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelInboundHandler.java b/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelInboundHandler.java
index 28c571f9db2..24ba89a9ca1 100644
--- a/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelInboundHandler.java
+++ b/proxy/frontend/core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelInboundHandler.java
@@ -22,7 +22,7 @@ import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.payload.PacketPayload;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.executor.sql.process.ExecuteProcessEngine;
diff --git a/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTaskTest.java b/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTaskTest.java
index 8107e31851a..434a5e603e3 100644
--- a/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTaskTest.java
+++ b/proxy/frontend/core/src/test/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTaskTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.frontend.command;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.packet.CommandPacket;
import org.apache.shardingsphere.db.protocol.packet.CommandPacketType;
import org.apache.shardingsphere.db.protocol.packet.DatabasePacket;
diff --git a/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java b/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java
index eca0d2c44aa..132fdaedcb9 100644
--- a/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java
+++ b/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.proxy.frontend.mysql.authentication;
import com.google.common.base.Strings;
import io.netty.channel.ChannelHandlerContext;
import org.apache.shardingsphere.authority.rule.AuthorityRule;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLCapabilityFlag;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLCharacterSet;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConnectionPhase;
diff --git a/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandler.java b/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandler.java
index 2b4d6e1d87f..3d18e275144 100644
--- a/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandler.java
+++ b/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandler.java
@@ -74,13 +74,13 @@ public final class MySQLAuthenticationHandler {
return new MySQLNativePasswordAuthenticator();
}
switch (authenticationMethod) {
- case SECURE_PASSWORD_AUTHENTICATION:
+ case NATIVE:
return new MySQLNativePasswordAuthenticator();
- case CLEAR_TEXT_AUTHENTICATION:
+ case CLEAR_TEXT:
return new MySQLClearPasswordAuthenticator();
// TODO add other Authenticator
- case OLD_PASSWORD_AUTHENTICATION:
- case WINDOWS_NATIVE_AUTHENTICATION:
+ case OLD_PASSWORD:
+ case WINDOWS_NATIVE:
case SHA256:
default:
return new MySQLNativePasswordAuthenticator();
diff --git a/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/authenticator/MySQLClearPasswordAuthenticator.java b/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/authenticator/MySQLClearPasswordAuthenticator.java
index 25ce644e317..57b5222ec07 100644
--- a/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/authenticator/MySQLClearPasswordAuthenticator.java
+++ b/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/authenticator/MySQLClearPasswordAuthenticator.java
@@ -38,6 +38,6 @@ public final class MySQLClearPasswordAuthenticator implements MySQLAuthenticator
@Override
public String getAuthenticationMethodName() {
- return MySQLAuthenticationMethod.CLEAR_TEXT_AUTHENTICATION.getMethodName();
+ return MySQLAuthenticationMethod.CLEAR_TEXT.getMethodName();
}
}
diff --git a/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/authenticator/MySQLNativePasswordAuthenticator.java b/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/authenticator/MySQLNativePasswordAuthenticator.java
index e04c30d3f1d..908ca33ee52 100644
--- a/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/authenticator/MySQLNativePasswordAuthenticator.java
+++ b/proxy/frontend/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/authenticator/MySQLNativePasswordAuthenticator.java
@@ -59,6 +59,6 @@ public final class MySQLNativePasswordAuthenticator implements MySQLAuthenticato
@Override
public String getAuthenticationMethodName() {
- return MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName();
+ return MySQLAuthenticationMethod.NATIVE.getMethodName();
}
}
diff --git a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
index efcc8c56aa8..c4610d0db24 100644
--- a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
+++ b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
@@ -24,7 +24,7 @@ import lombok.SneakyThrows;
import org.apache.shardingsphere.authority.config.AuthorityRuleConfiguration;
import org.apache.shardingsphere.authority.rule.AuthorityRule;
import org.apache.shardingsphere.authority.rule.builder.AuthorityRuleBuilder;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConnectionPhase;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConstants;
import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
diff --git a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngineTest.java b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngineTest.java
index 3a962872a5a..1a1d586d32b 100644
--- a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngineTest.java
+++ b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngineTest.java
@@ -21,7 +21,7 @@ import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.util.Attribute;
import lombok.SneakyThrows;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLCapabilityFlag;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConnectionPhase;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConstants;
diff --git a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
index c75910455db..415d0ae84ab 100644
--- a/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
+++ b/proxy/frontend/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
@@ -125,7 +125,7 @@ public final class MySQLAuthenticationHandlerTest extends ProxyContextRestorer {
when(rule.getAuthenticatorType(user)).thenReturn("");
MySQLAuthenticator authenticator = authenticationHandler.getAuthenticator(rule, user);
assertThat(authenticator, instanceOf(MySQLNativePasswordAuthenticator.class));
- assertThat(authenticator.getAuthenticationMethodName(), is(MySQLAuthenticationMethod.SECURE_PASSWORD_AUTHENTICATION.getMethodName()));
+ assertThat(authenticator.getAuthenticationMethodName(), is(MySQLAuthenticationMethod.NATIVE.getMethodName()));
}
@SneakyThrows(ReflectiveOperationException.class)
diff --git a/proxy/frontend/opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngine.java b/proxy/frontend/opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngine.java
index d598368299a..510f9b5d555 100644
--- a/proxy/frontend/opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngine.java
+++ b/proxy/frontend/opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngine.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.proxy.frontend.opengauss.authentication;
import com.google.common.base.Strings;
import io.netty.channel.ChannelHandlerContext;
import org.apache.shardingsphere.authority.rule.AuthorityRule;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.opengauss.constant.OpenGaussProtocolVersion;
import org.apache.shardingsphere.db.protocol.opengauss.packet.authentication.OpenGaussAuthenticationSCRAMSha256Packet;
import org.apache.shardingsphere.db.protocol.payload.PacketPayload;
diff --git a/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngineTest.java b/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngineTest.java
index e5e4b6bbf9e..496e5a303ee 100644
--- a/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngineTest.java
+++ b/proxy/frontend/opengauss/src/test/java/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngineTest.java
@@ -26,7 +26,7 @@ import lombok.SneakyThrows;
import org.apache.shardingsphere.authority.config.AuthorityRuleConfiguration;
import org.apache.shardingsphere.authority.rule.AuthorityRule;
import org.apache.shardingsphere.authority.rule.builder.AuthorityRuleBuilder;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.opengauss.packet.authentication.OpenGaussAuthenticationSCRAMSha256Packet;
import org.apache.shardingsphere.db.protocol.payload.PacketPayload;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
diff --git a/proxy/frontend/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.java b/proxy/frontend/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.java
index 62ed7a39348..e754a1cd7fd 100644
--- a/proxy/frontend/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.java
+++ b/proxy/frontend/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.proxy.frontend.postgresql.authentication;
import com.google.common.base.Strings;
import io.netty.channel.ChannelHandlerContext;
import org.apache.shardingsphere.authority.rule.AuthorityRule;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.payload.PacketPayload;
import org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLAuthenticationMethod;
import org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLServerInfo;
diff --git a/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java b/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
index 1469a296032..c981679695e 100644
--- a/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
+++ b/proxy/frontend/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
@@ -26,7 +26,7 @@ import lombok.SneakyThrows;
import org.apache.shardingsphere.authority.config.AuthorityRuleConfiguration;
import org.apache.shardingsphere.authority.rule.AuthorityRule;
import org.apache.shardingsphere.authority.rule.builder.AuthorityRuleBuilder;
-import org.apache.shardingsphere.db.protocol.CommonConstants;
+import org.apache.shardingsphere.db.protocol.constant.CommonConstants;
import org.apache.shardingsphere.db.protocol.payload.PacketPayload;
import org.apache.shardingsphere.db.protocol.postgresql.packet.handshake.authentication.PostgreSQLMD5PasswordAuthenticationPacket;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;