mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 09:18:05 +01:00
Add per-action captcha site-key configuration
- reject captcha requests without valid actions - require specific site keys for each action
This commit is contained in:
committed by
ravi-signal
parent
fd8918eaff
commit
a8eb27940d
@@ -17,6 +17,7 @@ import java.util.UUID;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import org.whispersystems.textsecuregcm.captcha.Action;
|
||||
import org.whispersystems.textsecuregcm.captcha.AssessmentResult;
|
||||
import org.whispersystems.textsecuregcm.captcha.CaptchaChecker;
|
||||
import org.whispersystems.textsecuregcm.controllers.RateLimitExceededException;
|
||||
@@ -75,7 +76,7 @@ class RateLimitChallengeManagerTest {
|
||||
when(account.getNumber()).thenReturn("+18005551234");
|
||||
when(account.getUuid()).thenReturn(UUID.randomUUID());
|
||||
|
||||
when(captchaChecker.verify(any(), any()))
|
||||
when(captchaChecker.verify(eq(Action.CHALLENGE), any(), any()))
|
||||
.thenReturn(successfulChallenge
|
||||
? new AssessmentResult(true, "")
|
||||
: AssessmentResult.invalid());
|
||||
|
||||
Reference in New Issue
Block a user