Skip to content

Commit

Permalink
Specify AuthCheckResponseV3 serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-signal authored and jon-signal committed May 22, 2024
1 parent 7980da9 commit dd47594
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
package org.whispersystems.textsecuregcm.entities;

import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.annotation.Nullable;
import javax.validation.constraints.NotNull;
import org.whispersystems.textsecuregcm.util.ByteArrayAdapter;

public record AuthCheckResponseV3(
@Schema(description = """
Expand All @@ -18,12 +21,15 @@ public record AuthCheckResponseV3(
@NotNull Map<String, Result> matches) {

public record Result(
@Schema(description = "The status of the credential, either match, no-match, or invalid")
@Schema(description = "The status of the credential. Either match, no-match, or invalid")
CredentialStatus status,

@Schema(description = """
If the credential was a match, the stored shareSet that can be used to restore a value from SVR. Encoded as
""")
If the credential was a match, the stored shareSet that can be used to restore a value from SVR. Encoded in
standard un-padded base64.
""", implementation = String.class)
@JsonSerialize(using = ByteArrayAdapter.Serializing.class)
@JsonDeserialize(using = ByteArrayAdapter.Deserializing.class)
@Nullable byte[] shareSet) {

public static Result invalid() {
Expand Down

0 comments on commit dd47594

Please sign in to comment.