From b749cb6210aafda3f04877e60dbde30e8540f930 Mon Sep 17 00:00:00 2001 From: sanjaypujare Date: Fri, 7 Aug 2020 09:22:42 -0700 Subject: [PATCH] xds: get the correct meshca.proto version that has the needed Java annotations (#7298) --- xds/build.gradle | 2 +- .../meshca/v1/MeshCertificateServiceGrpc.java | 46 +++++++++---------- xds/third_party/istio/import.sh | 2 +- .../proto/providers/google/meshca.proto | 4 ++ 4 files changed, 29 insertions(+), 25 deletions(-) rename xds/src/generated/main/grpc/{ => com}/google/security/meshca/v1/MeshCertificateServiceGrpc.java (82%) diff --git a/xds/build.gradle b/xds/build.gradle index 0aa5f15147..43902d8a19 100644 --- a/xds/build.gradle +++ b/xds/build.gradle @@ -96,7 +96,7 @@ shadowJar { relocate 'io.envoyproxy', 'io.grpc.xds.shaded.io.envoyproxy' relocate 'io.grpc.netty', 'io.grpc.netty.shaded.io.grpc.netty' relocate 'io.netty', 'io.grpc.netty.shaded.io.netty' - relocate 'google.security', 'io.grpc.xds.shaded.google.security' + relocate 'com.google.security', 'io.grpc.xds.shaded.com.google.security' exclude "**/*.proto" } diff --git a/xds/src/generated/main/grpc/google/security/meshca/v1/MeshCertificateServiceGrpc.java b/xds/src/generated/main/grpc/com/google/security/meshca/v1/MeshCertificateServiceGrpc.java similarity index 82% rename from xds/src/generated/main/grpc/google/security/meshca/v1/MeshCertificateServiceGrpc.java rename to xds/src/generated/main/grpc/com/google/security/meshca/v1/MeshCertificateServiceGrpc.java index 50a522ef84..f8c127552d 100644 --- a/xds/src/generated/main/grpc/google/security/meshca/v1/MeshCertificateServiceGrpc.java +++ b/xds/src/generated/main/grpc/com/google/security/meshca/v1/MeshCertificateServiceGrpc.java @@ -1,4 +1,4 @@ -package google.security.meshca.v1; +package com.google.security.meshca.v1; import static io.grpc.MethodDescriptor.generateFullMethodName; import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; @@ -30,29 +30,29 @@ public final class MeshCertificateServiceGrpc { public static final String SERVICE_NAME = "google.security.meshca.v1.MeshCertificateService"; // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getCreateCertificateMethod; + private static volatile io.grpc.MethodDescriptor getCreateCertificateMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "CreateCertificate", - requestType = google.security.meshca.v1.Meshca.MeshCertificateRequest.class, - responseType = google.security.meshca.v1.Meshca.MeshCertificateResponse.class, + requestType = com.google.security.meshca.v1.MeshCertificateRequest.class, + responseType = com.google.security.meshca.v1.MeshCertificateResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateCertificateMethod() { - io.grpc.MethodDescriptor getCreateCertificateMethod; + public static io.grpc.MethodDescriptor getCreateCertificateMethod() { + io.grpc.MethodDescriptor getCreateCertificateMethod; if ((getCreateCertificateMethod = MeshCertificateServiceGrpc.getCreateCertificateMethod) == null) { synchronized (MeshCertificateServiceGrpc.class) { if ((getCreateCertificateMethod = MeshCertificateServiceGrpc.getCreateCertificateMethod) == null) { MeshCertificateServiceGrpc.getCreateCertificateMethod = getCreateCertificateMethod = - io.grpc.MethodDescriptor.newBuilder() + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCertificate")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - google.security.meshca.v1.Meshca.MeshCertificateRequest.getDefaultInstance())) + com.google.security.meshca.v1.MeshCertificateRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - google.security.meshca.v1.Meshca.MeshCertificateResponse.getDefaultInstance())) + com.google.security.meshca.v1.MeshCertificateResponse.getDefaultInstance())) .setSchemaDescriptor(new MeshCertificateServiceMethodDescriptorSupplier("CreateCertificate")) .build(); } @@ -118,8 +118,8 @@ public final class MeshCertificateServiceGrpc { * service account identity. * */ - public void createCertificate(google.security.meshca.v1.Meshca.MeshCertificateRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void createCertificate(com.google.security.meshca.v1.MeshCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateCertificateMethod(), responseObserver); } @@ -129,8 +129,8 @@ public final class MeshCertificateServiceGrpc { getCreateCertificateMethod(), asyncUnaryCall( new MethodHandlers< - google.security.meshca.v1.Meshca.MeshCertificateRequest, - google.security.meshca.v1.Meshca.MeshCertificateResponse>( + com.google.security.meshca.v1.MeshCertificateRequest, + com.google.security.meshca.v1.MeshCertificateResponse>( this, METHODID_CREATE_CERTIFICATE))) .build(); } @@ -159,8 +159,8 @@ public final class MeshCertificateServiceGrpc { * service account identity. * */ - public void createCertificate(google.security.meshca.v1.Meshca.MeshCertificateRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void createCertificate(com.google.security.meshca.v1.MeshCertificateRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getCreateCertificateMethod(), getCallOptions()), request, responseObserver); } @@ -189,7 +189,7 @@ public final class MeshCertificateServiceGrpc { * service account identity. * */ - public google.security.meshca.v1.Meshca.MeshCertificateResponse createCertificate(google.security.meshca.v1.Meshca.MeshCertificateRequest request) { + public com.google.security.meshca.v1.MeshCertificateResponse createCertificate(com.google.security.meshca.v1.MeshCertificateRequest request) { return blockingUnaryCall( getChannel(), getCreateCertificateMethod(), getCallOptions(), request); } @@ -218,8 +218,8 @@ public final class MeshCertificateServiceGrpc { * service account identity. * */ - public com.google.common.util.concurrent.ListenableFuture createCertificate( - google.security.meshca.v1.Meshca.MeshCertificateRequest request) { + public com.google.common.util.concurrent.ListenableFuture createCertificate( + com.google.security.meshca.v1.MeshCertificateRequest request) { return futureUnaryCall( getChannel().newCall(getCreateCertificateMethod(), getCallOptions()), request); } @@ -245,8 +245,8 @@ public final class MeshCertificateServiceGrpc { public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { case METHODID_CREATE_CERTIFICATE: - serviceImpl.createCertificate((google.security.meshca.v1.Meshca.MeshCertificateRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); + serviceImpl.createCertificate((com.google.security.meshca.v1.MeshCertificateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); break; default: throw new AssertionError(); @@ -270,7 +270,7 @@ public final class MeshCertificateServiceGrpc { @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return google.security.meshca.v1.Meshca.getDescriptor(); + return com.google.security.meshca.v1.MeshCaProto.getDescriptor(); } @java.lang.Override diff --git a/xds/third_party/istio/import.sh b/xds/third_party/istio/import.sh index aecd3cb760..d1416ac882 100755 --- a/xds/third_party/istio/import.sh +++ b/xds/third_party/istio/import.sh @@ -18,7 +18,7 @@ set -e BRANCH=master -VERSION=4c14c4673ab8748a0c77922290d91b6ce68b7b7c +VERSION=e0ce39487b4806bdd9062b2c0d0cae0bebbbac7b GIT_REPO="https://github.com/istio/istio.git" GIT_BASE_DIR=istio SOURCE_PROTO_BASE_DIR=istio diff --git a/xds/third_party/istio/src/main/proto/security/proto/providers/google/meshca.proto b/xds/third_party/istio/src/main/proto/security/proto/providers/google/meshca.proto index 9c3c004adb..c02b7f5828 100644 --- a/xds/third_party/istio/src/main/proto/security/proto/providers/google/meshca.proto +++ b/xds/third_party/istio/src/main/proto/security/proto/providers/google/meshca.proto @@ -18,6 +18,10 @@ package google.security.meshca.v1; import "google/protobuf/duration.proto"; +option java_multiple_files = true; +option java_outer_classname = "MeshCaProto"; +option java_package = "com.google.security.meshca.v1"; + // Certificate request message. message MeshCertificateRequest { // The request ID must be a valid UUID with the exception that zero UUID is