test_class.declarator: username = "root"
test_class.modifier: private final
test_class.original_string: private final String username = "root";
test_class.type: String
test_class.var_name: username
test_class.declarator: password = "sharding"
test_class.modifier: private final
test_class.original_string: private final String password = "sharding";
test_class.type: String
test_class.var_name: password
test_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/auth/PostgreSQLAuthenticationEngineTest.java
test_class.identifier: PostgreSQLAuthenticationEngineTest
test_case.body: @Test
      public void assertDatabaseNotExist() {
          PostgreSQLPacketPayload payload = new PostgreSQLPacketPayload(createByteBuf(32, 512));
          payload.writeInt4(64);
          payload.writeInt4(196608);
          payload.writeStringNul("user");
          payload.writeStringNul(username);
          payload.writeStringNul("database");
          payload.writeStringNul("sharding_db");
          AuthenticationResult actual = new PostgreSQLAuthenticationEngine().auth(mock(ChannelHandlerContext.class), payload);
          assertThat(actual.isFinished(), is(false));
      }
test_case.class_method_signature: PostgreSQLAuthenticationEngineTest.assertDatabaseNotExist()
test_case.full_signature: @Test public void assertDatabaseNotExist()
test_case.identifier: assertDatabaseNotExist
test_case.invocations: createByteBuf writeInt4 writeInt4 writeStringNul writeStringNul writeStringNul writeStringNul auth mock assertThat isFinished is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertDatabaseNotExist()
focal_class.declarator: SSL_REQUEST_PAYLOAD_LENGTH = 8
focal_class.modifier: private static final
focal_class.original_string: private static final int SSL_REQUEST_PAYLOAD_LENGTH = 8;
focal_class.type: int
focal_class.var_name: SSL_REQUEST_PAYLOAD_LENGTH
focal_class.declarator: SSL_REQUEST_CODE = 80877103
focal_class.modifier: private static final
focal_class.original_string: private static final int SSL_REQUEST_CODE = 80877103;
focal_class.type: int
focal_class.var_name: SSL_REQUEST_CODE
focal_class.declarator: USER_NAME_KEYWORD = "user"
focal_class.modifier: private static final
focal_class.original_string: private static final String USER_NAME_KEYWORD = "user";
focal_class.type: String
focal_class.var_name: USER_NAME_KEYWORD
focal_class.declarator: DATABASE_NAME_KEYWORD = "database"
focal_class.modifier: private static final
focal_class.original_string: private static final String DATABASE_NAME_KEYWORD = "database";
focal_class.type: String
focal_class.var_name: DATABASE_NAME_KEYWORD
focal_class.declarator: startupMessageReceived = new AtomicBoolean(false)
focal_class.modifier: private final
focal_class.original_string: private final AtomicBoolean startupMessageReceived = new AtomicBoolean(false);
focal_class.type: AtomicBoolean
focal_class.var_name: startupMessageReceived
focal_class.declarator: md5Salt
focal_class.modifier: private volatile
focal_class.original_string: private volatile byte[] md5Salt;
focal_class.type: byte[]
focal_class.var_name: md5Salt
focal_class.declarator: currentAuthResult
focal_class.modifier: private
focal_class.original_string: private AuthenticationResult currentAuthResult;
focal_class.type: AuthenticationResult
focal_class.var_name: currentAuthResult
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/auth/PostgreSQLAuthenticationEngine.java
focal_class.identifier: PostgreSQLAuthenticationEngine
focal_class.interfaces: implements AuthenticationEngine
focal_class.class_method_signature: PostgreSQLAuthenticationEngine.handshake(final ChannelHandlerContext context)
focal_class.full_signature: @Override public int handshake(final ChannelHandlerContext context)
focal_class.identifier: handshake
focal_class.modifiers: @Override public
focal_class.parameters: (final ChannelHandlerContext context)
focal_class.return: int
focal_class.signature: int handshake(final ChannelHandlerContext context)
focal_class.class_method_signature: PostgreSQLAuthenticationEngine.auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_class.full_signature: @Override public AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_class.identifier: auth
focal_class.modifiers: @Override public
focal_class.parameters: (final ChannelHandlerContext context, final PacketPayload payload)
focal_class.return: AuthenticationResult
focal_class.signature: AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_class.class_method_signature: PostgreSQLAuthenticationEngine.beforeStartupMessage(final ChannelHandlerContext context, final PostgreSQLPacketPayload payload)
focal_class.full_signature: private AuthenticationResult beforeStartupMessage(final ChannelHandlerContext context, final PostgreSQLPacketPayload payload)
focal_class.identifier: beforeStartupMessage
focal_class.modifiers: private
focal_class.parameters: (final ChannelHandlerContext context, final PostgreSQLPacketPayload payload)
focal_class.return: AuthenticationResult
focal_class.signature: AuthenticationResult beforeStartupMessage(final ChannelHandlerContext context, final PostgreSQLPacketPayload payload)
focal_class.class_method_signature: PostgreSQLAuthenticationEngine.afterStartupMessage(final ChannelHandlerContext context, final PostgreSQLPacketPayload payload)
focal_class.full_signature: private AuthenticationResult afterStartupMessage(final ChannelHandlerContext context, final PostgreSQLPacketPayload payload)
focal_class.identifier: afterStartupMessage
focal_class.modifiers: private
focal_class.parameters: (final ChannelHandlerContext context, final PostgreSQLPacketPayload payload)
focal_class.return: AuthenticationResult
focal_class.signature: AuthenticationResult afterStartupMessage(final ChannelHandlerContext context, final PostgreSQLPacketPayload payload)
focal_class.class_method_signature: PostgreSQLAuthenticationEngine.createErrorPacket(final PostgreSQLErrorCode errorCode, final String errorMessage)
focal_class.full_signature: private PostgreSQLErrorResponsePacket createErrorPacket(final PostgreSQLErrorCode errorCode, final String errorMessage)
focal_class.identifier: createErrorPacket
focal_class.modifiers: private
focal_class.parameters: (final PostgreSQLErrorCode errorCode, final String errorMessage)
focal_class.return: PostgreSQLErrorResponsePacket
focal_class.signature: PostgreSQLErrorResponsePacket createErrorPacket(final PostgreSQLErrorCode errorCode, final String errorMessage)
focal_method.body: @Override
      public AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload) {
          if (SSL_REQUEST_PAYLOAD_LENGTH == payload.getByteBuf().markReaderIndex().readInt() && SSL_REQUEST_CODE == payload.getByteBuf().readInt()) {
              context.writeAndFlush(new PostgreSQLSSLNegativePacket());
              return AuthenticationResultBuilder.continued();
          }
          payload.getByteBuf().resetReaderIndex();
          if (!startupMessageReceived.get()) {
              return beforeStartupMessage(context, (PostgreSQLPacketPayload) payload);
          } else {
              return afterStartupMessage(context, (PostgreSQLPacketPayload) payload);
          }
      }
focal_method.class_method_signature: PostgreSQLAuthenticationEngine.auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_method.full_signature: @Override public AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_method.identifier: auth
focal_method.invocations: readInt markReaderIndex getByteBuf readInt getByteBuf writeAndFlush continued resetReaderIndex getByteBuf get beforeStartupMessage afterStartupMessage
focal_method.modifiers: @Override public
focal_method.parameters: (final ChannelHandlerContext context, final PacketPayload payload)
focal_method.return: AuthenticationResult
focal_method.signature: AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload)