mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 17:08:23 +01:00
Add registration recovery checker
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package org.whispersystems.textsecuregcm.spam;
|
||||
|
||||
import javax.ws.rs.container.ContainerRequestContext;
|
||||
|
||||
public interface RegistrationRecoveryChecker {
|
||||
|
||||
/**
|
||||
* Determine if a registration recovery attempt should be allowed or not
|
||||
*
|
||||
* @param requestContext The container request context for a registration recovery attempt
|
||||
* @param e164 The E164 formatted phone number of the requester
|
||||
* @return true if the registration recovery attempt is allowed, false otherwise.
|
||||
*/
|
||||
boolean checkRegistrationRecoveryAttempt(final ContainerRequestContext requestContext, final String e164);
|
||||
|
||||
static RegistrationRecoveryChecker noop() {
|
||||
return (ignoredCtx, ignoredE164) -> true;
|
||||
}
|
||||
}
|
||||
@@ -79,4 +79,12 @@ public interface SpamFilter extends Managed {
|
||||
* @return a {@link ChallengeConstraintChecker} controlled by the spam filter
|
||||
*/
|
||||
ChallengeConstraintChecker getChallengeConstraintChecker();
|
||||
|
||||
/**
|
||||
* Return a checker that will be called to determine if a user is allowed to use their
|
||||
* registration recovery password to re-register
|
||||
*
|
||||
* @return a {@link RegistrationRecoveryChecker} controlled by the spam filter
|
||||
*/
|
||||
RegistrationRecoveryChecker getRegistrationRecoveryChecker();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user