raised password length limit to 64 characters

This commit is contained in:
Georgy Litvinov 2023-02-22 08:31:36 +01:00
parent 15cb4d7467
commit 99cbda4727
2 changed files with 3 additions and 2 deletions

View file

@ -15,7 +15,7 @@ import org.apache.commons.lang3.RandomStringUtils;
*/ */
public class UserAccount { public class UserAccount {
public static final int MIN_PASSWORD_LENGTH = 6; public static final int MIN_PASSWORD_LENGTH = 6;
public static final int MAX_PASSWORD_LENGTH = 12; public static final int MAX_PASSWORD_LENGTH = 64;
public enum Status { public enum Status {
ACTIVE, INACTIVE; ACTIVE, INACTIVE;

View file

@ -14,6 +14,7 @@ import java.util.Collections;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.junit.After; import org.junit.After;
@ -156,7 +157,7 @@ public class ProgramLoginTest extends AbstractTestClass {
@Test @Test
public void newPasswordTooLong() { public void newPasswordTooLong() {
executeRequest(NEW_USER_NAME, NEW_USER_PASSWORD, "reallyLongPassword"); executeRequest(NEW_USER_NAME, NEW_USER_PASSWORD, RandomStringUtils.randomAlphanumeric(UserAccount.MAX_PASSWORD_LENGTH + 1));
assert403(); assert403();
} }