Retire the `PendingAccounts` table

This commit is contained in:
Jon Chambers 2023-08-03 10:58:58 -04:00 committed by Jon Chambers
parent 888879dfb2
commit fcf311aab3
11 changed files with 3 additions and 39 deletions

View File

@ -112,8 +112,6 @@ dynamoDbTables:
messages: messages:
tableName: Example_Messages tableName: Example_Messages
expiration: P30D # Duration of time until rows expire expiration: P30D # Duration of time until rows expire
pendingAccounts:
tableName: Example_PendingAccounts
pendingDevices: pendingDevices:
tableName: Example_PendingDevices tableName: Example_PendingDevices
phoneNumberIdentifiers: phoneNumberIdentifiers:

View File

@ -350,8 +350,6 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
ReportMessageDynamoDb reportMessageDynamoDb = new ReportMessageDynamoDb(dynamoDbClient, ReportMessageDynamoDb reportMessageDynamoDb = new ReportMessageDynamoDb(dynamoDbClient,
config.getDynamoDbTables().getReportMessage().getTableName(), config.getDynamoDbTables().getReportMessage().getTableName(),
config.getReportMessageConfiguration().getReportTtl()); config.getReportMessageConfiguration().getReportTtl());
VerificationCodeStore pendingAccounts = new VerificationCodeStore(dynamoDbClient,
config.getDynamoDbTables().getPendingAccounts().getTableName());
VerificationCodeStore pendingDevices = new VerificationCodeStore(dynamoDbClient, VerificationCodeStore pendingDevices = new VerificationCodeStore(dynamoDbClient,
config.getDynamoDbTables().getPendingDevices().getTableName()); config.getDynamoDbTables().getPendingDevices().getTableName());
RegistrationRecoveryPasswords registrationRecoveryPasswords = new RegistrationRecoveryPasswords( RegistrationRecoveryPasswords registrationRecoveryPasswords = new RegistrationRecoveryPasswords(
@ -507,7 +505,6 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
storageServiceExecutor, storageServiceRetryExecutor, config.getSecureStorageServiceConfiguration()); storageServiceExecutor, storageServiceRetryExecutor, config.getSecureStorageServiceConfiguration());
ClientPresenceManager clientPresenceManager = new ClientPresenceManager(clientPresenceCluster, recurringJobExecutor, ClientPresenceManager clientPresenceManager = new ClientPresenceManager(clientPresenceCluster, recurringJobExecutor,
keyspaceNotificationDispatchExecutor); keyspaceNotificationDispatchExecutor);
StoredVerificationCodeManager pendingAccountsManager = new StoredVerificationCodeManager(pendingAccounts);
StoredVerificationCodeManager pendingDevicesManager = new StoredVerificationCodeManager(pendingDevices); StoredVerificationCodeManager pendingDevicesManager = new StoredVerificationCodeManager(pendingDevices);
ProfilesManager profilesManager = new ProfilesManager(profiles, cacheCluster); ProfilesManager profilesManager = new ProfilesManager(profiles, cacheCluster);
MessagesCache messagesCache = new MessagesCache(messagesCluster, messagesCluster, MessagesCache messagesCache = new MessagesCache(messagesCluster, messagesCluster,
@ -525,7 +522,7 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
config.getDynamoDbTables().getDeletedAccountsLock().getTableName()); config.getDynamoDbTables().getDeletedAccountsLock().getTableName());
AccountsManager accountsManager = new AccountsManager(accounts, phoneNumberIdentifiers, cacheCluster, AccountsManager accountsManager = new AccountsManager(accounts, phoneNumberIdentifiers, cacheCluster,
accountLockManager, deletedAccounts, keys, messagesManager, profilesManager, accountLockManager, deletedAccounts, keys, messagesManager, profilesManager,
pendingAccountsManager, secureStorageClient, secureBackupClient, secureValueRecovery2Client, secureStorageClient, secureBackupClient, secureValueRecovery2Client,
clientPresenceManager, clientPresenceManager,
experimentEnrollmentManager, registrationRecoveryPasswordsManager, clock); experimentEnrollmentManager, registrationRecoveryPasswordsManager, clock);
RemoteConfigsManager remoteConfigsManager = new RemoteConfigsManager(remoteConfigs); RemoteConfigsManager remoteConfigsManager = new RemoteConfigsManager(remoteConfigs);

