From a3c37aed47882ecfdd0574a3c78a54505f0a49c8 Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Fri, 19 May 2023 14:30:11 -0500 Subject: [PATCH] Remove obsolete field from `SecureValueRecovery2Configuration` --- service/config/sample.yml | 1 - .../textsecuregcm/WhisperServerService.java | 2 +- .../configuration/SecureValueRecovery2Configuration.java | 1 - .../controllers/SecureValueRecovery2Controller.java | 9 +-------- .../securevaluerecovery/SecureValueRecovery2Client.java | 6 ------ .../controllers/SecureValueRecovery2ControllerTest.java | 3 +-- .../SecureValueRecovery2ClientTest.java | 2 +- 7 files changed, 4 insertions(+), 20 deletions(-) diff --git a/service/config/sample.yml b/service/config/sample.yml index 0931034fa..f3e93d56c 100644 --- a/service/config/sample.yml +++ b/service/config/sample.yml @@ -145,7 +145,6 @@ directoryV2: userIdTokenSharedSecret: secret://directoryV2.client.userIdTokenSharedSecret svr2: - enabled: false uri: svr2.example.com userAuthenticationTokenSharedSecret: secret://svr2.userAuthenticationTokenSharedSecret userIdTokenSharedSecret: secret://svr2.userIdTokenSharedSecret diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java index 08ef99b52..f57912efb 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java @@ -773,7 +773,7 @@ public class WhisperServerService extends Application deleteBackups(final UUID accountUuid) { - if (!enabled) { - return CompletableFuture.completedFuture(null); - } - final ExternalServiceCredentials credentials = secureValueRecoveryCredentialsGenerator.generateForUuid(accountUuid); final HttpRequest request = HttpRequest.newBuilder() diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2ControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2ControllerTest.java index b1f094c35..a7357d29c 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2ControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2ControllerTest.java @@ -24,7 +24,6 @@ import org.whispersystems.textsecuregcm.util.SystemMapper; public class SecureValueRecovery2ControllerTest extends SecureValueRecoveryControllerBaseTest { private static final SecureValueRecovery2Configuration CFG = new SecureValueRecovery2Configuration( - true, "", randomSecretBytes(32), randomSecretBytes(32), @@ -40,7 +39,7 @@ public class SecureValueRecovery2ControllerTest extends SecureValueRecoveryContr private static final AccountsManager ACCOUNTS_MANAGER = mock(AccountsManager.class); private static final SecureValueRecovery2Controller CONTROLLER = - new SecureValueRecovery2Controller(CREDENTIAL_GENERATOR, ACCOUNTS_MANAGER, CFG); + new SecureValueRecovery2Controller(CREDENTIAL_GENERATOR, ACCOUNTS_MANAGER); private static final ResourceExtension RESOURCES = ResourceExtension.builder() .addProvider(AuthHelper.getAuthFilter()) diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/securevaluerecovery/SecureValueRecovery2ClientTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/securevaluerecovery/SecureValueRecovery2ClientTest.java index 528a63e57..31f941c55 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/securevaluerecovery/SecureValueRecovery2ClientTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/securevaluerecovery/SecureValueRecovery2ClientTest.java @@ -52,7 +52,7 @@ class SecureValueRecovery2ClientTest { credentialsGenerator = mock(ExternalServiceCredentialsGenerator.class); httpExecutor = Executors.newSingleThreadExecutor(); - final SecureValueRecovery2Configuration config = new SecureValueRecovery2Configuration(true, + final SecureValueRecovery2Configuration config = new SecureValueRecovery2Configuration( "http://localhost:" + wireMock.getPort(), randomSecretBytes(32), randomSecretBytes(32),