mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 21:58:02 +01:00
Update KT search requests to include a value and maybe an unidentified access key
This commit is contained in:
@@ -8,11 +8,15 @@ package org.whispersystems.textsecuregcm.entities;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.signal.libsignal.protocol.IdentityKey;
|
||||
import org.whispersystems.textsecuregcm.identity.AciServiceIdentifier;
|
||||
import org.whispersystems.textsecuregcm.util.ByteArrayBase64UrlAdapter;
|
||||
import org.whispersystems.textsecuregcm.util.ByteArrayBase64WithPaddingAdapter;
|
||||
import org.whispersystems.textsecuregcm.util.E164;
|
||||
import org.whispersystems.textsecuregcm.util.IdentityKeyAdapter;
|
||||
import org.whispersystems.textsecuregcm.util.ServiceIdentifierAdapter;
|
||||
|
||||
import javax.validation.constraints.AssertTrue;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Positive;
|
||||
import java.util.Optional;
|
||||
@@ -33,9 +37,25 @@ public record KeyTransparencySearchRequest(
|
||||
@Schema(description = "The username hash to look up, encoded in web-safe unpadded base64.")
|
||||
Optional<byte[]> usernameHash,
|
||||
|
||||
@NotNull
|
||||
@JsonSerialize(using = IdentityKeyAdapter.Serializer.class)
|
||||
@JsonDeserialize(using = IdentityKeyAdapter.Deserializer.class)
|
||||
@Schema(description="The public aci identity key associated with the provided aci")
|
||||
IdentityKey aciIdentityKey,
|
||||
|
||||
@JsonSerialize(contentUsing = ByteArrayBase64WithPaddingAdapter.Serializing.class)
|
||||
@JsonDeserialize(contentUsing = ByteArrayBase64WithPaddingAdapter.Deserializing.class)
|
||||
@Schema(description="The unidentified access key associated with the account")
|
||||
Optional<byte[]> unidentifiedAccessKey,
|
||||
|
||||
@Schema(description = "The non-distinguished tree head size to prove consistency against.")
|
||||
Optional<@Positive Long> lastTreeHeadSize,
|
||||
|
||||
@Schema(description = "The distinguished tree head size to prove consistency against.")
|
||||
Optional<@Positive Long> distinguishedTreeHeadSize
|
||||
) {}
|
||||
) {
|
||||
@AssertTrue
|
||||
public boolean isUnidentifiedAccessKeyProvidedWithE164() {
|
||||
return unidentifiedAccessKey.isPresent() == e164.isPresent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user