View File

@ -56,7 +56,6 @@ public class DynamoDbTables {
private final Table kemKeys; private final Table kemKeys;
private final Table kemLastResortKeys; private final Table kemLastResortKeys;
private final TableWithExpiration messages; private final TableWithExpiration messages;
private final Table pendingAccounts;
private final Table pendingDevices; private final Table pendingDevices;
private final Table phoneNumberIdentifiers; private final Table phoneNumberIdentifiers;
private final Table profiles; private final Table profiles;
@ -79,7 +78,6 @@ public class DynamoDbTables {
@JsonProperty("pqKeys") final Table kemKeys, @JsonProperty("pqKeys") final Table kemKeys,
@JsonProperty("pqLastResortKeys") final Table kemLastResortKeys, @JsonProperty("pqLastResortKeys") final Table kemLastResortKeys,
@JsonProperty("messages") final TableWithExpiration messages, @JsonProperty("messages") final TableWithExpiration messages,
@JsonProperty("pendingAccounts") final Table pendingAccounts,
@JsonProperty("pendingDevices") final Table pendingDevices, @JsonProperty("pendingDevices") final Table pendingDevices,
@JsonProperty("phoneNumberIdentifiers") final Table phoneNumberIdentifiers, @JsonProperty("phoneNumberIdentifiers") final Table phoneNumberIdentifiers,
@JsonProperty("profiles") final Table profiles, @JsonProperty("profiles") final Table profiles,
@ -101,7 +99,6 @@ public class DynamoDbTables {
this.kemKeys = kemKeys; this.kemKeys = kemKeys;
this.kemLastResortKeys = kemLastResortKeys; this.kemLastResortKeys = kemLastResortKeys;
this.messages = messages; this.messages = messages;
this.pendingAccounts = pendingAccounts;
this.pendingDevices = pendingDevices; this.pendingDevices = pendingDevices;
this.phoneNumberIdentifiers = phoneNumberIdentifiers; this.phoneNumberIdentifiers = phoneNumberIdentifiers;
this.profiles = profiles; this.profiles = profiles;
@ -174,12 +171,6 @@ public class DynamoDbTables {
return messages; return messages;
} }
@NotNull
@Valid
public Table getPendingAccounts() {
return pendingAccounts;
}
@NotNull @NotNull
@Valid @Valid
public Table getPendingDevices() { public Table getPendingDevices() {

View File

@ -104,7 +104,6 @@ public class AccountsManager {
private final KeysManager keysManager; private final KeysManager keysManager;
private final MessagesManager messagesManager; private final MessagesManager messagesManager;
private final ProfilesManager profilesManager; private final ProfilesManager profilesManager;
private final StoredVerificationCodeManager pendingAccounts;
private final SecureStorageClient secureStorageClient; private final SecureStorageClient secureStorageClient;
private final SecureBackupClient secureBackupClient; private final SecureBackupClient secureBackupClient;
private final SecureValueRecovery2Client secureValueRecovery2Client; private final SecureValueRecovery2Client secureValueRecovery2Client;
@ -151,7 +150,6 @@ public class AccountsManager {
final KeysManager keysManager, final KeysManager keysManager,
final MessagesManager messagesManager, final MessagesManager messagesManager,
final ProfilesManager profilesManager, final ProfilesManager profilesManager,
final StoredVerificationCodeManager pendingAccounts,
final SecureStorageClient secureStorageClient, final SecureStorageClient secureStorageClient,
final SecureBackupClient secureBackupClient, final SecureBackupClient secureBackupClient,
final SecureValueRecovery2Client secureValueRecovery2Client, final SecureValueRecovery2Client secureValueRecovery2Client,
@ -167,7 +165,6 @@ public class AccountsManager {
this.keysManager = keysManager; this.keysManager = keysManager;
this.messagesManager = messagesManager; this.messagesManager = messagesManager;
this.profilesManager = profilesManager; this.profilesManager = profilesManager;
this.pendingAccounts = pendingAccounts;
this.secureStorageClient = secureStorageClient; this.secureStorageClient = secureStorageClient;
this.secureBackupClient = secureBackupClient; this.secureBackupClient = secureBackupClient;
this.secureValueRecovery2Client = secureValueRecovery2Client; this.secureValueRecovery2Client = secureValueRecovery2Client;
@ -221,8 +218,6 @@ public class AccountsManager {
redisSet(account); redisSet(account);
pendingAccounts.remove(number);
// In terms of previously-existing accounts, there are three possible cases: // In terms of previously-existing accounts, there are three possible cases:
// //
// 1. This is a completely new account; there was no pre-existing account and no recently-deleted account // 1. This is a completely new account; there was no pre-existing account and no recently-deleted account

View File

@ -51,10 +51,8 @@ import org.whispersystems.textsecuregcm.storage.RegistrationRecoveryPasswords;
import org.whispersystems.textsecuregcm.storage.RegistrationRecoveryPasswordsManager; import org.whispersystems.textsecuregcm.storage.RegistrationRecoveryPasswordsManager;
import org.whispersystems.textsecuregcm.storage.ReportMessageDynamoDb; import org.whispersystems.textsecuregcm.storage.ReportMessageDynamoDb;
import org.whispersystems.textsecuregcm.storage.ReportMessageManager; import org.whispersystems.textsecuregcm.storage.ReportMessageManager;
import org.whispersystems.textsecuregcm.storage.StoredVerificationCodeManager;
import org.whispersystems.textsecuregcm.storage.UsernameHashNotAvailableException; import org.whispersystems.textsecuregcm.storage.UsernameHashNotAvailableException;
import org.whispersystems.textsecuregcm.storage.UsernameReservationNotFoundException; import org.whispersystems.textsecuregcm.storage.UsernameReservationNotFoundException;
import org.whispersystems.textsecuregcm.storage.VerificationCodeStore;
import org.whispersystems.textsecuregcm.util.DynamoDbFromConfig; import org.whispersystems.textsecuregcm.util.DynamoDbFromConfig;
import reactor.core.scheduler.Scheduler; import reactor.core.scheduler.Scheduler;
import reactor.core.scheduler.Schedulers; import reactor.core.scheduler.Schedulers;
@ -145,8 +143,6 @@ public class AssignUsernameCommand extends EnvironmentCommand<WhisperServerConfi
DeletedAccounts deletedAccounts = new DeletedAccounts(dynamoDbClient, DeletedAccounts deletedAccounts = new DeletedAccounts(dynamoDbClient,
configuration.getDynamoDbTables().getDeletedAccounts().getTableName()); configuration.getDynamoDbTables().getDeletedAccounts().getTableName());
VerificationCodeStore pendingAccounts = new VerificationCodeStore(dynamoDbClient,
configuration.getDynamoDbTables().getPendingAccounts().getTableName());
RegistrationRecoveryPasswords registrationRecoveryPasswords = new RegistrationRecoveryPasswords( RegistrationRecoveryPasswords registrationRecoveryPasswords = new RegistrationRecoveryPasswords(
configuration.getDynamoDbTables().getRegistrationRecovery().getTableName(), configuration.getDynamoDbTables().getRegistrationRecovery().getTableName(),
configuration.getDynamoDbTables().getRegistrationRecovery().getExpiration(), configuration.getDynamoDbTables().getRegistrationRecovery().getExpiration(),
@ -209,10 +205,9 @@ public class AssignUsernameCommand extends EnvironmentCommand<WhisperServerConfi
reportMessageManager, messageDeletionExecutor); reportMessageManager, messageDeletionExecutor);
AccountLockManager accountLockManager = new AccountLockManager(dynamoDbClient, AccountLockManager accountLockManager = new AccountLockManager(dynamoDbClient,
configuration.getDynamoDbTables().getDeletedAccountsLock().getTableName()); configuration.getDynamoDbTables().getDeletedAccountsLock().getTableName());
StoredVerificationCodeManager pendingAccountsManager = new StoredVerificationCodeManager(pendingAccounts);
AccountsManager accountsManager = new AccountsManager(accounts, phoneNumberIdentifiers, cacheCluster, AccountsManager accountsManager = new AccountsManager(accounts, phoneNumberIdentifiers, cacheCluster,
accountLockManager, deletedAccounts, keys, messagesManager, profilesManager, accountLockManager, deletedAccounts, keys, messagesManager, profilesManager,
pendingAccountsManager, secureStorageClient, secureBackupClient, secureValueRecovery2Client, clientPresenceManager, secureStorageClient, secureBackupClient, secureValueRecovery2Client, clientPresenceManager,
experimentEnrollmentManager, registrationRecoveryPasswordsManager, Clock.systemUTC()); experimentEnrollmentManager, registrationRecoveryPasswordsManager, Clock.systemUTC());
final String usernameHash = namespace.getString("usernameHash"); final String usernameHash = namespace.getString("usernameHash");

View File

@ -44,8 +44,6 @@ import org.whispersystems.textsecuregcm.storage.RegistrationRecoveryPasswords;
import org.whispersystems.textsecuregcm.storage.RegistrationRecoveryPasswordsManager; import org.whispersystems.textsecuregcm.storage.RegistrationRecoveryPasswordsManager;
import org.whispersystems.textsecuregcm.storage.ReportMessageDynamoDb; import org.whispersystems.textsecuregcm.storage.ReportMessageDynamoDb;
import org.whispersystems.textsecuregcm.storage.ReportMessageManager; import org.whispersystems.textsecuregcm.storage.ReportMessageManager;
import org.whispersystems.textsecuregcm.storage.StoredVerificationCodeManager;
import org.whispersystems.textsecuregcm.storage.VerificationCodeStore;
import org.whispersystems.textsecuregcm.util.DynamoDbFromConfig; import org.whispersystems.textsecuregcm.util.DynamoDbFromConfig;
import reactor.core.scheduler.Scheduler; import reactor.core.scheduler.Scheduler;
import reactor.core.scheduler.Schedulers; import reactor.core.scheduler.Schedulers;
@ -61,7 +59,6 @@ record CommandDependencies(
ReportMessageManager reportMessageManager, ReportMessageManager reportMessageManager,
MessagesCache messagesCache, MessagesCache messagesCache,
MessagesManager messagesManager, MessagesManager messagesManager,
StoredVerificationCodeManager pendingAccountsManager,
ClientPresenceManager clientPresenceManager, ClientPresenceManager clientPresenceManager,
KeysManager keysManager, KeysManager keysManager,
FaultTolerantRedisCluster cacheCluster, FaultTolerantRedisCluster cacheCluster,
@ -122,8 +119,6 @@ record CommandDependencies(
DeletedAccounts deletedAccounts = new DeletedAccounts(dynamoDbClient, DeletedAccounts deletedAccounts = new DeletedAccounts(dynamoDbClient,
configuration.getDynamoDbTables().getDeletedAccounts().getTableName()); configuration.getDynamoDbTables().getDeletedAccounts().getTableName());
VerificationCodeStore pendingAccounts = new VerificationCodeStore(dynamoDbClient,
configuration.getDynamoDbTables().getPendingAccounts().getTableName());
RegistrationRecoveryPasswords registrationRecoveryPasswords = new RegistrationRecoveryPasswords( RegistrationRecoveryPasswords registrationRecoveryPasswords = new RegistrationRecoveryPasswords(
configuration.getDynamoDbTables().getRegistrationRecovery().getTableName(), configuration.getDynamoDbTables().getRegistrationRecovery().getTableName(),
configuration.getDynamoDbTables().getRegistrationRecovery().getExpiration(), configuration.getDynamoDbTables().getRegistrationRecovery().getExpiration(),
@ -188,10 +183,9 @@ record CommandDependencies(
reportMessageManager, messageDeletionExecutor); reportMessageManager, messageDeletionExecutor);
AccountLockManager accountLockManager = new AccountLockManager(dynamoDbClient, AccountLockManager accountLockManager = new AccountLockManager(dynamoDbClient,
configuration.getDynamoDbTables().getDeletedAccountsLock().getTableName()); configuration.getDynamoDbTables().getDeletedAccountsLock().getTableName());
StoredVerificationCodeManager pendingAccountsManager = new StoredVerificationCodeManager(pendingAccounts);
AccountsManager accountsManager = new AccountsManager(accounts, phoneNumberIdentifiers, cacheCluster, AccountsManager accountsManager = new AccountsManager(accounts, phoneNumberIdentifiers, cacheCluster,
accountLockManager, deletedAccounts, keys, messagesManager, profilesManager, accountLockManager, deletedAccounts, keys, messagesManager, profilesManager,
pendingAccountsManager, secureStorageClient, secureBackupClient, secureValueRecovery2Client, secureStorageClient, secureBackupClient, secureValueRecovery2Client,
clientPresenceManager, clientPresenceManager,
experimentEnrollmentManager, registrationRecoveryPasswordsManager, clock); experimentEnrollmentManager, registrationRecoveryPasswordsManager, clock);
@ -204,7 +198,6 @@ record CommandDependencies(
reportMessageManager, reportMessageManager,
messagesCache, messagesCache,
messagesManager, messagesManager,
pendingAccountsManager,
clientPresenceManager, clientPresenceManager,
keys, keys,
cacheCluster, cacheCluster,

View File

@ -112,7 +112,6 @@ class AccountsManagerChangeNumberIntegrationTest {
keysManager, keysManager,
mock(MessagesManager.class), mock(MessagesManager.class),
mock(ProfilesManager.class), mock(ProfilesManager.class),
mock(StoredVerificationCodeManager.class),
secureStorageClient, secureStorageClient,
secureBackupClient, secureBackupClient,
svr2Client, svr2Client,

View File

@ -118,7 +118,6 @@ class AccountsManagerConcurrentModificationIntegrationTest {
mock(KeysManager.class), mock(KeysManager.class),
mock(MessagesManager.class), mock(MessagesManager.class),
mock(ProfilesManager.class), mock(ProfilesManager.class),
mock(StoredVerificationCodeManager.class),
mock(SecureStorageClient.class), mock(SecureStorageClient.class),
mock(SecureBackupClient.class), mock(SecureBackupClient.class),
mock(SecureValueRecovery2Client.class), mock(SecureValueRecovery2Client.class),

View File

@ -201,7 +201,6 @@ class AccountsManagerTest {
keysManager, keysManager,
messagesManager, messagesManager,
profilesManager, profilesManager,
mock(StoredVerificationCodeManager.class),
storageClient, storageClient,
backupClient, backupClient,
svr2Client, svr2Client,

View File

@ -123,7 +123,6 @@ class AccountsManagerUsernameIntegrationTest {
mock(KeysManager.class), mock(KeysManager.class),
mock(MessagesManager.class), mock(MessagesManager.class),
mock(ProfilesManager.class), mock(ProfilesManager.class),
mock(StoredVerificationCodeManager.class),
mock(SecureStorageClient.class), mock(SecureStorageClient.class),
mock(SecureBackupClient.class), mock(SecureBackupClient.class),
mock(SecureValueRecovery2Client.class), mock(SecureValueRecovery2Client.class),

View File

@ -169,7 +169,6 @@ class AccountsTest {
mock(KeysManager.class), mock(KeysManager.class),
mock(MessagesManager.class), mock(MessagesManager.class),
mock(ProfilesManager.class), mock(ProfilesManager.class),
mock(StoredVerificationCodeManager.class),
mock(SecureStorageClient.class), mock(SecureStorageClient.class),
mock(SecureBackupClient.class), mock(SecureBackupClient.class),
mock(SecureValueRecovery2Client.class), mock(SecureValueRecovery2Client.class),