From adf5795dff25f26c2b8d53dde753ed5d449adafa Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Thu, 17 Oct 2024 14:51:04 -0400 Subject: [PATCH] Remove unused members in `ProfileController` --- .../controllers/ProfileController.java | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java index c4fb51ce3..491b38770 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java @@ -11,7 +11,6 @@ import com.google.common.base.Preconditions; import io.dropwizard.auth.Auth; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.Metrics; -import io.micrometer.core.instrument.Tags; import io.swagger.v3.oas.annotations.tags.Tag; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -23,7 +22,6 @@ import java.util.Collection; import java.util.Collections; import java.util.HexFormat; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -43,7 +41,6 @@ import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; -import javax.ws.rs.ProcessingException; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.container.ContainerRequestContext; @@ -61,8 +58,6 @@ import org.signal.libsignal.zkgroup.groupsend.GroupSendDerivedKeyPair; import org.signal.libsignal.zkgroup.groupsend.GroupSendFullToken; import org.signal.libsignal.zkgroup.profiles.ExpiringProfileKeyCredentialResponse; import org.signal.libsignal.zkgroup.profiles.ServerZkProfileOperations; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.auth.Anonymous; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.GroupSendTokenHeader; @@ -86,7 +81,6 @@ import org.whispersystems.textsecuregcm.identity.IdentityType; import org.whispersystems.textsecuregcm.identity.PniServiceIdentifier; import org.whispersystems.textsecuregcm.identity.ServiceIdentifier; import org.whispersystems.textsecuregcm.limits.RateLimiters; -import org.whispersystems.textsecuregcm.metrics.UserAgentTagUtil; import org.whispersystems.textsecuregcm.s3.PolicySigner; import org.whispersystems.textsecuregcm.s3.PostPolicyGenerator; import org.whispersystems.textsecuregcm.storage.Account; @@ -108,7 +102,6 @@ import software.amazon.awssdk.services.s3.model.DeleteObjectRequest; @Path("/v1/profile") @Tag(name = "Profile") public class ProfileController { - private final Logger logger = LoggerFactory.getLogger(ProfileController.class); private final Clock clock; private final RateLimiters rateLimiters; private final ProfilesManager profilesManager; @@ -130,7 +123,6 @@ public class ProfileController { private static final String EXPIRING_PROFILE_KEY_CREDENTIAL_TYPE = "expiringProfileKey"; private static final Counter VERSION_NOT_FOUND_COUNTER = Metrics.counter(name(ProfileController.class, "versionNotFound")); - private static final String INVALID_ACCEPT_LANGUAGE_COUNTER_NAME = name(ProfileController.class, "invalidAcceptLanguage"); public ProfileController( Clock clock, @@ -312,14 +304,10 @@ public class ProfileController { maybeRequester, accessKey.filter(ignored -> identifier.identityType() == IdentityType.ACI), identifier); } return switch (identifier.identityType()) { - case ACI -> { - yield buildBaseProfileResponseForAccountIdentity(targetAccount, - maybeRequester.map(requester -> ProfileHelper.isSelfProfileRequest(requester.getUuid(), identifier)).orElse(false), - containerRequestContext); - } - case PNI -> { - yield buildBaseProfileResponseForPhoneNumberIdentity(targetAccount); - } + case ACI -> buildBaseProfileResponseForAccountIdentity(targetAccount, + maybeRequester.map(requester -> ProfileHelper.isSelfProfileRequest(requester.getUuid(), identifier)).orElse(false), + containerRequestContext); + case PNI -> buildBaseProfileResponseForPhoneNumberIdentity(targetAccount); }; }