Skip to content

Commit 3656677

Browse files
authored
Revert password length limit (#16087)
1 parent a53f7ad commit 3656677

File tree

2 files changed

+13
-1
lines changed
  • integration-test/src/test/java/org/apache/iotdb/db/it/auth
  • iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils

2 files changed

+13
-1
lines changed

integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,4 +1594,16 @@ public void testPasswordHistoryAlter(Statement statement) throws SQLException {
15941594
resultSet.getString("root.__system.password_history._userA.oldPassword"));
15951595
}
15961596
}
1597+
1598+
@Test
1599+
public void testChangeBackPassword() {
1600+
try (Connection connection = EnvFactory.getEnv().getConnection();
1601+
Statement statement = connection.createStatement()) {
1602+
statement.execute("ALTER USER root SET PASSWORD 'newPassword'");
1603+
statement.execute("ALTER USER root SET PASSWORD 'root'");
1604+
} catch (SQLException e) {
1605+
e.printStackTrace();
1606+
fail(e.getMessage());
1607+
}
1608+
}
15971609
}

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/AuthUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class AuthUtils {
5353
private static final String ROOT_PREFIX = IoTDBConstant.PATH_ROOT;
5454
private static final int NAME_MIN_LENGTH = 4;
5555
private static final int NAME_MAX_LENGTH = 32;
56-
private static final int PASSWORD_MIN_LENGTH = 12;
56+
private static final int PASSWORD_MIN_LENGTH = 4;
5757
private static final int PASSWORD_MAX_LENGTH = 32;
5858

5959
// match number, character, and !@#$%^*()_+-=

0 commit comments

Comments
 (0)