From 541bf968e5ba228f3305393cfe921454971fdfd4 Mon Sep 17 00:00:00 2001 From: Jonathan Klabunde Tomer <125505367+jkt-signal@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:23:14 -0800 Subject: [PATCH] remove support for GET /v1/accounts/me --- .../textsecuregcm/controllers/AccountController.java | 8 -------- .../textsecuregcm/controllers/AccountControllerTest.java | 7 +++---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java index 753d48778..1b724a6c2 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java @@ -263,14 +263,6 @@ public class AccountController { registrationRecoveryPasswordsManager.store(updatedAccount.getIdentifier(IdentityType.PNI), registrationRecoveryPassword)); } - @GET - @Path("/me") - @Deprecated() // use whoami - @Produces(MediaType.APPLICATION_JSON) - public AccountIdentityResponse getMe(@ReadOnly @Auth AuthenticatedDevice auth) { - return AccountIdentityResponseBuilder.fromAccount(auth.getAccount()); - } - @GET @Path("/whoami") @Produces(MediaType.APPLICATION_JSON) diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java index 3844148f8..43e4c7538 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java @@ -324,9 +324,8 @@ class AccountControllerTest { } } - @ParameterizedTest - @ValueSource(strings = {"/v1/accounts/whoami", "/v1/accounts/me"}) - void testWhoAmI(final String path) { + @Test + void testWhoAmI() { final Instant expiration = Instant.now().plus(Duration.ofHours(1)).plusMillis(101); final Instant truncatedExpiration = Instant.ofEpochSecond(expiration.getEpochSecond()); final AccountBadge badge1 = new AccountBadge("badge1", expiration, true); @@ -337,7 +336,7 @@ class AccountControllerTest { when(AuthHelper.VALID_ACCOUNT.getBadges()).thenReturn(List.of(badge1, badge2)); try (final Response response = resources.getJerseyTest() - .target(path) + .target("/v1/accounts/whoami") .request() .header(HttpHeaders.AUTHORIZATION, AuthHelper.getAuthHeader(AuthHelper.VALID_UUID, AuthHelper.VALID_PASSWORD)) .get()) {