-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from buession/2.3.x
Release 2.3.2
- Loading branch information
Showing
72 changed files
with
3,809 additions
and
618 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* +-------------------------------------------------------------------------------------------------------+ | ||
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt | | ||
* | Author: Yong.Teng <[email protected]> | | ||
* | Copyright @ 2013-2022 Buession.com Inc. | | ||
* | Copyright @ 2013-2023 Buession.com Inc. | | ||
* +-------------------------------------------------------------------------------------------------------+ | ||
*/ | ||
package com.buession.security.captcha.core; | ||
|
@@ -34,27 +34,28 @@ public class RequiredParameterCaptchaException extends CaptchaException { | |
|
||
private final String parameter; | ||
|
||
public RequiredParameterCaptchaException(String parameter){ | ||
public RequiredParameterCaptchaException(String parameter) { | ||
super("Parameter \"" + parameter + "\" cloud not be empty or null."); | ||
this.parameter = parameter; | ||
} | ||
|
||
public RequiredParameterCaptchaException(String parameter, String message){ | ||
public RequiredParameterCaptchaException(String parameter, String message) { | ||
super(message); | ||
this.parameter = parameter; | ||
} | ||
|
||
public RequiredParameterCaptchaException(String parameter, Throwable cause){ | ||
public RequiredParameterCaptchaException(String parameter, Throwable cause) { | ||
super("Parameter \"" + parameter + "\" cloud not be empty or null.", cause); | ||
this.parameter = parameter; | ||
} | ||
|
||
public RequiredParameterCaptchaException(String parameter, String message, Throwable cause){ | ||
public RequiredParameterCaptchaException(String parameter, String message, Throwable cause) { | ||
super(message, cause); | ||
this.parameter = parameter; | ||
} | ||
|
||
public String getParameter(){ | ||
public String getParameter() { | ||
return parameter; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* +-------------------------------------------------------------------------------------------------------+ | ||
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt | | ||
* | Author: Yong.Teng <[email protected]> | | ||
* | Copyright @ 2013-2022 Buession.com Inc. | | ||
* | Copyright @ 2013-2023 Buession.com Inc. | | ||
* +-------------------------------------------------------------------------------------------------------+ | ||
*/ | ||
package com.buession.security.captcha.geetest; | ||
|
@@ -37,8 +37,30 @@ public interface GeetestClient extends CaptchaClient { | |
void setHttpClient(HttpClient httpClient); | ||
|
||
@Override | ||
default Manufacturer getManufacturer(){ | ||
default Manufacturer getManufacturer() { | ||
return Manufacturer.GEETEST; | ||
} | ||
|
||
/** | ||
* 返回是否为 V3 版本 | ||
* | ||
* @return true / false | ||
* | ||
* @since 2.3.2 | ||
*/ | ||
default boolean isV3() { | ||
return "v3".equalsIgnoreCase(getVersion()); | ||
} | ||
|
||
/** | ||
* 返回是否为 V3 版本 | ||
* | ||
* @return true / false | ||
* | ||
* @since 2.3.2 | ||
*/ | ||
default boolean isV4() { | ||
return "v4".equalsIgnoreCase(getVersion()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* +-------------------------------------------------------------------------------------------------------+ | ||
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt | | ||
* | Author: Yong.Teng <[email protected]> | | ||
* | Copyright @ 2013-2022 Buession.com Inc. | | ||
* | Copyright @ 2013-2023 Buession.com Inc. | | ||
* +-------------------------------------------------------------------------------------------------------+ | ||
*/ | ||
package com.buession.security.captcha.validator.reactive; | ||
|
@@ -57,15 +57,15 @@ public class ReactiveGeetestCaptchaValidator extends GeetestCaptchaValidator imp | |
* {@link GeetestParameter} 实例 | ||
*/ | ||
public ReactiveGeetestCaptchaValidator(final GeetestCaptchaClient geetestCaptchaClient, | ||
final GeetestParameter parameter){ | ||
final GeetestParameter parameter) { | ||
super(geetestCaptchaClient, parameter); | ||
} | ||
|
||
@Override | ||
public Status validate(final ServerHttpRequest request) throws CaptchaException{ | ||
public Status validate(final ServerHttpRequest request) throws CaptchaException { | ||
MultiValueMap<String, String> parameters = request.getQueryParams(); | ||
|
||
if("v3".equals(captchaClient.getVersion())){ | ||
if(captchaClient.isV3()){ | ||
final GeetestV3Parameter geetestV3Parameter = (GeetestV3Parameter) parameter; | ||
final GeetestV3RequestData requestData = new GeetestV3RequestData(); | ||
|
||
|
@@ -84,7 +84,7 @@ public Status validate(final ServerHttpRequest request) throws CaptchaException{ | |
} | ||
|
||
return validate(requestData); | ||
}else if("v4".equals(captchaClient.getVersion())){ | ||
}else if(captchaClient.isV4()){ | ||
final GeetestV4Parameter geetestV4Parameter = (GeetestV4Parameter) parameter; | ||
final GeetestV4RequestData requestData = new GeetestV4RequestData(); | ||
|
||
|
Oops, something went wrong.