Update key transparency gRPC client
This commit is contained in:
parent
80cd5d9ccc
commit
ca2845bcb0
|
@ -13,7 +13,7 @@ import io.grpc.StatusRuntimeException;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import katie.MonitorKey;
|
import org.signal.keytransparency.client.MonitorKey;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice;
|
import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice;
|
||||||
|
|
|
@ -19,13 +19,11 @@ import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import io.grpc.TlsChannelCredentials;
|
import io.grpc.TlsChannelCredentials;
|
||||||
import katie.ConsistencyParameters;
|
import org.signal.keytransparency.client.ConsistencyParameters;
|
||||||
import katie.KatieGrpc;
|
import org.signal.keytransparency.client.KeyTransparencyQueryServiceGrpc;
|
||||||
import katie.MonitorKey;
|
import org.signal.keytransparency.client.MonitorKey;
|
||||||
import katie.MonitorRequest;
|
import org.signal.keytransparency.client.MonitorRequest;
|
||||||
import katie.MonitorResponse;
|
import org.signal.keytransparency.client.SearchRequest;
|
||||||
import katie.SearchRequest;
|
|
||||||
import katie.SearchResponse;
|
|
||||||
import org.whispersystems.textsecuregcm.util.CompletableFutureUtil;
|
import org.whispersystems.textsecuregcm.util.CompletableFutureUtil;
|
||||||
|
|
||||||
public class KeyTransparencyServiceClient implements Managed {
|
public class KeyTransparencyServiceClient implements Managed {
|
||||||
|
@ -35,7 +33,7 @@ public class KeyTransparencyServiceClient implements Managed {
|
||||||
private final int port;
|
private final int port;
|
||||||
private final ChannelCredentials tlsChannelCredentials;
|
private final ChannelCredentials tlsChannelCredentials;
|
||||||
private ManagedChannel channel;
|
private ManagedChannel channel;
|
||||||
private KatieGrpc.KatieFutureStub stub;
|
private KeyTransparencyQueryServiceGrpc.KeyTransparencyQueryServiceFutureStub stub;
|
||||||
|
|
||||||
public KeyTransparencyServiceClient(
|
public KeyTransparencyServiceClient(
|
||||||
final String host,
|
final String host,
|
||||||
|
@ -100,7 +98,7 @@ public class KeyTransparencyServiceClient implements Managed {
|
||||||
channel = Grpc.newChannelBuilderForAddress(host, port, tlsChannelCredentials)
|
channel = Grpc.newChannelBuilderForAddress(host, port, tlsChannelCredentials)
|
||||||
.idleTimeout(1, TimeUnit.MINUTES)
|
.idleTimeout(1, TimeUnit.MINUTES)
|
||||||
.build();
|
.build();
|
||||||
stub = KatieGrpc.newFutureStub(channel);
|
stub = KeyTransparencyQueryServiceGrpc.newFutureStub(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,16 +6,22 @@
|
||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
|
|
||||||
option java_multiple_files = true;
|
option java_multiple_files = true;
|
||||||
|
option java_package = "org.signal.keytransparency.client";
|
||||||
|
|
||||||
package katie;
|
package kt_query;
|
||||||
|
|
||||||
service Katie {
|
|
||||||
/**
|
/**
|
||||||
* Provides proof that a specific version of the search key exists in the log tree.
|
* An external-facing, read-only key transparency service used by Signal's chat server
|
||||||
|
* to look up and monitor search keys.
|
||||||
|
*/
|
||||||
|
service KeyTransparencyQueryService {
|
||||||
|
/**
|
||||||
|
* An endpoint used by clients to search for a given key in the transparency log.
|
||||||
|
* The server returns proof that the search key exists in the log.
|
||||||
*/
|
*/
|
||||||
rpc Search(SearchRequest) returns (SearchResponse) {}
|
rpc Search(SearchRequest) returns (SearchResponse) {}
|
||||||
/**
|
/**
|
||||||
* Allows users to monitor a set of search keys by providing proof that the log tree continues to be
|
* An endpoint that allows users to monitor a set of search keys by returning proof that the log continues to be
|
||||||
* constructed correctly in later entries for those search keys.
|
* constructed correctly in later entries for those search keys.
|
||||||
*/
|
*/
|
||||||
rpc Monitor(MonitorRequest) returns (MonitorResponse) {}
|
rpc Monitor(MonitorRequest) returns (MonitorResponse) {}
|
||||||
|
|
Loading…
Reference in New Issue