From 77bf44fda59da93853c3768fe39ce0d6b0e87bf7 Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Fri, 30 Jan 2026 09:43:14 -0600 Subject: [PATCH] Remove deprecated /v2/accounts/phone_number_identity_key_distribution --- .../controllers/AccountControllerV2.java | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2.java index 38f956ab0..d91b0fcb2 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2.java @@ -35,7 +35,6 @@ import jakarta.ws.rs.core.Response; import java.time.Instant; import java.util.Optional; import java.util.UUID; -import javax.annotation.Nullable; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.ChangesPhoneNumber; import org.whispersystems.textsecuregcm.auth.PhoneVerificationTokenManager; @@ -45,7 +44,6 @@ import org.whispersystems.textsecuregcm.entities.AccountIdentityResponse; import org.whispersystems.textsecuregcm.entities.ChangeNumberRequest; import org.whispersystems.textsecuregcm.entities.MismatchedDevicesResponse; import org.whispersystems.textsecuregcm.entities.PhoneNumberDiscoverabilityRequest; -import org.whispersystems.textsecuregcm.entities.PhoneNumberIdentityKeyDistributionRequest; import org.whispersystems.textsecuregcm.entities.PhoneVerificationRequest; import org.whispersystems.textsecuregcm.entities.RegistrationLockFailure; import org.whispersystems.textsecuregcm.entities.StaleDevicesResponse; @@ -171,35 +169,6 @@ public class AccountControllerV2 { } } - // TODO Remove entirely on or after 2025-10-08 - @Deprecated(forRemoval = true) - @PUT - @Path("/phone_number_identity_key_distribution") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @Operation(summary = "Set phone-number identity keys", - description = "Updates key material for the phone-number identity for all devices and sends a synchronization message to companion devices") - @ApiResponse(responseCode = "200", description = "Indicates the transaction was successful and returns basic information about this account.", useReturnTypeSchema = true) - @ApiResponse(responseCode = "401", description = "Account authentication check failed.") - @ApiResponse(responseCode = "403", description = "This endpoint can only be invoked from the account's primary device.") - @ApiResponse(responseCode = "422", description = "The request body failed validation.") - public AccountIdentityResponse distributePhoneNumberIdentityKeys( - @Auth final AuthenticatedDevice authenticatedDevice, - @HeaderParam(HttpHeaders.USER_AGENT) @Nullable final String userAgentString, - @NotNull @Valid final PhoneNumberIdentityKeyDistributionRequest request) { - - if (authenticatedDevice.deviceId() != Device.PRIMARY_ID) { - throw new ForbiddenException(); - } - - if (!request.isSignatureValidOnEachSignedPreKey(userAgentString)) { - throw new WebApplicationException("Invalid signature", 422); - } - - return AccountIdentityResponseBuilder.fromAccount(accountsManager.getByAccountIdentifier(authenticatedDevice.accountIdentifier()) - .orElseThrow(() -> new WebApplicationException(Response.Status.UNAUTHORIZED))); - } - @PUT @Path("/phone_number_discoverability") @Consumes(MediaType.APPLICATION_JSON)