mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-19 04:58:07 +01:00
Add PNI to GroupCredentials responses that contain AuthCredentialWithPni instances
This commit is contained in:
committed by
Jon Chambers
parent
7d4a8d03a4
commit
6b6f9b2405
@@ -114,7 +114,7 @@ public class CertificateController {
|
||||
i));
|
||||
}
|
||||
|
||||
return new GroupCredentials(credentials);
|
||||
return new GroupCredentials(credentials, null);
|
||||
}
|
||||
|
||||
@Timed
|
||||
@@ -153,6 +153,6 @@ public class CertificateController {
|
||||
redemption = redemption.plus(Duration.ofDays(1));
|
||||
}
|
||||
|
||||
return new GroupCredentials(credentials);
|
||||
return new GroupCredentials(credentials, pni);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,43 +5,12 @@
|
||||
|
||||
package org.whispersystems.textsecuregcm.entities;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class GroupCredentials {
|
||||
public record GroupCredentials(List<GroupCredential> credentials, @Nullable UUID pni) {
|
||||
|
||||
private final List<GroupCredential> credentials;
|
||||
|
||||
@JsonCreator
|
||||
public GroupCredentials(
|
||||
@JsonProperty("credentials") List<GroupCredential> credentials) {
|
||||
this.credentials = credentials;
|
||||
}
|
||||
|
||||
public List<GroupCredential> getCredentials() {
|
||||
return credentials;
|
||||
}
|
||||
|
||||
public static class GroupCredential {
|
||||
|
||||
private final byte[] credential;
|
||||
private final int redemptionTime;
|
||||
|
||||
@JsonCreator
|
||||
public GroupCredential(
|
||||
@JsonProperty("credential") byte[] credential,
|
||||
@JsonProperty("redemptionTime") int redemptionTime) {
|
||||
this.credential = credential;
|
||||
this.redemptionTime = redemptionTime;
|
||||
}
|
||||
|
||||
public byte[] getCredential() {
|
||||
return credential;
|
||||
}
|
||||
|
||||
public int getRedemptionTime() {
|
||||
return redemptionTime;
|
||||
}
|
||||
public record GroupCredential(byte[] credential, int redemptionTime) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user