From ef2d25704e4f2d26d777303a702026c70c4c2e37 Mon Sep 17 00:00:00 2001 From: ameya-signal <163888879+ameya-signal@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:41:22 -0700 Subject: [PATCH] Don't allow or set registration lock on accounts with no phone number --- .../RegistrationLockVerificationManager.java | 6 ++++-- .../controllers/AccountController.java | 8 +++++-- .../controllers/RegistrationController.java | 1 + .../grpc/AccountsGrpcService.java | 10 ++++++--- .../textsecuregcm/storage/Account.java | 4 ++++ .../storage/ChangeNumberManager.java | 1 + ...gistrationLockVerificationManagerTest.java | 12 ++++++++++- .../controllers/AccountControllerTest.java | 14 +++++++++++++ .../RegistrationControllerTest.java | 12 +++++++---- .../grpc/AccountsGrpcServiceTest.java | 21 ++++++++++++++++++- .../tests/util/AccountsHelper.java | 1 + .../textsecuregcm/tests/util/AuthHelper.java | 18 ++++++++++++++++ 12 files changed, 95 insertions(+), 13 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManager.java index b468c778f..372f78b18 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManager.java @@ -86,6 +86,9 @@ public class RegistrationLockVerificationManager { final PhoneVerificationRequest.VerificationType phoneVerificationType ) throws RateLimitExceededException, RegistrationLockFailureException { + final String phoneNumber = account.getNumberOptional() + .orElseThrow(() -> new IllegalArgumentException("account does not have a phone number")); + final Tags expiredTags = Tags.of(UserAgentTagUtil.getPlatformTag(userAgent), Tag.of(REGISTRATION_LOCK_VERIFICATION_FLOW_TAG_NAME, flow.name()), Tag.of(PHONE_VERIFICATION_TYPE_TAG_NAME, phoneVerificationType.name()) @@ -106,10 +109,9 @@ public class RegistrationLockVerificationManager { } if (StringUtils.isNotEmpty(clientRegistrationLock)) { - rateLimiters.getPinLimiter().validate(account.getNumber()); + rateLimiters.getPinLimiter().validate(phoneNumber); } - final String phoneNumber = account.getNumber(); final boolean registrationLockMatches = existingRegistrationLock.verify(clientRegistrationLock); final boolean alreadyLocked = account.hasLockedCredentials(); 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 b90be321f..17075ee49 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java @@ -166,8 +166,12 @@ public class AccountController { public void setRegistrationLock(@Auth AuthenticatedDevice auth, @NotNull @Valid RegistrationLock accountLock) { final SaltedTokenHash credentials = SaltedTokenHash.generateFor(accountLock.registrationLock()); - accounts.update(auth.accountIdentifier(), - a -> a.setRegistrationLock(credentials.hash(), credentials.salt())); + try { + accounts.update(auth.accountIdentifier(), + a -> a.setRegistrationLock(credentials.hash(), credentials.salt())); + } catch (IllegalArgumentException _) { + throw new BadRequestException(); + } } @DELETE diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java index a955152de..4fef509be 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java @@ -186,6 +186,7 @@ public class RegistrationController { } if (existingAccount.isPresent()) { + assert existingAccount.get().getNumberOptional().isPresent(); registrationLockVerificationManager.verifyRegistrationLock(existingAccount.get(), registrationRequest.accountAttributes().getRegistrationLock(), userAgent, RegistrationLockVerificationManager.Flow.REGISTRATION, verificationType); diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcService.java b/service/src/main/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcService.java index 82d9814a7..1b13b5c0f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcService.java @@ -171,10 +171,14 @@ public class AccountsGrpcService extends SimpleAccountsGrpc.AccountsImplBase { final SaltedTokenHash credentials = SaltedTokenHash.generateFor(formatRegistrationLock(request.getRegistrationLock().toByteArray())); - accountsManager.update(AuthenticationUtil.requireAuthenticatedDevice().accountIdentifier(), - account -> account.setRegistrationLock(credentials.hash(), credentials.salt())); + try { + accountsManager.update(AuthenticationUtil.requireAuthenticatedDevice().accountIdentifier(), + account -> account.setRegistrationLock(credentials.hash(), credentials.salt())); - return SetRegistrationLockResponse.getDefaultInstance(); + return SetRegistrationLockResponse.getDefaultInstance(); + } catch (IllegalArgumentException _) { + throw GrpcExceptions.invalidArguments(null); + } } @Override diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/Account.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/Account.java index 91443490b..42a6b79ac 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/Account.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/Account.java @@ -530,6 +530,10 @@ public class Account { public void setRegistrationLock(final String registrationLock, final String registrationLockSalt) { requireNotStale(); + if (number == null) { + throw new IllegalArgumentException("Cannot set registration lock on account with no phone number"); + } + this.registrationLock = registrationLock; this.registrationLockSalt = registrationLockSalt; } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/ChangeNumberManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/ChangeNumberManager.java index b53e591ca..dfab9b503 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/ChangeNumberManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/ChangeNumberManager.java @@ -122,6 +122,7 @@ public class ChangeNumberManager { final Optional existingAccount = accountAndMaybeExistingAccount.second(); if (existingAccount.isPresent()) { + assert existingAccount.get().getNumberOptional().isPresent(); registrationLockVerificationManager.verifyRegistrationLock(existingAccount.get(), registrationLock, userAgent, RegistrationLockVerificationManager.Flow.CHANGE_NUMBER, verificationType); } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManagerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManagerTest.java index 584602a29..aec0afd2b 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManagerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManagerTest.java @@ -19,11 +19,13 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.util.List; +import java.util.Optional; import java.util.UUID; import java.util.function.Consumer; import java.util.stream.Stream; import javax.annotation.Nullable; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -76,7 +78,7 @@ class RegistrationLockVerificationManagerTest { final UUID accountIdentifier = UUID.randomUUID(); when(account.getAccountIdentifier()).thenReturn(accountIdentifier); when(account.getIdentifier(IdentityType.ACI)).thenReturn(accountIdentifier); - when(account.getNumber()).thenReturn("+18005551212"); + when(account.getNumberOptional()).thenReturn(Optional.of("+18005551212")); when(account.getDevices()).thenReturn(List.of(device)); AccountsHelper.setupMockGet(accountsManager, account); @@ -185,4 +187,12 @@ class RegistrationLockVerificationManagerTest { ); } + @Test + void testAccountWithNoPhoneNumber() { + when(account.getNumberOptional()).thenReturn(Optional.empty()); + assertThrows(IllegalArgumentException.class, + () -> registrationLockVerificationManager.verifyRegistrationLock(account, null, null, + RegistrationLockVerificationManager.Flow.REGISTRATION, PhoneVerificationRequest.VerificationType.SESSION)); + } + } 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 a8c02fb17..22575f393 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java @@ -214,6 +214,7 @@ class AccountControllerTest { when(accountsManager.getByAccountIdentifier(AuthHelper.VALID_UUID)).thenReturn(Optional.of(AuthHelper.VALID_ACCOUNT)); when(accountsManager.getByAccountIdentifier(AuthHelper.VALID_UUID_TWO)).thenReturn(Optional.of(AuthHelper.VALID_ACCOUNT_TWO)); when(accountsManager.getByAccountIdentifier(AuthHelper.VALID_UUID_3)).thenReturn(Optional.of(AuthHelper.VALID_ACCOUNT_3)); + when(accountsManager.getByAccountIdentifier(AuthHelper.VALID_UUID_4)).thenReturn(Optional.of(AuthHelper.VALID_ACCOUNT_4)); when(accountsManager.getByAccountIdentifier(AuthHelper.UNDISCOVERABLE_UUID)).thenReturn(Optional.of(AuthHelper.UNDISCOVERABLE_ACCOUNT)); doAnswer(invocation -> { @@ -268,6 +269,19 @@ class AccountControllerTest { } } + @Test + void testSetRegistrationLockAccountHasNoNumber() { + doThrow(new IllegalArgumentException()).when(AuthHelper.VALID_ACCOUNT_4).setRegistrationLock(any(), any()); + try (final Response response = resources.getJerseyTest() + .target("/v1/accounts/registration_lock/") + .request() + .header(HttpHeaders.AUTHORIZATION, AuthHelper.getAuthHeader(AuthHelper.VALID_UUID_4, AuthHelper.VALID_PASSWORD_4)) + .put(Entity.json(new RegistrationLock("1234567890123456789012345678901234567890123456789012345678901234")))) { + + assertThat(response.getStatus()).isEqualTo(400); + } + } + @Test void testSetShortRegistrationLock() { try (final Response response = resources.getJerseyTest() diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RegistrationControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RegistrationControllerTest.java index f31891e46..b8b26a902 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RegistrationControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RegistrationControllerTest.java @@ -266,6 +266,7 @@ class RegistrationControllerTest { final Account account = mock(Account.class); when(accountsManager.getByE164(any())).thenReturn(Optional.of(account)); + when(account.getNumberOptional()).thenReturn(Optional.of(NUMBER)); when(account.hasCapability(DeviceCapability.TRANSFER)).thenReturn(deviceTransferSupported); final int expectedStatus; @@ -317,6 +318,7 @@ class RegistrationControllerTest { final Account account = mock(Account.class); when(accountsManager.getByE164(oldFormatBeninNumber)).thenReturn(Optional.of(account)); + when(account.getNumberOptional()).thenReturn(Optional.of(oldFormatBeninNumber)); when(accountsManager.getByE164(newFormatBeninNumber)).thenReturn(Optional.empty()); doThrow(new WebApplicationException(RegistrationLockError.MISMATCH.getExpectedStatus())) @@ -347,6 +349,7 @@ class RegistrationControllerTest { if (existingAccount) { final Account account = mock(Account.class); when(account.hasCapability(DeviceCapability.TRANSFER)).thenReturn(transferSupported); + when(account.getNumberOptional()).thenReturn(Optional.of(NUMBER)); maybeAccount = Optional.of(account); } else { maybeAccount = Optional.empty(); @@ -650,9 +653,10 @@ class RegistrationControllerTest { @ParameterizedTest @ValueSource(booleans = {true, false}) - void reregistrationFlag(final boolean existingAccount) throws InterruptedException { - final Optional maybeAccount = Optional.ofNullable(existingAccount ? mock(Account.class) : null); - when(accountsManager.getByE164(any())).thenReturn(maybeAccount); + void reregistrationFlag(final boolean accountExists) throws InterruptedException { + final Account existingAccount = mock(Account.class); + when(existingAccount.getNumberOptional()).thenReturn(Optional.of(NUMBER)); + when(accountsManager.getByE164(any())).thenReturn(accountExists ? Optional.of(existingAccount) : Optional.empty()); final Account account = mock(Account.class); when(account.getPrimaryDevice()).thenReturn(mock(Device.class)); @@ -668,7 +672,7 @@ class RegistrationControllerTest { try (Response response = request.post(Entity.json(requestJson("sessionId")))) { assertEquals(200, response.getStatus()); final AccountCreationResponse creationResponse = response.readEntity(AccountCreationResponse.class); - assertEquals(existingAccount, creationResponse.reregistration()); + assertEquals(accountExists, creationResponse.reregistration()); } } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java index 9db3c1bbe..8c68c30dd 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcServiceTest.java @@ -216,7 +216,7 @@ class AccountsGrpcServiceTest extends SimpleBaseGrpcTest authenticatedServiceStub().setRegistrationLock(SetRegistrationLockRequest.newBuilder() + .setRegistrationLock(ByteString.copyFrom(registrationLockSecret)) + .build())); + } + @ParameterizedTest @ValueSource(bytes = { Device.PRIMARY_ID, Device.PRIMARY_ID + 1 }) void clearRegistrationLock(final byte deviceId) { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/tests/util/AccountsHelper.java b/service/src/test/java/org/whispersystems/textsecuregcm/tests/util/AccountsHelper.java index edd85dfd4..f66b86c7c 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/tests/util/AccountsHelper.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/tests/util/AccountsHelper.java @@ -224,6 +224,7 @@ public class AccountsHelper { case "getIdentifier" -> when(updatedAccount.getIdentifier(stubbing.getInvocation().getArgument(0))).thenAnswer(stubbing); case "isIdentifiedBy" -> when(updatedAccount.isIdentifiedBy(stubbing.getInvocation().getArgument(0))).thenAnswer(stubbing); case "getNumber" -> when(updatedAccount.getNumber()).thenAnswer(stubbing); + case "getNumberOptional" -> when(updatedAccount.getNumberOptional()).thenAnswer(stubbing); case "getUsername" -> when(updatedAccount.getUsernameHash()).thenAnswer(stubbing); case "getUsernameHash" -> when(updatedAccount.getUsernameHash()).thenAnswer(stubbing); case "getUsernameLinkHandle" -> when(updatedAccount.getUsernameLinkHandle()).thenAnswer(stubbing); diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/tests/util/AuthHelper.java b/service/src/test/java/org/whispersystems/textsecuregcm/tests/util/AuthHelper.java index 2cf69cd76..278b6bb5e 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/tests/util/AuthHelper.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/tests/util/AuthHelper.java @@ -79,6 +79,9 @@ public class AuthHelper { public static final String VALID_PASSWORD_3_PRIMARY = "3primary"; public static final String VALID_PASSWORD_3_LINKED = "3linked"; + public static final UUID VALID_UUID_4 = UUID.randomUUID(); + public static final String VALID_PASSWORD_4 = "blah"; + public static final UUID INVALID_UUID = UUID.randomUUID(); public static final String INVALID_PASSWORD = "bar"; @@ -98,12 +101,14 @@ public class AuthHelper { public static Account VALID_ACCOUNT_TWO = mock(Account.class ); public static Account UNDISCOVERABLE_ACCOUNT = mock(Account.class ); public static Account VALID_ACCOUNT_3 = mock(Account.class ); + public static Account VALID_ACCOUNT_4 = mock(Account.class ); public static Device VALID_DEVICE = mock(Device.class); public static Device VALID_DEVICE_TWO = mock(Device.class); public static Device UNDISCOVERABLE_DEVICE = mock(Device.class); public static Device VALID_DEVICE_3_PRIMARY = mock(Device.class); public static Device VALID_DEVICE_3_LINKED = mock(Device.class); + public static Device VALID_DEVICE_4 = mock(Device.class); public static final byte VALID_DEVICE_3_LINKED_ID = Device.PRIMARY_ID + 1; @@ -111,6 +116,7 @@ public class AuthHelper { private static SaltedTokenHash VALID_CREDENTIALS_TWO = mock(SaltedTokenHash.class); private static SaltedTokenHash VALID_CREDENTIALS_3_PRIMARY = mock(SaltedTokenHash.class); private static SaltedTokenHash VALID_CREDENTIALS_3_LINKED = mock(SaltedTokenHash.class); + private static SaltedTokenHash VALID_CREDENTIALS_4 = mock(SaltedTokenHash.class); private static SaltedTokenHash UNDISCOVERABLE_CREDENTIALS = mock(SaltedTokenHash.class); private static final Collection EXTENSION_TEST_ACCOUNTS = new HashSet<>(); @@ -120,12 +126,14 @@ public class AuthHelper { when(VALID_CREDENTIALS_TWO.verify("baz")).thenReturn(true); when(VALID_CREDENTIALS_3_PRIMARY.verify(VALID_PASSWORD_3_PRIMARY)).thenReturn(true); when(VALID_CREDENTIALS_3_LINKED.verify(VALID_PASSWORD_3_LINKED)).thenReturn(true); + when(VALID_CREDENTIALS_4.verify(VALID_PASSWORD_4)).thenReturn(true); when(UNDISCOVERABLE_CREDENTIALS.verify(UNDISCOVERABLE_PASSWORD)).thenReturn(true); when(VALID_DEVICE.getAuthTokenHash()).thenReturn(VALID_CREDENTIALS); when(VALID_DEVICE_TWO.getAuthTokenHash()).thenReturn(VALID_CREDENTIALS_TWO); when(VALID_DEVICE_3_PRIMARY.getAuthTokenHash()).thenReturn(VALID_CREDENTIALS_3_PRIMARY); when(VALID_DEVICE_3_LINKED.getAuthTokenHash()).thenReturn(VALID_CREDENTIALS_3_LINKED); + when(VALID_DEVICE_4.getAuthTokenHash()).thenReturn(VALID_CREDENTIALS_4); when(UNDISCOVERABLE_DEVICE.getAuthTokenHash()).thenReturn(UNDISCOVERABLE_CREDENTIALS); when(VALID_DEVICE.isPrimary()).thenReturn(true); @@ -133,12 +141,14 @@ public class AuthHelper { when(UNDISCOVERABLE_DEVICE.isPrimary()).thenReturn(true); when(VALID_DEVICE_3_PRIMARY.isPrimary()).thenReturn(true); when(VALID_DEVICE_3_LINKED.isPrimary()).thenReturn(false); + when(VALID_DEVICE_4.isPrimary()).thenReturn(true); when(VALID_DEVICE.getId()).thenReturn(Device.PRIMARY_ID); when(VALID_DEVICE_TWO.getId()).thenReturn(Device.PRIMARY_ID); when(UNDISCOVERABLE_DEVICE.getId()).thenReturn(Device.PRIMARY_ID); when(VALID_DEVICE_3_PRIMARY.getId()).thenReturn(Device.PRIMARY_ID); when(VALID_DEVICE_3_LINKED.getId()).thenReturn(VALID_DEVICE_3_LINKED_ID); + when(VALID_DEVICE_4.getId()).thenReturn(Device.PRIMARY_ID); when(UNDISCOVERABLE_DEVICE.isPrimary()).thenReturn(true); @@ -151,11 +161,14 @@ public class AuthHelper { when(VALID_ACCOUNT_3.getDevice(Device.PRIMARY_ID)).thenReturn(Optional.of(VALID_DEVICE_3_PRIMARY)); when(VALID_ACCOUNT_3.getPrimaryDevice()).thenReturn(VALID_DEVICE_3_PRIMARY); when(VALID_ACCOUNT_3.getDevice((byte) 2)).thenReturn(Optional.of(VALID_DEVICE_3_LINKED)); + when(VALID_ACCOUNT_4.getDevice(Device.PRIMARY_ID)).thenReturn(Optional.of(VALID_DEVICE_4)); + when(VALID_ACCOUNT_4.getPrimaryDevice()).thenReturn(VALID_DEVICE_4); when(VALID_ACCOUNT.getDevices()).thenReturn(List.of(VALID_DEVICE)); when(VALID_ACCOUNT_TWO.getDevices()).thenReturn(List.of(VALID_DEVICE_TWO)); when(UNDISCOVERABLE_ACCOUNT.getDevices()).thenReturn(List.of(UNDISCOVERABLE_DEVICE)); when(VALID_ACCOUNT_3.getDevices()).thenReturn(List.of(VALID_DEVICE_3_PRIMARY, VALID_DEVICE_3_LINKED)); + when(VALID_ACCOUNT_4.getDevices()).thenReturn(List.of(VALID_DEVICE_4)); when(VALID_ACCOUNT.getNumber()).thenReturn(VALID_NUMBER); when(VALID_ACCOUNT.getNumberOptional()).thenReturn(Optional.of(VALID_NUMBER)); @@ -202,6 +215,9 @@ public class AuthHelper { when(VALID_ACCOUNT.getIdentityKey(IdentityType.ACI)).thenReturn(VALID_IDENTITY); when(VALID_ACCOUNT.getIdentityKey(IdentityType.PNI)).thenReturn(VALID_PNI_IDENTITY); + when(VALID_ACCOUNT_4.getAccountIdentifier()).thenReturn(VALID_UUID_4); + when(VALID_ACCOUNT_4.getIdentifier(IdentityType.ACI)).thenReturn(VALID_UUID_4); + reset(ACCOUNTS_MANAGER); when(ACCOUNTS_MANAGER.getByE164(VALID_NUMBER)).thenReturn(Optional.of(VALID_ACCOUNT)); @@ -219,6 +235,8 @@ public class AuthHelper { when(ACCOUNTS_MANAGER.getByAccountIdentifier(VALID_UUID_3)).thenReturn(Optional.of(VALID_ACCOUNT_3)); when(ACCOUNTS_MANAGER.getByPhoneNumberIdentifier(VALID_PNI_3)).thenReturn(Optional.of(VALID_ACCOUNT_3)); + when(ACCOUNTS_MANAGER.getByAccountIdentifier(VALID_UUID_4)).thenReturn(Optional.of(VALID_ACCOUNT_4)); + AccountsHelper.setupMockUpdateForAuthHelper(ACCOUNTS_MANAGER); for (TestAccount testAccount : TEST_ACCOUNTS) {