Skip to content

Commit 06419c7

Browse files
author
839536
authored
v6.5.3
v6.5.3
2 parents 4bee6ce + 6b5789c commit 06419c7

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

bus-core/src/main/java/org/aoju/bus/core/lang/Validator.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,4 +1150,33 @@ public static <T extends CharSequence> T validateCarDrivingLicence(T value, Stri
11501150
return value;
11511151
}
11521152

1153+
/**
1154+
* 验证是否符合密码要求
1155+
*
1156+
* @param value 值
1157+
* @param weak 是否弱密码
1158+
* @return 否符合密码要求
1159+
*/
1160+
public static boolean isPassword(String value, boolean... weak) {
1161+
boolean result = false;
1162+
for (final boolean element : weak) {
1163+
result ^= element;
1164+
}
1165+
return result ? isMatchRegex(RegEx.PASSWORD_WEAK, value) : isMatchRegex(RegEx.PASSWORD_STRONG, value);
1166+
}
1167+
1168+
/**
1169+
* 验证是是否符合密码要求
1170+
*
1171+
* @param value 值
1172+
* @param errorMsg 验证错误的信息
1173+
* @param weak 是否弱密码
1174+
* @throws ValidateException 验证异常
1175+
*/
1176+
public static void validatePassword(String value, String errorMsg, boolean... weak) throws ValidateException {
1177+
if (false == isPassword(value, weak)) {
1178+
throw new ValidateException(errorMsg);
1179+
}
1180+
}
1181+
11531182
}

bus-gitlab/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,31 @@
5757
<groupId>org.glassfish.jersey.inject</groupId>
5858
<artifactId>jersey-hk2</artifactId>
5959
<version>${jersey.version}</version>
60+
<optional>true</optional>
6061
</dependency>
6162
<dependency>
6263
<groupId>org.glassfish.jersey.core</groupId>
6364
<artifactId>jersey-client</artifactId>
6465
<version>${jersey.version}</version>
66+
<optional>true</optional>
6567
</dependency>
6668
<dependency>
6769
<groupId>org.glassfish.jersey.connectors</groupId>
6870
<artifactId>jersey-apache-connector</artifactId>
6971
<version>${jersey.version}</version>
72+
<optional>true</optional>
7073
</dependency>
7174
<dependency>
7275
<groupId>org.glassfish.jersey.media</groupId>
7376
<artifactId>jersey-media-multipart</artifactId>
7477
<version>${jersey.version}</version>
78+
<optional>true</optional>
7579
</dependency>
7680
<dependency>
7781
<groupId>org.glassfish.jersey.media</groupId>
7882
<artifactId>jersey-media-json-jackson</artifactId>
7983
<version>${jersey.version}</version>
84+
<optional>true</optional>
8085
</dependency>
8186
<dependency>
8287
<groupId>jakarta.servlet</groupId>

0 commit comments

Comments
 (0)