private static void prepareKmsKeys() throws IOException { String projectId = remoteStorageHelper.getOptions().getProjectId(); GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); ManagedChannel kmsChannel = ManagedChannelBuilder.forTarget("cloudkms.googleapis.com:443").build(); KeyManagementServiceBlockingStub kmsStub = KeyManagementServiceGrpc.newBlockingStub(kmsChannel) .withCallCredentials(MoreCallCredentials.from(credentials)); IAMPolicyGrpc.IAMPolicyBlockingStub iamStub = IAMPolicyGrpc.newBlockingStub(kmsChannel) .withCallCredentials(MoreCallCredentials.from(credentials)); ensureKmsKeyRingExistsForTests(kmsStub, projectId, KMS_KEY_RING_LOCATION, KMS_KEY_RING_NAME); ensureKmsKeyRingIamPermissionsForTests( iamStub, projectId, KMS_KEY_RING_LOCATION, KMS_KEY_RING_NAME); kmsKeyOneResourcePath = ensureKmsKeyExistsForTests( kmsStub, projectId, KMS_KEY_RING_LOCATION, KMS_KEY_RING_NAME, KMS_KEY_ONE_NAME); kmsKeyTwoResourcePath = ensureKmsKeyExistsForTests( kmsStub, projectId, KMS_KEY_RING_LOCATION, KMS_KEY_RING_NAME, KMS_KEY_TWO_NAME); }
public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor result = serviceDescriptor; if (result == null) { synchronized (IAMPolicyGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new IAMPolicyFileDescriptorSupplier()) .addMethod(getSetIamPolicyMethodHelper()) .addMethod(getGetIamPolicyMethodHelper()) .addMethod(getTestIamPermissionsMethodHelper()) .build(); } } } return result; } }
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static io.grpc.MethodDescriptor<com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> getTestIamPermissionsMethod() { return getTestIamPermissionsMethodHelper(); }
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static io.grpc.MethodDescriptor<com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> getSetIamPolicyMethod() { return getSetIamPolicyMethodHelper(); }
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static io.grpc.MethodDescriptor<com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> getGetIamPolicyMethod() { return getGetIamPolicyMethodHelper(); }
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getSetIamPolicyMethodHelper(), asyncUnaryCall( new MethodHandlers< com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( this, METHODID_SET_IAM_POLICY))) .addMethod( getGetIamPolicyMethodHelper(), asyncUnaryCall( new MethodHandlers< com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( this, METHODID_GET_IAM_POLICY))) .addMethod( getTestIamPermissionsMethodHelper(), asyncUnaryCall( new MethodHandlers< com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse>( this, METHODID_TEST_IAM_PERMISSIONS))) .build(); } }