diff --git a/xds/src/generated/main/grpc/io/envoyproxy/envoy/service/discovery/v2/SecretDiscoveryServiceGrpc.java b/xds/src/generated/main/grpc/io/envoyproxy/envoy/service/discovery/v2/SecretDiscoveryServiceGrpc.java new file mode 100644 index 0000000000..8b7452ee2b --- /dev/null +++ b/xds/src/generated/main/grpc/io/envoyproxy/envoy/service/discovery/v2/SecretDiscoveryServiceGrpc.java @@ -0,0 +1,395 @@ +package io.envoyproxy.envoy.service.discovery.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: envoy/service/discovery/v2/sds.proto") +public final class SecretDiscoveryServiceGrpc { + + private SecretDiscoveryServiceGrpc() {} + + public static final String SERVICE_NAME = "envoy.service.discovery.v2.SecretDiscoveryService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getDeltaSecretsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeltaSecrets", + requestType = io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest.class, + responseType = io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getDeltaSecretsMethod() { + io.grpc.MethodDescriptor getDeltaSecretsMethod; + if ((getDeltaSecretsMethod = SecretDiscoveryServiceGrpc.getDeltaSecretsMethod) == null) { + synchronized (SecretDiscoveryServiceGrpc.class) { + if ((getDeltaSecretsMethod = SecretDiscoveryServiceGrpc.getDeltaSecretsMethod) == null) { + SecretDiscoveryServiceGrpc.getDeltaSecretsMethod = getDeltaSecretsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeltaSecrets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse.getDefaultInstance())) + .setSchemaDescriptor(new SecretDiscoveryServiceMethodDescriptorSupplier("DeltaSecrets")) + .build(); + } + } + } + return getDeltaSecretsMethod; + } + + private static volatile io.grpc.MethodDescriptor getStreamSecretsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamSecrets", + requestType = io.envoyproxy.envoy.api.v2.DiscoveryRequest.class, + responseType = io.envoyproxy.envoy.api.v2.DiscoveryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getStreamSecretsMethod() { + io.grpc.MethodDescriptor getStreamSecretsMethod; + if ((getStreamSecretsMethod = SecretDiscoveryServiceGrpc.getStreamSecretsMethod) == null) { + synchronized (SecretDiscoveryServiceGrpc.class) { + if ((getStreamSecretsMethod = SecretDiscoveryServiceGrpc.getStreamSecretsMethod) == null) { + SecretDiscoveryServiceGrpc.getStreamSecretsMethod = getStreamSecretsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamSecrets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.envoyproxy.envoy.api.v2.DiscoveryRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.envoyproxy.envoy.api.v2.DiscoveryResponse.getDefaultInstance())) + .setSchemaDescriptor(new SecretDiscoveryServiceMethodDescriptorSupplier("StreamSecrets")) + .build(); + } + } + } + return getStreamSecretsMethod; + } + + private static volatile io.grpc.MethodDescriptor getFetchSecretsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FetchSecrets", + requestType = io.envoyproxy.envoy.api.v2.DiscoveryRequest.class, + responseType = io.envoyproxy.envoy.api.v2.DiscoveryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getFetchSecretsMethod() { + io.grpc.MethodDescriptor getFetchSecretsMethod; + if ((getFetchSecretsMethod = SecretDiscoveryServiceGrpc.getFetchSecretsMethod) == null) { + synchronized (SecretDiscoveryServiceGrpc.class) { + if ((getFetchSecretsMethod = SecretDiscoveryServiceGrpc.getFetchSecretsMethod) == null) { + SecretDiscoveryServiceGrpc.getFetchSecretsMethod = getFetchSecretsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FetchSecrets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.envoyproxy.envoy.api.v2.DiscoveryRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.envoyproxy.envoy.api.v2.DiscoveryResponse.getDefaultInstance())) + .setSchemaDescriptor(new SecretDiscoveryServiceMethodDescriptorSupplier("FetchSecrets")) + .build(); + } + } + } + return getFetchSecretsMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static SecretDiscoveryServiceStub newStub(io.grpc.Channel channel) { + return new SecretDiscoveryServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SecretDiscoveryServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new SecretDiscoveryServiceBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static SecretDiscoveryServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + return new SecretDiscoveryServiceFutureStub(channel); + } + + /** + */ + public static abstract class SecretDiscoveryServiceImplBase implements io.grpc.BindableService { + + /** + */ + public io.grpc.stub.StreamObserver deltaSecrets( + io.grpc.stub.StreamObserver responseObserver) { + return asyncUnimplementedStreamingCall(getDeltaSecretsMethod(), responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver streamSecrets( + io.grpc.stub.StreamObserver responseObserver) { + return asyncUnimplementedStreamingCall(getStreamSecretsMethod(), responseObserver); + } + + /** + */ + public void fetchSecrets(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getFetchSecretsMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeltaSecretsMethod(), + asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequest, + io.envoyproxy.envoy.api.v2.DeltaDiscoveryResponse>( + this, METHODID_DELTA_SECRETS))) + .addMethod( + getStreamSecretsMethod(), + asyncBidiStreamingCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + this, METHODID_STREAM_SECRETS))) + .addMethod( + getFetchSecretsMethod(), + asyncUnaryCall( + new MethodHandlers< + io.envoyproxy.envoy.api.v2.DiscoveryRequest, + io.envoyproxy.envoy.api.v2.DiscoveryResponse>( + this, METHODID_FETCH_SECRETS))) + .build(); + } + } + + /** + */ + public static final class SecretDiscoveryServiceStub extends io.grpc.stub.AbstractStub { + private SecretDiscoveryServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private SecretDiscoveryServiceStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecretDiscoveryServiceStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new SecretDiscoveryServiceStub(channel, callOptions); + } + + /** + */ + public io.grpc.stub.StreamObserver deltaSecrets( + io.grpc.stub.StreamObserver responseObserver) { + return asyncBidiStreamingCall( + getChannel().newCall(getDeltaSecretsMethod(), getCallOptions()), responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver streamSecrets( + io.grpc.stub.StreamObserver responseObserver) { + return asyncBidiStreamingCall( + getChannel().newCall(getStreamSecretsMethod(), getCallOptions()), responseObserver); + } + + /** + */ + public void fetchSecrets(io.envoyproxy.envoy.api.v2.DiscoveryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getFetchSecretsMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class SecretDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractStub { + private SecretDiscoveryServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private SecretDiscoveryServiceBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecretDiscoveryServiceBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new SecretDiscoveryServiceBlockingStub(channel, callOptions); + } + + /** + */ + public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchSecrets(io.envoyproxy.envoy.api.v2.DiscoveryRequest request) { + return blockingUnaryCall( + getChannel(), getFetchSecretsMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class SecretDiscoveryServiceFutureStub extends io.grpc.stub.AbstractStub { + private SecretDiscoveryServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private SecretDiscoveryServiceFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecretDiscoveryServiceFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new SecretDiscoveryServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture fetchSecrets( + io.envoyproxy.envoy.api.v2.DiscoveryRequest request) { + return futureUnaryCall( + getChannel().newCall(getFetchSecretsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_FETCH_SECRETS = 0; + private static final int METHODID_DELTA_SECRETS = 1; + private static final int METHODID_STREAM_SECRETS = 2; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SecretDiscoveryServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SecretDiscoveryServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_FETCH_SECRETS: + serviceImpl.fetchSecrets((io.envoyproxy.envoy.api.v2.DiscoveryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELTA_SECRETS: + return (io.grpc.stub.StreamObserver) serviceImpl.deltaSecrets( + (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_STREAM_SECRETS: + return (io.grpc.stub.StreamObserver) serviceImpl.streamSecrets( + (io.grpc.stub.StreamObserver) responseObserver); + default: + throw new AssertionError(); + } + } + } + + private static abstract class SecretDiscoveryServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SecretDiscoveryServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return io.envoyproxy.envoy.service.discovery.v2.SdsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SecretDiscoveryService"); + } + } + + private static final class SecretDiscoveryServiceFileDescriptorSupplier + extends SecretDiscoveryServiceBaseDescriptorSupplier { + SecretDiscoveryServiceFileDescriptorSupplier() {} + } + + private static final class SecretDiscoveryServiceMethodDescriptorSupplier + extends SecretDiscoveryServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SecretDiscoveryServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SecretDiscoveryServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SecretDiscoveryServiceFileDescriptorSupplier()) + .addMethod(getDeltaSecretsMethod()) + .addMethod(getStreamSecretsMethod()) + .addMethod(getFetchSecretsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/xds/third_party/envoy/import.sh b/xds/third_party/envoy/import.sh index 3088c31271..7a253716b0 100755 --- a/xds/third_party/envoy/import.sh +++ b/xds/third_party/envoy/import.sh @@ -50,6 +50,7 @@ envoy/config/filter/accesslog/v2/accesslog.proto envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto envoy/config/listener/v2/api_listener.proto envoy/service/discovery/v2/ads.proto +envoy/service/discovery/v2/sds.proto envoy/service/load_stats/v2/lrs.proto envoy/type/matcher/regex.proto envoy/type/matcher/string.proto diff --git a/xds/third_party/envoy/src/main/proto/envoy/service/discovery/v2/sds.proto b/xds/third_party/envoy/src/main/proto/envoy/service/discovery/v2/sds.proto new file mode 100644 index 0000000000..7e9ae261a3 --- /dev/null +++ b/xds/third_party/envoy/src/main/proto/envoy/service/discovery/v2/sds.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package envoy.service.discovery.v2; + +option java_outer_classname = "SdsProto"; +option java_multiple_files = true; +option java_package = "io.envoyproxy.envoy.service.discovery.v2"; + +import "envoy/api/v2/discovery.proto"; + +import "google/api/annotations.proto"; + +// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing +// services: https://github.com/google/protobuf/issues/4221 +message SdsDummy { +} + +service SecretDiscoveryService { + rpc DeltaSecrets(stream envoy.api.v2.DeltaDiscoveryRequest) + returns (stream envoy.api.v2.DeltaDiscoveryResponse) { + } + + rpc StreamSecrets(stream envoy.api.v2.DiscoveryRequest) + returns (stream envoy.api.v2.DiscoveryResponse) { + } + + rpc FetchSecrets(envoy.api.v2.DiscoveryRequest) returns (envoy.api.v2.DiscoveryResponse) { + option (google.api.http) = { + post: "/v2/discovery:secrets" + body: "*" + }; + } +}