diff --git a/authorization-codegen/protoc-gen-dh-auth-wiring b/authorization-codegen/protoc-gen-dh-auth-wiring deleted file mode 100755 index bffc6e42731..00000000000 --- a/authorization-codegen/protoc-gen-dh-auth-wiring +++ /dev/null @@ -1,2 +0,0 @@ -# protoc-gen-service-auth-wiring -java -cp "authorization-codegen/build/libs/deephaven-authorization-codegen-${DEEPHAVEN_VERSION}-all.jar" io.deephaven.auth.codegen.CombinedAuthWiring diff --git a/authorization-codegen/src/main/java/io/deephaven/auth/codegen/CombinedAuthWiring.java b/authorization-codegen/src/main/java/io/deephaven/auth/codegen/CombinedAuthWiring.java deleted file mode 100644 index e0b400dac1c..00000000000 --- a/authorization-codegen/src/main/java/io/deephaven/auth/codegen/CombinedAuthWiring.java +++ /dev/null @@ -1,89 +0,0 @@ -package io.deephaven.auth.codegen; - -import com.google.common.base.Strings; -import com.google.protobuf.DescriptorProtos; -import com.google.protobuf.compiler.PluginProtos; - -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class CombinedAuthWiring { - public static void main(String[] args) throws IOException { - // First, initial setup to be shared by both plugin aspects - final PluginProtos.CodeGeneratorRequest request = PluginProtos.CodeGeneratorRequest.parseFrom(System.in); - final PluginProtos.CodeGeneratorResponse.Builder response = PluginProtos.CodeGeneratorResponse.newBuilder(); - - // tell protoc that we support proto3's optional as synthetic oneof feature - response.setSupportedFeatures(PluginProtos.CodeGeneratorResponse.Feature.FEATURE_PROTO3_OPTIONAL_VALUE); - - // create a mapping from message type to java type name - final Map typeMap = generateTypeMap(request); - - - // Next, for each service, generate the auth wiring - for (final DescriptorProtos.FileDescriptorProto file : request.getProtoFileList()) { - final String realPackage = getRealPackage(file); - for (final DescriptorProtos.ServiceDescriptorProto service : file.getServiceList()) { - if (service.getName().contains("TableService")) { - // all table services perform an authorization check using contextual source tables - continue; - } else if (service.getName().contains("BrowserFlightService")) { - // the browser flight requests get converted to FlightService requests based on our binding - continue; - } - GenerateServiceAuthWiring.generateForService(realPackage, response, service, typeMap); - } - } - - - // Then, for each service that needs contextual auth, create that interface too - for (final DescriptorProtos.FileDescriptorProto file : request.getProtoFileList()) { - for (final DescriptorProtos.ServiceDescriptorProto service : file.getServiceList()) { - // Only table services perform an authorization check using contextual source tables - // In other circumstances we would generate from .proto first, then compile this plugin, then - // run the plugin on the remaining .proto files, but we aren't generalizing the plugin that far - // at this time. - List contextualAuthValue = service.getOptions().getUnknownFields().getField(0x6E68).getVarintList(); - boolean hasContextualAuth = !contextualAuthValue.isEmpty() && contextualAuthValue.get(0) == 1; - if (!hasContextualAuth) { - continue; - } - - GenerateContextualAuthWiring.generateForService(response, service, typeMap); - } - } - - // Finally, write the combined output back to protoc - response.build().toByteString().writeTo(System.out); - } - - public static Map generateTypeMap(PluginProtos.CodeGeneratorRequest request) { - final Map typeMap = new HashMap<>(); - for (final DescriptorProtos.FileDescriptorProto file : request.getProtoFileList()) { - String realPackage = getRealPackage(file); - for (final DescriptorProtos.DescriptorProto message : file.getMessageTypeList()) { - typeMap.put("." + file.getPackage() + "." + message.getName(), realPackage + "." + message.getName()); - } - } - return typeMap; - } - - public static String getRealPackage(final DescriptorProtos.FileDescriptorProto file) { - String realPackage = null; - if (file.hasOptions()) { - realPackage = file.getOptions().getJavaPackage(); - } - if (Strings.isNullOrEmpty(realPackage)) { - realPackage = file.getPackage(); - } - // Unsure of where this is specified in Flight.proto, but in addition to the package the messages are - // put into a "Flight" namespace. - if (realPackage.equals("org.apache.arrow.flight.impl")) { - realPackage += ".Flight"; - } - return realPackage; - } - -} diff --git a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/contextual-auth.proto b/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/contextual-auth.proto deleted file mode 100644 index 18c1f9b18f5..00000000000 --- a/proto/proto-backplane-grpc/src/main/proto/deephaven/proto/contextual-auth.proto +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending - */ - -syntax = "proto3"; - -package io.deephaven.proto.backplane.grpc; - -import "google/protobuf/descriptor.proto"; - -option java_multiple_files = true; -option optimize_for = SPEED; -option go_package = "github.com/deephaven/deephaven-core/go/internal/proto"; - -extend google.protobuf.ServiceOptions { - // Indicates that the service requires server-side contextual authorization checks. - // (Numeric value is 'dh', to avoid collisions with nice round generated numbers.) - bool contextual_auth = 0x6E68; -} \ No newline at end of file