Skip to content

Commit

Permalink
v6.5.3
Browse files Browse the repository at this point in the history
v6.5.3
  • Loading branch information
839128 committed Jul 7, 2022
2 parents 4bee6ce + 6b5789c commit 06419c7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions bus-core/src/main/java/org/aoju/bus/core/lang/Validator.java
Expand Up @@ -1150,4 +1150,33 @@ public static <T extends CharSequence> T validateCarDrivingLicence(T value, Stri
return value;
}

/**
* 验证是否符合密码要求
*
* @param value 值
* @param weak 是否弱密码
* @return 否符合密码要求
*/
public static boolean isPassword(String value, boolean... weak) {
boolean result = false;
for (final boolean element : weak) {
result ^= element;
}
return result ? isMatchRegex(RegEx.PASSWORD_WEAK, value) : isMatchRegex(RegEx.PASSWORD_STRONG, value);
}

/**
* 验证是是否符合密码要求
*
* @param value 值
* @param errorMsg 验证错误的信息
* @param weak 是否弱密码
* @throws ValidateException 验证异常
*/
public static void validatePassword(String value, String errorMsg, boolean... weak) throws ValidateException {
if (false == isPassword(value, weak)) {
throw new ValidateException(errorMsg);
}
}

}
5 changes: 5 additions & 0 deletions bus-gitlab/pom.xml
Expand Up @@ -57,26 +57,31 @@
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-apache-connector</artifactId>
<version>${jersey.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>${jersey.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down

0 comments on commit 06419c7

Please sign in to comment.