mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 19:48:01 +01:00
Add by-action captcha score config
Enable setting different captcha score thresholds for different captcha actions via configuration
This commit is contained in:
committed by
ravi-signal
parent
437bc1358b
commit
59bc2c5535
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.validation.constraints.DecimalMax;
|
||||
import javax.validation.constraints.DecimalMin;
|
||||
@@ -28,6 +29,11 @@ public class DynamicCaptchaConfiguration {
|
||||
@JsonProperty
|
||||
private boolean allowRecaptcha = true;
|
||||
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private Map<String, BigDecimal> scoreFloorByAction = Collections.emptyMap();
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private Set<String> signupCountryCodes = Collections.emptySet();
|
||||
@@ -66,6 +72,10 @@ public class DynamicCaptchaConfiguration {
|
||||
return allowRecaptcha;
|
||||
}
|
||||
|
||||
public Map<String, BigDecimal> getScoreFloorByAction() {
|
||||
return scoreFloorByAction;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void setAllowHCaptcha(final boolean allowHCaptcha) {
|
||||
this.allowHCaptcha = allowHCaptcha;
|
||||
|
||||
Reference in New Issue
Block a user