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 f0882ced4..dd05ef4ab 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java @@ -177,7 +177,7 @@ public class AccountController { @Produces(MediaType.APPLICATION_JSON) @Path("/registration_lock") public void setRegistrationLock(@Auth AuthenticatedDevice auth, @NotNull @Valid RegistrationLock accountLock) { - final SaltedTokenHash credentials = SaltedTokenHash.generateFor(accountLock.getRegistrationLock()); + final SaltedTokenHash credentials = SaltedTokenHash.generateFor(accountLock.registrationLock()); final Account account = accounts.getByAccountIdentifier(auth.accountIdentifier()) .orElseThrow(() -> new WebApplicationException(Status.UNAUTHORIZED)); diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationLock.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationLock.java index f6fa2ee90..4b2d8bd0a 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationLock.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationLock.java @@ -6,26 +6,8 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.VisibleForTesting; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Size; -public class RegistrationLock { - - @JsonProperty - @Size(min=64, max=64) - @NotEmpty - private String registrationLock; - - public RegistrationLock() {} - - @VisibleForTesting - public RegistrationLock(String registrationLock) { - this.registrationLock = registrationLock; - } - - public String getRegistrationLock() { - return registrationLock; - } - +public record RegistrationLock(@JsonProperty @Size(min = 64, max = 64) @NotEmpty String registrationLock) { }