diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/AccountAuthenticator.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/AccountAuthenticator.java index 9955d316b..563d5be8f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/AccountAuthenticator.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/AccountAuthenticator.java @@ -4,36 +4,21 @@ */ package org.whispersystems.textsecuregcm.auth; -import io.micrometer.core.instrument.Metrics; +import io.dropwizard.auth.Authenticator; +import io.dropwizard.auth.basic.BasicCredentials; +import java.util.Optional; import org.whispersystems.textsecuregcm.storage.Account; import org.whispersystems.textsecuregcm.storage.AccountsManager; -import java.util.Optional; - -import io.dropwizard.auth.Authenticator; -import io.dropwizard.auth.basic.BasicCredentials; - -import static com.codahale.metrics.MetricRegistry.name; - public class AccountAuthenticator extends BaseAccountAuthenticator implements Authenticator { - private static final String AUTHENTICATION_COUNTER_NAME = name(AccountAuthenticator.class, "authenticate"); - private static final String GV2_CAPABLE_TAG_NAME = "gv1Migration"; - public AccountAuthenticator(AccountsManager accountsManager) { super(accountsManager); } @Override public Optional authenticate(BasicCredentials basicCredentials) { - final Optional maybeAccount = super.authenticate(basicCredentials, true); - - // TODO Remove this temporary counter when we can replace it with more generic feature adoption system - maybeAccount.ifPresent(account -> { - Metrics.counter(AUTHENTICATION_COUNTER_NAME, GV2_CAPABLE_TAG_NAME, String.valueOf(account.isGv1MigrationSupported())).increment(); - }); - - return maybeAccount; + return super.authenticate(basicCredentials, true); } }