mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 16:08:03 +01:00
Return key transparency protobufs encoded as base64 strings
This commit is contained in:
@@ -8,44 +8,14 @@ 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 katie.FullTreeHead;
|
||||
import katie.MonitorProof;
|
||||
import org.whispersystems.textsecuregcm.util.ByteArrayAdapter;
|
||||
import org.whispersystems.textsecuregcm.util.FullTreeHeadProtobufAdapter;
|
||||
import org.whispersystems.textsecuregcm.util.MonitorProofProtobufAdapter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public record KeyTransparencyMonitorResponse(
|
||||
@NotNull
|
||||
@JsonSerialize(using = FullTreeHeadProtobufAdapter.Serializer.class)
|
||||
@JsonDeserialize(using = FullTreeHeadProtobufAdapter.Deserializer.class)
|
||||
@Schema(description = """
|
||||
The key transparency log's tree head along with a consistency proof and possibly an auditor-signed tree head
|
||||
""")
|
||||
FullTreeHead fullTreeHead,
|
||||
|
||||
@NotNull
|
||||
@JsonSerialize(using = MonitorProofProtobufAdapter.Serializer.class)
|
||||
@JsonDeserialize(using = MonitorProofProtobufAdapter.Deserializer.class)
|
||||
@Schema(description = "The monitor proof for the aci search key")
|
||||
MonitorProof aciMonitorProof,
|
||||
|
||||
@JsonSerialize(contentUsing = MonitorProofProtobufAdapter.Serializer.class)
|
||||
@JsonDeserialize(contentUsing = MonitorProofProtobufAdapter.Deserializer.class)
|
||||
@Schema(description = "The monitor proof for the e164 search key")
|
||||
Optional<MonitorProof> e164MonitorProof,
|
||||
|
||||
@JsonSerialize(contentUsing = MonitorProofProtobufAdapter.Serializer.class)
|
||||
@JsonDeserialize(contentUsing = MonitorProofProtobufAdapter.Deserializer.class)
|
||||
@Schema(description = "The monitor proof for the username hash search key")
|
||||
Optional<MonitorProof> usernameHashMonitorProof,
|
||||
|
||||
@NotNull
|
||||
@JsonSerialize(contentUsing = ByteArrayAdapter.Serializing.class)
|
||||
@JsonDeserialize(contentUsing = ByteArrayAdapter.Deserializing.class)
|
||||
@Schema(description = "A list of hashes encoded in standard, unpadded base64 that prove inclusion across all monitor proofs ")
|
||||
List<byte[]> inclusionProof
|
||||
@JsonSerialize(using = ByteArrayAdapter.Serializing.class)
|
||||
@JsonDeserialize(using = ByteArrayAdapter.Deserializing.class)
|
||||
@Schema(description = "The monitor response encoded in standard un-padded base64")
|
||||
byte[] monitorResponse
|
||||
) {}
|
||||
|
||||
@@ -8,26 +8,25 @@ 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 katie.SearchResponse;
|
||||
import org.whispersystems.textsecuregcm.util.SearchResponseProtobufAdapter;
|
||||
import org.whispersystems.textsecuregcm.util.ByteArrayAdapter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Optional;
|
||||
|
||||
public record KeyTransparencySearchResponse(
|
||||
@NotNull
|
||||
@JsonSerialize(using = SearchResponseProtobufAdapter.Serializer.class)
|
||||
@JsonDeserialize(using = SearchResponseProtobufAdapter.Deserializer.class)
|
||||
@Schema(description = "The search response for the aci search key")
|
||||
SearchResponse aciSearchResponse,
|
||||
@JsonSerialize(using = ByteArrayAdapter.Serializing.class)
|
||||
@JsonDeserialize(using = ByteArrayAdapter.Deserializing.class)
|
||||
@Schema(description = "The search response for the aci search key encoded in standard un-padded base64")
|
||||
byte[] aciSearchResponse,
|
||||
|
||||
@JsonSerialize(contentUsing = SearchResponseProtobufAdapter.Serializer.class)
|
||||
@JsonDeserialize(contentUsing = SearchResponseProtobufAdapter.Deserializer.class)
|
||||
@Schema(description = "The search response for the e164 search key")
|
||||
Optional<SearchResponse> e164SearchResponse,
|
||||
@JsonSerialize(contentUsing = ByteArrayAdapter.Serializing.class)
|
||||
@JsonDeserialize(contentUsing = ByteArrayAdapter.Deserializing.class)
|
||||
@Schema(description = "The search response for the e164 search key encoded in standard un-padded base64")
|
||||
Optional<byte[]> e164SearchResponse,
|
||||
|
||||
@JsonSerialize(contentUsing = SearchResponseProtobufAdapter.Serializer.class)
|
||||
@JsonDeserialize(contentUsing = SearchResponseProtobufAdapter.Deserializer.class)
|
||||
@Schema(description = "The search response for the username hash search key")
|
||||
Optional<SearchResponse> usernameHashSearchResponse
|
||||
@JsonSerialize(contentUsing = ByteArrayAdapter.Serializing.class)
|
||||
@JsonDeserialize(contentUsing = ByteArrayAdapter.Deserializing.class)
|
||||
@Schema(description = "The search response for the username hash search key encoded in standard un-padded base64")
|
||||
Optional<byte[]> usernameHashSearchResponse
|
||||
) {}
|
||||
|
||||
Reference in New Issue
Block a user