test_class.declarator: SCHEMA_PATTERN = "schema_%s"
test_class.modifier: private static final
test_class.original_string: private static final String SCHEMA_PATTERN = "schema_%s";
test_class.type: String
test_class.var_name: SCHEMA_PATTERN
test_class.declarator: authenticationHandler = new MySQLAuthenticationHandler()
test_class.modifier: private final
test_class.original_string: private final MySQLAuthenticationHandler authenticationHandler = new MySQLAuthenticationHandler();
test_class.type: MySQLAuthenticationHandler
test_class.var_name: authenticationHandler
test_class.declarator: part1 = {84, 85, 115, 77, 68, 116, 85, 78}
test_class.modifier: private final
test_class.original_string: private final byte[] part1 = {84, 85, 115, 77, 68, 116, 85, 78};
test_class.type: byte[]
test_class.var_name: part1
test_class.declarator: part2 = {83, 121, 75, 81, 87, 56, 120, 112, 73, 109, 77, 69}
test_class.modifier: private final
test_class.original_string: private final byte[] part2 = {83, 121, 75, 81, 87, 56, 120, 112, 73, 109, 77, 69};
test_class.type: byte[]
test_class.var_name: part2
test_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/auth/MySQLAuthenticationHandlerTest.java
test_class.identifier: MySQLAuthenticationHandlerTest
test_case.body: @Test
      public void assertLoginWithAbsentUser() {
          setAuthentication(new ProxyUser("root", Collections.singleton("db1")));
          byte[] authResponse = {-27, 89, -20, -27, 65, -120, -64, -101, 86, -100, -108, -100, 6, -125, -37, 117, 14, -43, 95, -113};
          assertThat(authenticationHandler.login("root1", authResponse, "db1").orElse(null), is(MySQLServerErrorCode.ER_ACCESS_DENIED_ERROR));
      }
test_case.class_method_signature: MySQLAuthenticationHandlerTest.assertLoginWithAbsentUser()
test_case.full_signature: @Test public void assertLoginWithAbsentUser()
test_case.identifier: assertLoginWithAbsentUser
test_case.invocations: setAuthentication singleton assertThat orElse login is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertLoginWithAbsentUser()
focal_class.declarator: PROXY_SCHEMA_CONTEXTS = ProxyContext.getInstance()
focal_class.modifier: private static final
focal_class.original_string: private static final ProxyContext PROXY_SCHEMA_CONTEXTS = ProxyContext.getInstance();
focal_class.type: ProxyContext
focal_class.var_name: PROXY_SCHEMA_CONTEXTS
focal_class.declarator: authPluginData = new MySQLAuthPluginData()
focal_class.modifier: private final
focal_class.original_string: private final MySQLAuthPluginData authPluginData = new MySQLAuthPluginData();
focal_class.type: MySQLAuthPluginData
focal_class.var_name: authPluginData
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/auth/MySQLAuthenticationHandler.java
focal_class.identifier: MySQLAuthenticationHandler
focal_class.class_method_signature: MySQLAuthenticationHandler.login(final String username, final byte[] authResponse, final String database)
focal_class.full_signature: public Optional<MySQLServerErrorCode> login(final String username, final byte[] authResponse, final String database)
focal_class.identifier: login
focal_class.modifiers: public
focal_class.parameters: (final String username, final byte[] authResponse, final String database)
focal_class.return: Optional<MySQLServerErrorCode>
focal_class.signature: Optional<MySQLServerErrorCode> login(final String username, final byte[] authResponse, final String database)
focal_class.class_method_signature: MySQLAuthenticationHandler.getUser(final String username)
focal_class.full_signature: private Optional<ProxyUser> getUser(final String username)
focal_class.identifier: getUser
focal_class.modifiers: private
focal_class.parameters: (final String username)
focal_class.return: Optional<ProxyUser>
focal_class.signature: Optional<ProxyUser> getUser(final String username)
focal_class.class_method_signature: MySQLAuthenticationHandler.isPasswordRight(final String password, final byte[] authResponse)
focal_class.full_signature: private boolean isPasswordRight(final String password, final byte[] authResponse)
focal_class.identifier: isPasswordRight
focal_class.modifiers: private
focal_class.parameters: (final String password, final byte[] authResponse)
focal_class.return: boolean
focal_class.signature: boolean isPasswordRight(final String password, final byte[] authResponse)
focal_class.class_method_signature: MySQLAuthenticationHandler.isAuthorizedSchema(final Collection<String> authorizedSchemas, final String schema)
focal_class.full_signature: private boolean isAuthorizedSchema(final Collection<String> authorizedSchemas, final String schema)
focal_class.identifier: isAuthorizedSchema
focal_class.modifiers: private
focal_class.parameters: (final Collection<String> authorizedSchemas, final String schema)
focal_class.return: boolean
focal_class.signature: boolean isAuthorizedSchema(final Collection<String> authorizedSchemas, final String schema)
focal_class.class_method_signature: MySQLAuthenticationHandler.getAuthCipherBytes(final String password)
focal_class.full_signature: private byte[] getAuthCipherBytes(final String password)
focal_class.identifier: getAuthCipherBytes
focal_class.modifiers: private
focal_class.parameters: (final String password)
focal_class.return: byte[]
focal_class.signature: byte[] getAuthCipherBytes(final String password)
focal_class.class_method_signature: MySQLAuthenticationHandler.xor(final byte[] input, final byte[] secret)
focal_class.full_signature: private byte[] xor(final byte[] input, final byte[] secret)
focal_class.identifier: xor
focal_class.modifiers: private
focal_class.parameters: (final byte[] input, final byte[] secret)
focal_class.return: byte[]
focal_class.signature: byte[] xor(final byte[] input, final byte[] secret)
focal_method.body: public Optional<MySQLServerErrorCode> login(final String username, final byte[] authResponse, final String database) {
          Optional<ProxyUser> user = getUser(username);
          if (!user.isPresent() || !isPasswordRight(user.get().getPassword(), authResponse)) {
              return Optional.of(MySQLServerErrorCode.ER_ACCESS_DENIED_ERROR);
          }
          if (!isAuthorizedSchema(user.get().getAuthorizedSchemas(), database)) {
              return Optional.of(MySQLServerErrorCode.ER_DBACCESS_DENIED_ERROR);
          }
          return Optional.empty();
      }
focal_method.class_method_signature: MySQLAuthenticationHandler.login(final String username, final byte[] authResponse, final String database)
focal_method.full_signature: public Optional<MySQLServerErrorCode> login(final String username, final byte[] authResponse, final String database)
focal_method.identifier: login
focal_method.invocations: getUser isPresent isPasswordRight getPassword get of isAuthorizedSchema getAuthorizedSchemas get of empty
focal_method.modifiers: public
focal_method.parameters: (final String username, final byte[] authResponse, final String database)
focal_method.return: Optional<MySQLServerErrorCode>
focal_method.signature: Optional<MySQLServerErrorCode> login(final String username, final byte[] authResponse, final String database)