Remove payments list from Account

This commit is contained in:
Ehren Kret
2021-02-19 11:44:59 -06:00
parent aa8525385a
commit 93f845610d
10 changed files with 46 additions and 269 deletions

View File

@@ -65,7 +65,6 @@ import org.whispersystems.textsecuregcm.storage.Account;
import org.whispersystems.textsecuregcm.storage.AccountsManager;
import org.whispersystems.textsecuregcm.storage.Device;
import org.whispersystems.textsecuregcm.storage.MessagesManager;
import org.whispersystems.textsecuregcm.storage.PaymentAddressList;
import org.whispersystems.textsecuregcm.storage.PendingAccountsManager;
import org.whispersystems.textsecuregcm.storage.UsernamesManager;
import org.whispersystems.textsecuregcm.util.Constants;
@@ -473,7 +472,6 @@ public class AccountController {
account.setUnidentifiedAccessKey(attributes.getUnidentifiedAccessKey());
account.setUnrestrictedUnidentifiedAccess(attributes.isUnrestrictedUnidentifiedAccess());
account.setPayments(attributes.getPayments());
account.setDiscoverableByPhoneNumber(attributes.isDiscoverableByPhoneNumber());
accounts.update(account);
@@ -527,16 +525,6 @@ public class AccountController {
return Response.ok().build();
}
@Timed
@PUT
@Path("/payments")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public void setPayments(@Auth Account account, @Valid PaymentAddressList payments) {
account.setPayments(payments.getPayments());
accounts.update(account);
}
private CaptchaRequirement requiresCaptcha(String number, String transport, String forwardedFor,
String requester,
Optional<String> captchaToken,
@@ -641,7 +629,6 @@ public class AccountController {
setAccountRegistrationLockFromAttributes(account, accountAttributes);
account.setUnidentifiedAccessKey(accountAttributes.getUnidentifiedAccessKey());
account.setUnrestrictedUnidentifiedAccess(accountAttributes.isUnrestrictedUnidentifiedAccess());
account.setPayments(accountAttributes.getPayments());
account.setDiscoverableByPhoneNumber(accountAttributes.isDiscoverableByPhoneNumber());
if (accounts.create(account)) {

View File

@@ -217,8 +217,7 @@ public class ProfileController {
new UserCapabilities(accountProfile.get().isGroupsV2Supported(), accountProfile.get().isGv1MigrationSupported()),
username.orElse(null),
null,
credential.orElse(null),
accountProfile.get().getPayments()));
credential.orElse(null)));
} catch (InvalidInputException e) {
logger.info("Bad profile request", e);
throw new WebApplicationException(Response.Status.BAD_REQUEST);
@@ -258,8 +257,7 @@ public class ProfileController {
new UserCapabilities(accountProfile.get().isGroupsV2Supported(), accountProfile.get().isGv1MigrationSupported()),
username,
accountProfile.get().getUuid(),
null,
accountProfile.get().getPayments());
null);
}
private Optional<ProfileKeyCredentialResponse> getProfileCredential(Optional<String> encodedProfileCredentialRequest,
@@ -334,8 +332,7 @@ public class ProfileController {
new UserCapabilities(accountProfile.get().isGroupsV2Supported(), accountProfile.get().isGv1MigrationSupported()),
username.orElse(null),
null,
null,
accountProfile.get().getPayments());
null);
}