diff options
author | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /contrib/libs/grpc/src | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
download | ydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz |
fix ya.make
Diffstat (limited to 'contrib/libs/grpc/src')
169 files changed, 0 insertions, 17887 deletions
diff --git a/contrib/libs/grpc/src/compiler/csharp_generator.cc b/contrib/libs/grpc/src/compiler/csharp_generator.cc deleted file mode 100644 index 15d5361a20..0000000000 --- a/contrib/libs/grpc/src/compiler/csharp_generator.cc +++ /dev/null @@ -1,829 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "src/compiler/csharp_generator.h" - -#include <cctype> -#include <map> -#include <sstream> -#include <vector> - -#include "src/compiler/config.h" -#include "src/compiler/csharp_generator_helpers.h" - -using grpc::protobuf::Descriptor; -using grpc::protobuf::FileDescriptor; -using grpc::protobuf::MethodDescriptor; -using grpc::protobuf::ServiceDescriptor; -using grpc::protobuf::io::Printer; -using grpc::protobuf::io::StringOutputStream; -using grpc_generator::StringReplace; -using std::vector; - -namespace grpc_csharp_generator { -namespace { - -// This function is a massaged version of -// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc -// Currently, we cannot easily reuse the functionality as -// google/protobuf/compiler/csharp/csharp_doc_comment.h is not a public header. -// TODO(jtattermusch): reuse the functionality from google/protobuf. -bool GenerateDocCommentBodyImpl(grpc::protobuf::io::Printer* printer, - grpc::protobuf::SourceLocation location) { - TString comments = location.leading_comments.empty() - ? location.trailing_comments - : location.leading_comments; - if (comments.empty()) { - return false; - } - // XML escaping... no need for apostrophes etc as the whole text is going to - // be a child - // node of a summary element, not part of an attribute. - comments = grpc_generator::StringReplace(comments, "&", "&", true); - comments = grpc_generator::StringReplace(comments, "<", "<", true); - - std::vector<TString> lines; - grpc_generator::Split(comments, '\n', &lines); - // TODO: We really should work out which part to put in the summary and which - // to put in the remarks... - // but that needs to be part of a bigger effort to understand the markdown - // better anyway. - printer->Print("/// <summary>\n"); - bool last_was_empty = false; - // We squash multiple blank lines down to one, and remove any trailing blank - // lines. We need - // to preserve the blank lines themselves, as this is relevant in the - // markdown. - // Note that we can't remove leading or trailing whitespace as *that's* - // relevant in markdown too. - // (We don't skip "just whitespace" lines, either.) - for (std::vector<TString>::iterator it = lines.begin(); it != lines.end(); - ++it) { - TString line = *it; - if (line.empty()) { - last_was_empty = true; - } else { - if (last_was_empty) { - printer->Print("///\n"); - } - last_was_empty = false; - printer->Print("///$line$\n", "line", *it); - } - } - printer->Print("/// </summary>\n"); - return true; -} - -void GenerateGeneratedCodeAttribute(grpc::protobuf::io::Printer* printer) { - // Mark the code as generated using the [GeneratedCode] attribute. - // We don't provide plugin version info in attribute the because: - // * the version information is not readily available from the plugin's code. - // * it would cause a lot of churn in the pre-generated code - // in this repository every time the version is updated. - printer->Print( - "[global::System.CodeDom.Compiler.GeneratedCode(\"grpc_csharp_plugin\", " - "null)]\n"); -} - -template <typename DescriptorType> -bool GenerateDocCommentBody(grpc::protobuf::io::Printer* printer, - const DescriptorType* descriptor) { - grpc::protobuf::SourceLocation location; - if (!descriptor->GetSourceLocation(&location)) { - return false; - } - return GenerateDocCommentBodyImpl(printer, location); -} - -void GenerateDocCommentServerMethod(grpc::protobuf::io::Printer* printer, - const MethodDescriptor* method) { - if (GenerateDocCommentBody(printer, method)) { - if (method->client_streaming()) { - printer->Print( - "/// <param name=\"requestStream\">Used for reading requests from " - "the client.</param>\n"); - } else { - printer->Print( - "/// <param name=\"request\">The request received from the " - "client.</param>\n"); - } - if (method->server_streaming()) { - printer->Print( - "/// <param name=\"responseStream\">Used for sending responses back " - "to the client.</param>\n"); - } - printer->Print( - "/// <param name=\"context\">The context of the server-side call " - "handler being invoked.</param>\n"); - if (method->server_streaming()) { - printer->Print( - "/// <returns>A task indicating completion of the " - "handler.</returns>\n"); - } else { - printer->Print( - "/// <returns>The response to send back to the client (wrapped by a " - "task).</returns>\n"); - } - } -} - -void GenerateDocCommentClientMethod(grpc::protobuf::io::Printer* printer, - const MethodDescriptor* method, - bool is_sync, bool use_call_options) { - if (GenerateDocCommentBody(printer, method)) { - if (!method->client_streaming()) { - printer->Print( - "/// <param name=\"request\">The request to send to the " - "server.</param>\n"); - } - if (!use_call_options) { - printer->Print( - "/// <param name=\"headers\">The initial metadata to send with the " - "call. This parameter is optional.</param>\n"); - printer->Print( - "/// <param name=\"deadline\">An optional deadline for the call. The " - "call will be cancelled if deadline is hit.</param>\n"); - printer->Print( - "/// <param name=\"cancellationToken\">An optional token for " - "canceling the call.</param>\n"); - } else { - printer->Print( - "/// <param name=\"options\">The options for the call.</param>\n"); - } - if (is_sync) { - printer->Print( - "/// <returns>The response received from the server.</returns>\n"); - } else { - printer->Print("/// <returns>The call object.</returns>\n"); - } - } -} - -TString GetServiceClassName(const ServiceDescriptor* service) { - return service->name(); -} - -TString GetClientClassName(const ServiceDescriptor* service) { - return service->name() + "Client"; -} - -TString GetServerClassName(const ServiceDescriptor* service) { - return service->name() + "Base"; -} - -TString GetCSharpMethodType(const MethodDescriptor* method) { - if (method->client_streaming()) { - if (method->server_streaming()) { - return "grpc::MethodType.DuplexStreaming"; - } else { - return "grpc::MethodType.ClientStreaming"; - } - } else { - if (method->server_streaming()) { - return "grpc::MethodType.ServerStreaming"; - } else { - return "grpc::MethodType.Unary"; - } - } -} - -TString GetCSharpServerMethodType(const MethodDescriptor* method) { - if (method->client_streaming()) { - if (method->server_streaming()) { - return "grpc::DuplexStreamingServerMethod"; - } else { - return "grpc::ClientStreamingServerMethod"; - } - } else { - if (method->server_streaming()) { - return "grpc::ServerStreamingServerMethod"; - } else { - return "grpc::UnaryServerMethod"; - } - } -} - -TString GetServiceNameFieldName() { return "__ServiceName"; } - -TString GetMarshallerFieldName(const Descriptor* message) { - return "__Marshaller_" + - grpc_generator::StringReplace(message->full_name(), ".", "_", true); -} - -TString GetMethodFieldName(const MethodDescriptor* method) { - return "__Method_" + method->name(); -} - -TString GetMethodRequestParamMaybe(const MethodDescriptor* method, - bool invocation_param = false) { - if (method->client_streaming()) { - return ""; - } - if (invocation_param) { - return "request, "; - } - return GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->input_type()) + " request, "; -} - -TString GetAccessLevel(bool internal_access) { - return internal_access ? "internal" : "public"; -} - -TString GetMethodReturnTypeClient(const MethodDescriptor* method) { - if (method->client_streaming()) { - if (method->server_streaming()) { - return "grpc::AsyncDuplexStreamingCall<" + - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->input_type()) + ", " + - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type()) + ">"; - } else { - return "grpc::AsyncClientStreamingCall<" + - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->input_type()) + ", " + - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type()) + ">"; - } - } else { - if (method->server_streaming()) { - return "grpc::AsyncServerStreamingCall<" + - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type()) + ">"; - } else { - return "grpc::AsyncUnaryCall<" + - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type()) + ">"; - } - } -} - -TString GetMethodRequestParamServer(const MethodDescriptor* method) { - if (method->client_streaming()) { - return "grpc::IAsyncStreamReader<" + - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->input_type()) + - "> requestStream"; - } - return GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->input_type()) + " request"; -} - -TString GetMethodReturnTypeServer(const MethodDescriptor* method) { - if (method->server_streaming()) { - return "global::System.Threading.Tasks.Task"; - } - return "global::System.Threading.Tasks.Task<" + - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type()) + ">"; -} - -TString GetMethodResponseStreamMaybe(const MethodDescriptor* method) { - if (method->server_streaming()) { - return ", grpc::IServerStreamWriter<" + - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type()) + - "> responseStream"; - } - return ""; -} - -// Gets vector of all messages used as input or output types. -std::vector<const Descriptor*> GetUsedMessages( - const ServiceDescriptor* service) { - std::set<const Descriptor*> descriptor_set; - std::vector<const Descriptor*> - result; // vector is to maintain stable ordering - for (int i = 0; i < service->method_count(); i++) { - const MethodDescriptor* method = service->method(i); - if (descriptor_set.find(method->input_type()) == descriptor_set.end()) { - descriptor_set.insert(method->input_type()); - result.push_back(method->input_type()); - } - if (descriptor_set.find(method->output_type()) == descriptor_set.end()) { - descriptor_set.insert(method->output_type()); - result.push_back(method->output_type()); - } - } - return result; -} - -void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) { - std::vector<const Descriptor*> used_messages = GetUsedMessages(service); - if (used_messages.size() != 0) { - // Generate static helper methods for serialization/deserialization - GenerateGeneratedCodeAttribute(out); - out->Print( - "static void __Helper_SerializeMessage(" - "global::Google.Protobuf.IMessage message, " - "grpc::SerializationContext context)\n" - "{\n"); - out->Indent(); - out->Print( - "#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION\n" - "if (message is global::Google.Protobuf.IBufferMessage)\n" - "{\n"); - out->Indent(); - out->Print( - "context.SetPayloadLength(message.CalculateSize());\n" - "global::Google.Protobuf.MessageExtensions.WriteTo(message, " - "context.GetBufferWriter());\n" - "context.Complete();\n" - "return;\n"); - out->Outdent(); - out->Print( - "}\n" - "#endif\n"); - out->Print( - "context.Complete(" - "global::Google.Protobuf.MessageExtensions.ToByteArray(message));\n"); - out->Outdent(); - out->Print("}\n\n"); - - GenerateGeneratedCodeAttribute(out); - out->Print( - "static class __Helper_MessageCache<T>\n" - "{\n"); - out->Indent(); - out->Print( - "public static readonly bool IsBufferMessage = " - "global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(" - "global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));" - "\n"); - out->Outdent(); - out->Print("}\n\n"); - - GenerateGeneratedCodeAttribute(out); - out->Print( - "static T __Helper_DeserializeMessage<T>(" - "grpc::DeserializationContext context, " - "global::Google.Protobuf.MessageParser<T> parser) " - "where T : global::Google.Protobuf.IMessage<T>\n" - "{\n"); - out->Indent(); - out->Print( - "#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION\n" - "if (__Helper_MessageCache<T>.IsBufferMessage)\n" - "{\n"); - out->Indent(); - out->Print( - "return parser.ParseFrom(context.PayloadAsReadOnlySequence());\n"); - out->Outdent(); - out->Print( - "}\n" - "#endif\n"); - out->Print("return parser.ParseFrom(context.PayloadAsNewBuffer());\n"); - out->Outdent(); - out->Print("}\n\n"); - } - - for (size_t i = 0; i < used_messages.size(); i++) { - const Descriptor* message = used_messages[i]; - GenerateGeneratedCodeAttribute(out); - out->Print( - "static readonly grpc::Marshaller<$type$> $fieldname$ = " - "grpc::Marshallers.Create(__Helper_SerializeMessage, " - "context => __Helper_DeserializeMessage(context, $type$.Parser));\n", - "fieldname", GetMarshallerFieldName(message), "type", - GRPC_CUSTOM_CSHARP_GETCLASSNAME(message)); - } - out->Print("\n"); -} - -void GenerateStaticMethodField(Printer* out, const MethodDescriptor* method) { - GenerateGeneratedCodeAttribute(out); - out->Print( - "static readonly grpc::Method<$request$, $response$> $fieldname$ = new " - "grpc::Method<$request$, $response$>(\n", - "fieldname", GetMethodFieldName(method), "request", - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->input_type()), "response", - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type())); - out->Indent(); - out->Indent(); - out->Print("$methodtype$,\n", "methodtype", GetCSharpMethodType(method)); - out->Print("$servicenamefield$,\n", "servicenamefield", - GetServiceNameFieldName()); - out->Print("\"$methodname$\",\n", "methodname", method->name()); - out->Print("$requestmarshaller$,\n", "requestmarshaller", - GetMarshallerFieldName(method->input_type())); - out->Print("$responsemarshaller$);\n", "responsemarshaller", - GetMarshallerFieldName(method->output_type())); - out->Print("\n"); - out->Outdent(); - out->Outdent(); -} - -void GenerateServiceDescriptorProperty(Printer* out, - const ServiceDescriptor* service) { - std::ostringstream index; - index << service->index(); - out->Print("/// <summary>Service descriptor</summary>\n"); - out->Print( - "public static global::Google.Protobuf.Reflection.ServiceDescriptor " - "Descriptor\n"); - out->Print("{\n"); - out->Print(" get { return $umbrella$.Descriptor.Services[$index$]; }\n", - "umbrella", - GRPC_CUSTOM_CSHARP_GETREFLECTIONCLASSNAME(service->file()), - "index", index.str()); - out->Print("}\n"); - out->Print("\n"); -} - -void GenerateServerClass(Printer* out, const ServiceDescriptor* service) { - out->Print( - "/// <summary>Base class for server-side implementations of " - "$servicename$</summary>\n", - "servicename", GetServiceClassName(service)); - out->Print( - "[grpc::BindServiceMethod(typeof($classname$), " - "\"BindService\")]\n", - "classname", GetServiceClassName(service)); - out->Print("public abstract partial class $name$\n", "name", - GetServerClassName(service)); - out->Print("{\n"); - out->Indent(); - for (int i = 0; i < service->method_count(); i++) { - const MethodDescriptor* method = service->method(i); - GenerateDocCommentServerMethod(out, method); - GenerateGeneratedCodeAttribute(out); - out->Print( - "public virtual $returntype$ " - "$methodname$($request$$response_stream_maybe$, " - "grpc::ServerCallContext context)\n", - "methodname", method->name(), "returntype", - GetMethodReturnTypeServer(method), "request", - GetMethodRequestParamServer(method), "response_stream_maybe", - GetMethodResponseStreamMaybe(method)); - out->Print("{\n"); - out->Indent(); - out->Print( - "throw new grpc::RpcException(" - "new grpc::Status(grpc::StatusCode.Unimplemented, \"\"));\n"); - out->Outdent(); - out->Print("}\n\n"); - } - out->Outdent(); - out->Print("}\n"); - out->Print("\n"); -} - -void GenerateClientStub(Printer* out, const ServiceDescriptor* service) { - out->Print("/// <summary>Client for $servicename$</summary>\n", "servicename", - GetServiceClassName(service)); - out->Print("public partial class $name$ : grpc::ClientBase<$name$>\n", "name", - GetClientClassName(service)); - out->Print("{\n"); - out->Indent(); - - // constructors - out->Print( - "/// <summary>Creates a new client for $servicename$</summary>\n" - "/// <param name=\"channel\">The channel to use to make remote " - "calls.</param>\n", - "servicename", GetServiceClassName(service)); - GenerateGeneratedCodeAttribute(out); - out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n", - "name", GetClientClassName(service)); - out->Print("{\n"); - out->Print("}\n"); - out->Print( - "/// <summary>Creates a new client for $servicename$ that uses a custom " - "<c>CallInvoker</c>.</summary>\n" - "/// <param name=\"callInvoker\">The callInvoker to use to make remote " - "calls.</param>\n", - "servicename", GetServiceClassName(service)); - GenerateGeneratedCodeAttribute(out); - out->Print( - "public $name$(grpc::CallInvoker callInvoker) : base(callInvoker)\n", - "name", GetClientClassName(service)); - out->Print("{\n"); - out->Print("}\n"); - out->Print( - "/// <summary>Protected parameterless constructor to allow creation" - " of test doubles.</summary>\n"); - GenerateGeneratedCodeAttribute(out); - out->Print("protected $name$() : base()\n", "name", - GetClientClassName(service)); - out->Print("{\n"); - out->Print("}\n"); - out->Print( - "/// <summary>Protected constructor to allow creation of configured " - "clients.</summary>\n" - "/// <param name=\"configuration\">The client configuration.</param>\n"); - GenerateGeneratedCodeAttribute(out); - out->Print( - "protected $name$(ClientBaseConfiguration configuration)" - " : base(configuration)\n", - "name", GetClientClassName(service)); - out->Print("{\n"); - out->Print("}\n\n"); - - for (int i = 0; i < service->method_count(); i++) { - const MethodDescriptor* method = service->method(i); - if (!method->client_streaming() && !method->server_streaming()) { - // unary calls have an extra synchronous stub method - GenerateDocCommentClientMethod(out, method, true, false); - GenerateGeneratedCodeAttribute(out); - out->Print( - "public virtual $response$ $methodname$($request$ request, " - "grpc::Metadata " - "headers = null, global::System.DateTime? deadline = null, " - "global::System.Threading.CancellationToken " - "cancellationToken = " - "default(global::System.Threading.CancellationToken))\n", - "methodname", method->name(), "request", - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->input_type()), "response", - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type())); - out->Print("{\n"); - out->Indent(); - out->Print( - "return $methodname$(request, new grpc::CallOptions(headers, " - "deadline, " - "cancellationToken));\n", - "methodname", method->name()); - out->Outdent(); - out->Print("}\n"); - - // overload taking CallOptions as a param - GenerateDocCommentClientMethod(out, method, true, true); - GenerateGeneratedCodeAttribute(out); - out->Print( - "public virtual $response$ $methodname$($request$ request, " - "grpc::CallOptions options)\n", - "methodname", method->name(), "request", - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->input_type()), "response", - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type())); - out->Print("{\n"); - out->Indent(); - out->Print( - "return CallInvoker.BlockingUnaryCall($methodfield$, null, options, " - "request);\n", - "methodfield", GetMethodFieldName(method)); - out->Outdent(); - out->Print("}\n"); - } - - TString method_name = method->name(); - if (!method->client_streaming() && !method->server_streaming()) { - method_name += "Async"; // prevent name clash with synchronous method. - } - GenerateDocCommentClientMethod(out, method, false, false); - GenerateGeneratedCodeAttribute(out); - out->Print( - "public virtual $returntype$ " - "$methodname$($request_maybe$grpc::Metadata " - "headers = null, global::System.DateTime? deadline = null, " - "global::System.Threading.CancellationToken " - "cancellationToken = " - "default(global::System.Threading.CancellationToken))\n", - "methodname", method_name, "request_maybe", - GetMethodRequestParamMaybe(method), "returntype", - GetMethodReturnTypeClient(method)); - out->Print("{\n"); - out->Indent(); - - out->Print( - "return $methodname$($request_maybe$new grpc::CallOptions(headers, " - "deadline, " - "cancellationToken));\n", - "methodname", method_name, "request_maybe", - GetMethodRequestParamMaybe(method, true)); - out->Outdent(); - out->Print("}\n"); - - // overload taking CallOptions as a param - GenerateDocCommentClientMethod(out, method, false, true); - GenerateGeneratedCodeAttribute(out); - out->Print( - "public virtual $returntype$ " - "$methodname$($request_maybe$grpc::CallOptions " - "options)\n", - "methodname", method_name, "request_maybe", - GetMethodRequestParamMaybe(method), "returntype", - GetMethodReturnTypeClient(method)); - out->Print("{\n"); - out->Indent(); - if (!method->client_streaming() && !method->server_streaming()) { - // Non-Streaming - out->Print( - "return CallInvoker.AsyncUnaryCall($methodfield$, null, options, " - "request);\n", - "methodfield", GetMethodFieldName(method)); - } else if (method->client_streaming() && !method->server_streaming()) { - // Client Streaming Only - out->Print( - "return CallInvoker.AsyncClientStreamingCall($methodfield$, null, " - "options);\n", - "methodfield", GetMethodFieldName(method)); - } else if (!method->client_streaming() && method->server_streaming()) { - // Server Streaming Only - out->Print( - "return CallInvoker.AsyncServerStreamingCall($methodfield$, null, " - "options, request);\n", - "methodfield", GetMethodFieldName(method)); - } else { - // Bi-Directional Streaming - out->Print( - "return CallInvoker.AsyncDuplexStreamingCall($methodfield$, null, " - "options);\n", - "methodfield", GetMethodFieldName(method)); - } - out->Outdent(); - out->Print("}\n"); - } - - // override NewInstance method - out->Print( - "/// <summary>Creates a new instance of client from given " - "<c>ClientBaseConfiguration</c>.</summary>\n"); - GenerateGeneratedCodeAttribute(out); - out->Print( - "protected override $name$ NewInstance(ClientBaseConfiguration " - "configuration)\n", - "name", GetClientClassName(service)); - out->Print("{\n"); - out->Indent(); - out->Print("return new $name$(configuration);\n", "name", - GetClientClassName(service)); - out->Outdent(); - out->Print("}\n"); - - out->Outdent(); - out->Print("}\n"); - out->Print("\n"); -} - -void GenerateBindServiceMethod(Printer* out, const ServiceDescriptor* service) { - out->Print( - "/// <summary>Creates service definition that can be registered with a " - "server</summary>\n"); - out->Print( - "/// <param name=\"serviceImpl\">An object implementing the server-side" - " handling logic.</param>\n"); - GenerateGeneratedCodeAttribute(out); - out->Print( - "public static grpc::ServerServiceDefinition BindService($implclass$ " - "serviceImpl)\n", - "implclass", GetServerClassName(service)); - out->Print("{\n"); - out->Indent(); - - out->Print("return grpc::ServerServiceDefinition.CreateBuilder()"); - out->Indent(); - out->Indent(); - for (int i = 0; i < service->method_count(); i++) { - const MethodDescriptor* method = service->method(i); - out->Print("\n.AddMethod($methodfield$, serviceImpl.$methodname$)", - "methodfield", GetMethodFieldName(method), "methodname", - method->name()); - } - out->Print(".Build();\n"); - out->Outdent(); - out->Outdent(); - - out->Outdent(); - out->Print("}\n"); - out->Print("\n"); -} - -void GenerateBindServiceWithBinderMethod(Printer* out, - const ServiceDescriptor* service) { - out->Print( - "/// <summary>Register service method with a service " - "binder with or without implementation. Useful when customizing the " - "service binding logic.\n" - "/// Note: this method is part of an experimental API that can change or " - "be " - "removed without any prior notice.</summary>\n"); - out->Print( - "/// <param name=\"serviceBinder\">Service methods will be bound by " - "calling <c>AddMethod</c> on this object." - "</param>\n"); - out->Print( - "/// <param name=\"serviceImpl\">An object implementing the server-side" - " handling logic.</param>\n"); - GenerateGeneratedCodeAttribute(out); - out->Print( - "public static void BindService(grpc::ServiceBinderBase serviceBinder, " - "$implclass$ " - "serviceImpl)\n", - "implclass", GetServerClassName(service)); - out->Print("{\n"); - out->Indent(); - - for (int i = 0; i < service->method_count(); i++) { - const MethodDescriptor* method = service->method(i); - out->Print( - "serviceBinder.AddMethod($methodfield$, serviceImpl == null ? null : " - "new $servermethodtype$<$inputtype$, $outputtype$>(" - "serviceImpl.$methodname$));\n", - "methodfield", GetMethodFieldName(method), "servermethodtype", - GetCSharpServerMethodType(method), "inputtype", - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->input_type()), "outputtype", - GRPC_CUSTOM_CSHARP_GETCLASSNAME(method->output_type()), "methodname", - method->name()); - } - - out->Outdent(); - out->Print("}\n"); - out->Print("\n"); -} - -void GenerateService(Printer* out, const ServiceDescriptor* service, - bool generate_client, bool generate_server, - bool internal_access) { - GenerateDocCommentBody(out, service); - - out->Print("$access_level$ static partial class $classname$\n", - "access_level", GetAccessLevel(internal_access), "classname", - GetServiceClassName(service)); - out->Print("{\n"); - out->Indent(); - out->Print("static readonly string $servicenamefield$ = \"$servicename$\";\n", - "servicenamefield", GetServiceNameFieldName(), "servicename", - service->full_name()); - out->Print("\n"); - - GenerateMarshallerFields(out, service); - for (int i = 0; i < service->method_count(); i++) { - GenerateStaticMethodField(out, service->method(i)); - } - GenerateServiceDescriptorProperty(out, service); - - if (generate_server) { - GenerateServerClass(out, service); - } - if (generate_client) { - GenerateClientStub(out, service); - } - if (generate_server) { - GenerateBindServiceMethod(out, service); - GenerateBindServiceWithBinderMethod(out, service); - } - - out->Outdent(); - out->Print("}\n"); -} - -} // anonymous namespace - -TString GetServices(const FileDescriptor* file, bool generate_client, - bool generate_server, bool internal_access) { - TString output; - { - // Scope the output stream so it closes and finalizes output to the string. - - StringOutputStream output_stream(&output); - Printer out(&output_stream, '$'); - - // Don't write out any output if there no services, to avoid empty service - // files being generated for proto files that don't declare any. - if (file->service_count() == 0) { - return output; - } - - // Write out a file header. - out.Print("// <auto-generated>\n"); - out.Print( - "// Generated by the protocol buffer compiler. DO NOT EDIT!\n"); - out.Print("// source: $filename$\n", "filename", file->name()); - out.Print("// </auto-generated>\n"); - - // use C++ style as there are no file-level XML comments in .NET - TString leading_comments = GetCsharpComments(file, true); - if (!leading_comments.empty()) { - out.Print("// Original file comments:\n"); - out.PrintRaw(leading_comments.c_str()); - } - - out.Print("#pragma warning disable 0414, 1591\n"); - - out.Print("#region Designer generated code\n"); - out.Print("\n"); - out.Print("using grpc = global::Grpc.Core;\n"); - out.Print("\n"); - - TString file_namespace = GRPC_CUSTOM_CSHARP_GETFILENAMESPACE(file); - if (file_namespace != "") { - out.Print("namespace $namespace$ {\n", "namespace", file_namespace); - out.Indent(); - } - for (int i = 0; i < file->service_count(); i++) { - GenerateService(&out, file->service(i), generate_client, generate_server, - internal_access); - } - if (file_namespace != "") { - out.Outdent(); - out.Print("}\n"); - } - out.Print("#endregion\n"); - } - return output; -} - -} // namespace grpc_csharp_generator diff --git a/contrib/libs/grpc/src/compiler/csharp_generator.h b/contrib/libs/grpc/src/compiler/csharp_generator.h deleted file mode 100644 index 323b90584d..0000000000 --- a/contrib/libs/grpc/src/compiler/csharp_generator.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_CSHARP_GENERATOR_H -#define GRPC_INTERNAL_COMPILER_CSHARP_GENERATOR_H - -#include "src/compiler/config.h" - -namespace grpc_csharp_generator { - -TString GetServices(const grpc::protobuf::FileDescriptor* file, - bool generate_client, bool generate_server, - bool internal_access); - -} // namespace grpc_csharp_generator - -#endif // GRPC_INTERNAL_COMPILER_CSHARP_GENERATOR_H diff --git a/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h b/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h deleted file mode 100644 index d1a5b3a2a0..0000000000 --- a/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_CSHARP_GENERATOR_HELPERS_H -#define GRPC_INTERNAL_COMPILER_CSHARP_GENERATOR_HELPERS_H - -#include "src/compiler/config.h" -#include "src/compiler/generator_helpers.h" - -namespace grpc_csharp_generator { - -inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file, - const TString& file_suffix, - TString& out_file_name_or_error) { - out_file_name_or_error = - grpc_generator::FileNameInUpperCamel(file, false) + file_suffix; - return true; -} - -// Get leading or trailing comments in a string. Comment lines start with "// ". -// Leading detached comments are put in front of leading comments. -template <typename DescriptorType> -inline TString GetCsharpComments(const DescriptorType* desc, bool leading) { - return grpc_generator::GetPrefixedComments(desc, leading, "//"); -} - -} // namespace grpc_csharp_generator - -#endif // GRPC_INTERNAL_COMPILER_CSHARP_GENERATOR_HELPERS_H diff --git a/contrib/libs/grpc/src/compiler/node_generator.cc b/contrib/libs/grpc/src/compiler/node_generator.cc deleted file mode 100644 index d890320e8a..0000000000 --- a/contrib/libs/grpc/src/compiler/node_generator.cc +++ /dev/null @@ -1,276 +0,0 @@ -/* - * - * Copyright 2016 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "src/compiler/node_generator.h" - -#include <map> - -#include "src/compiler/config.h" -#include "src/compiler/generator_helpers.h" -#include "src/compiler/node_generator_helpers.h" - -using grpc::protobuf::Descriptor; -using grpc::protobuf::FileDescriptor; -using grpc::protobuf::MethodDescriptor; -using grpc::protobuf::ServiceDescriptor; -using grpc::protobuf::io::Printer; -using grpc::protobuf::io::StringOutputStream; -using std::map; - -namespace grpc_node_generator { -namespace { - -// Returns the alias we assign to the module of the given .proto filename -// when importing. Copied entirely from -// github:google/protobuf/src/google/protobuf/compiler/js/js_generator.cc#L154 -TString ModuleAlias(const TString filename) { - // This scheme could technically cause problems if a file includes any 2 of: - // foo/bar_baz.proto - // foo_bar_baz.proto - // foo_bar/baz.proto - // - // We'll worry about this problem if/when we actually see it. This name isn't - // exposed to users so we can change it later if we need to. - TString basename = grpc_generator::StripProto(filename); - basename = grpc_generator::StringReplace(basename, "-", "$"); - basename = grpc_generator::StringReplace(basename, "/", "_"); - basename = grpc_generator::StringReplace(basename, ".", "_"); - return basename + "_pb"; -} - -// Given a filename like foo/bar/baz.proto, returns the corresponding JavaScript -// message file foo/bar/baz.js -TString GetJSMessageFilename(const TString& filename) { - TString name = filename; - return grpc_generator::StripProto(name) + "_pb.js"; -} - -// Given a filename like foo/bar/baz.proto, returns the root directory -// path ../../ -TString GetRootPath(const TString& from_filename, - const TString& to_filename) { - if (to_filename.find("google/protobuf") == 0) { - // Well-known types (.proto files in the google/protobuf directory) are - // assumed to come from the 'google-protobuf' npm package. We may want to - // generalize this exception later by letting others put generated code in - // their own npm packages. - return "google-protobuf/"; - } - size_t slashes = std::count(from_filename.begin(), from_filename.end(), '/'); - if (slashes == 0) { - return "./"; - } - TString result = ""; - for (size_t i = 0; i < slashes; i++) { - result += "../"; - } - return result; -} - -// Return the relative path to load to_file from the directory containing -// from_file, assuming that both paths are relative to the same directory -TString GetRelativePath(const TString& from_file, - const TString& to_file) { - return GetRootPath(from_file, to_file) + to_file; -} - -/* Finds all message types used in all services in the file, and returns them - * as a map of fully qualified message type name to message descriptor */ -map<TString, const Descriptor*> GetAllMessages(const FileDescriptor* file) { - map<TString, const Descriptor*> message_types; - for (int service_num = 0; service_num < file->service_count(); - service_num++) { - const ServiceDescriptor* service = file->service(service_num); - for (int method_num = 0; method_num < service->method_count(); - method_num++) { - const MethodDescriptor* method = service->method(method_num); - const Descriptor* input_type = method->input_type(); - const Descriptor* output_type = method->output_type(); - message_types[input_type->full_name()] = input_type; - message_types[output_type->full_name()] = output_type; - } - } - return message_types; -} - -TString MessageIdentifierName(const TString& name) { - return grpc_generator::StringReplace(name, ".", "_"); -} - -TString NodeObjectPath(const Descriptor* descriptor) { - TString module_alias = ModuleAlias(descriptor->file()->name()); - TString name = descriptor->full_name(); - grpc_generator::StripPrefix(&name, descriptor->file()->package() + "."); - return module_alias + "." + name; -} - -// Prints out the message serializer and deserializer functions -void PrintMessageTransformer(const Descriptor* descriptor, Printer* out, - const Parameters& params) { - map<TString, TString> template_vars; - TString full_name = descriptor->full_name(); - template_vars["identifier_name"] = MessageIdentifierName(full_name); - template_vars["name"] = full_name; - template_vars["node_name"] = NodeObjectPath(descriptor); - // Print the serializer - out->Print(template_vars, "function serialize_$identifier_name$(arg) {\n"); - out->Indent(); - out->Print(template_vars, "if (!(arg instanceof $node_name$)) {\n"); - out->Indent(); - out->Print(template_vars, - "throw new Error('Expected argument of type $name$');\n"); - out->Outdent(); - out->Print("}\n"); - if (params.minimum_node_version > 5) { - // Node version is > 5, we should use Buffer.from - out->Print("return Buffer.from(arg.serializeBinary());\n"); - } else { - out->Print("return new Buffer(arg.serializeBinary());\n"); - } - out->Outdent(); - out->Print("}\n\n"); - - // Print the deserializer - out->Print(template_vars, - "function deserialize_$identifier_name$(buffer_arg) {\n"); - out->Indent(); - out->Print( - template_vars, - "return $node_name$.deserializeBinary(new Uint8Array(buffer_arg));\n"); - out->Outdent(); - out->Print("}\n\n"); -} - -void PrintMethod(const MethodDescriptor* method, Printer* out) { - const Descriptor* input_type = method->input_type(); - const Descriptor* output_type = method->output_type(); - map<TString, TString> vars; - vars["service_name"] = method->service()->full_name(); - vars["name"] = method->name(); - vars["input_type"] = NodeObjectPath(input_type); - vars["input_type_id"] = MessageIdentifierName(input_type->full_name()); - vars["output_type"] = NodeObjectPath(output_type); - vars["output_type_id"] = MessageIdentifierName(output_type->full_name()); - vars["client_stream"] = method->client_streaming() ? "true" : "false"; - vars["server_stream"] = method->server_streaming() ? "true" : "false"; - out->Print("{\n"); - out->Indent(); - out->Print(vars, "path: '/$service_name$/$name$',\n"); - out->Print(vars, "requestStream: $client_stream$,\n"); - out->Print(vars, "responseStream: $server_stream$,\n"); - out->Print(vars, "requestType: $input_type$,\n"); - out->Print(vars, "responseType: $output_type$,\n"); - out->Print(vars, "requestSerialize: serialize_$input_type_id$,\n"); - out->Print(vars, "requestDeserialize: deserialize_$input_type_id$,\n"); - out->Print(vars, "responseSerialize: serialize_$output_type_id$,\n"); - out->Print(vars, "responseDeserialize: deserialize_$output_type_id$,\n"); - out->Outdent(); - out->Print("}"); -} - -// Prints out the service descriptor object -void PrintService(const ServiceDescriptor* service, Printer* out) { - map<TString, TString> template_vars; - out->Print(GetNodeComments(service, true).c_str()); - template_vars["name"] = service->name(); - out->Print(template_vars, "var $name$Service = exports.$name$Service = {\n"); - out->Indent(); - for (int i = 0; i < service->method_count(); i++) { - TString method_name = - grpc_generator::LowercaseFirstLetter(service->method(i)->name()); - out->Print(GetNodeComments(service->method(i), true).c_str()); - out->Print("$method_name$: ", "method_name", method_name); - PrintMethod(service->method(i), out); - out->Print(",\n"); - out->Print(GetNodeComments(service->method(i), false).c_str()); - } - out->Outdent(); - out->Print("};\n\n"); - out->Print(template_vars, - "exports.$name$Client = " - "grpc.makeGenericClientConstructor($name$Service);\n"); - out->Print(GetNodeComments(service, false).c_str()); -} - -void PrintImports(const FileDescriptor* file, Printer* out) { - out->Print("var grpc = require('grpc');\n"); - if (file->message_type_count() > 0) { - TString file_path = - GetRelativePath(file->name(), GetJSMessageFilename(file->name())); - out->Print("var $module_alias$ = require('$file_path$');\n", "module_alias", - ModuleAlias(file->name()), "file_path", file_path); - } - - for (int i = 0; i < file->dependency_count(); i++) { - TString file_path = GetRelativePath( - file->name(), GetJSMessageFilename(file->dependency(i)->name())); - out->Print("var $module_alias$ = require('$file_path$');\n", "module_alias", - ModuleAlias(file->dependency(i)->name()), "file_path", - file_path); - } - out->Print("\n"); -} - -void PrintTransformers(const FileDescriptor* file, Printer* out, - const Parameters& params) { - map<TString, const Descriptor*> messages = GetAllMessages(file); - for (std::map<TString, const Descriptor*>::iterator it = messages.begin(); - it != messages.end(); it++) { - PrintMessageTransformer(it->second, out, params); - } - out->Print("\n"); -} - -void PrintServices(const FileDescriptor* file, Printer* out) { - for (int i = 0; i < file->service_count(); i++) { - PrintService(file->service(i), out); - } -} -} // namespace - -TString GenerateFile(const FileDescriptor* file, const Parameters& params) { - TString output; - { - StringOutputStream output_stream(&output); - Printer out(&output_stream, '$'); - - if (file->service_count() == 0) { - return output; - } - out.Print("// GENERATED CODE -- DO NOT EDIT!\n\n"); - - TString leading_comments = GetNodeComments(file, true); - if (!leading_comments.empty()) { - out.Print("// Original file comments:\n"); - out.PrintRaw(leading_comments.c_str()); - } - - out.Print("'use strict';\n"); - - PrintImports(file, &out); - - PrintTransformers(file, &out, params); - - PrintServices(file, &out); - - out.Print(GetNodeComments(file, false).c_str()); - } - return output; -} - -} // namespace grpc_node_generator diff --git a/contrib/libs/grpc/src/compiler/node_generator.h b/contrib/libs/grpc/src/compiler/node_generator.h deleted file mode 100644 index 959df436ea..0000000000 --- a/contrib/libs/grpc/src/compiler/node_generator.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * Copyright 2016 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_NODE_GENERATOR_H -#define GRPC_INTERNAL_COMPILER_NODE_GENERATOR_H - -#include "src/compiler/config.h" - -namespace grpc_node_generator { - -// Contains all the parameters that are parsed from the command line. -struct Parameters { - // Sets the earliest version of nodejs that needs to be supported. - int minimum_node_version; -}; - -TString GenerateFile(const grpc::protobuf::FileDescriptor* file, - const Parameters& params); - -} // namespace grpc_node_generator - -#endif // GRPC_INTERNAL_COMPILER_NODE_GENERATOR_H diff --git a/contrib/libs/grpc/src/compiler/node_generator_helpers.h b/contrib/libs/grpc/src/compiler/node_generator_helpers.h deleted file mode 100644 index ccf57ec8a6..0000000000 --- a/contrib/libs/grpc/src/compiler/node_generator_helpers.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * Copyright 2016 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_NODE_GENERATOR_HELPERS_H -#define GRPC_INTERNAL_COMPILER_NODE_GENERATOR_HELPERS_H - -#include <algorithm> - -#include "src/compiler/config.h" -#include "src/compiler/generator_helpers.h" - -namespace grpc_node_generator { - -inline TString GetJSServiceFilename(const TString& filename) { - return grpc_generator::StripProto(filename) + "_grpc_pb.js"; -} - -// Get leading or trailing comments in a string. Comment lines start with "// ". -// Leading detached comments are put in front of leading comments. -template <typename DescriptorType> -inline TString GetNodeComments(const DescriptorType* desc, bool leading) { - return grpc_generator::GetPrefixedComments(desc, leading, "//"); -} - -} // namespace grpc_node_generator - -#endif // GRPC_INTERNAL_COMPILER_NODE_GENERATOR_HELPERS_H diff --git a/contrib/libs/grpc/src/compiler/objective_c_generator.cc b/contrib/libs/grpc/src/compiler/objective_c_generator.cc deleted file mode 100644 index ec7b90f8a7..0000000000 --- a/contrib/libs/grpc/src/compiler/objective_c_generator.cc +++ /dev/null @@ -1,451 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "src/compiler/objective_c_generator.h" - -#include <map> -#include <set> -#include <sstream> - -#include <google/protobuf/compiler/objectivec/objectivec_helpers.h> - -#include "src/compiler/config.h" -#include "src/compiler/objective_c_generator_helpers.h" - -using ::google::protobuf::compiler::objectivec::ClassName; -using ::grpc::protobuf::FileDescriptor; -using ::grpc::protobuf::MethodDescriptor; -using ::grpc::protobuf::ServiceDescriptor; -using ::grpc::protobuf::io::Printer; -using ::std::map; -using ::std::set; - -namespace grpc_objective_c_generator { -namespace { - -void PrintProtoRpcDeclarationAsPragma(Printer* printer, - const MethodDescriptor* method, - map< ::TString, ::TString> vars) { - vars["client_stream"] = method->client_streaming() ? "stream " : ""; - vars["server_stream"] = method->server_streaming() ? "stream " : ""; - - printer->Print(vars, - "#pragma mark $method_name$($client_stream$$request_type$)" - " returns ($server_stream$$response_type$)\n\n"); -} - -template <typename DescriptorType> -static void PrintAllComments(const DescriptorType* desc, Printer* printer, - bool deprecated = false) { - std::vector<TString> comments; - grpc_generator::GetComment(desc, grpc_generator::COMMENTTYPE_LEADING_DETACHED, - &comments); - grpc_generator::GetComment(desc, grpc_generator::COMMENTTYPE_LEADING, - &comments); - grpc_generator::GetComment(desc, grpc_generator::COMMENTTYPE_TRAILING, - &comments); - if (comments.empty()) { - return; - } - printer->Print("/**\n"); - for (auto it = comments.begin(); it != comments.end(); ++it) { - printer->Print(" * "); - size_t start_pos = it->find_first_not_of(' '); - if (start_pos != TString::npos) { - printer->PrintRaw(it->c_str() + start_pos); - } - printer->Print("\n"); - } - if (deprecated) { - printer->Print(" *\n"); - printer->Print( - " * This method belongs to a set of APIs that have been deprecated. " - "Using" - " the v2 API is recommended.\n"); - } - printer->Print(" */\n"); -} - -void PrintMethodSignature(Printer* printer, const MethodDescriptor* method, - const map< ::TString, ::TString>& vars) { - // Print comment - PrintAllComments(method, printer, true); - - printer->Print(vars, "- ($return_type$)$method_name$With"); - if (method->client_streaming()) { - printer->Print("RequestsWriter:(GRXWriter *)requestWriter"); - } else { - printer->Print(vars, "Request:($request_class$ *)request"); - } - - // TODO(jcanizales): Put this on a new line and align colons. - if (method->server_streaming()) { - printer->Print(vars, - " eventHandler:(void(^)(BOOL done, " - "$response_class$ *_Nullable response, NSError *_Nullable " - "error))eventHandler"); - } else { - printer->Print(vars, - " handler:(void(^)($response_class$ *_Nullable response, " - "NSError *_Nullable error))handler"); - } -} - -void PrintSimpleSignature(Printer* printer, const MethodDescriptor* method, - map< ::TString, ::TString> vars) { - vars["method_name"] = - grpc_generator::LowercaseFirstLetter(vars["method_name"]); - vars["return_type"] = "void"; - PrintMethodSignature(printer, method, vars); -} - -void PrintAdvancedSignature(Printer* printer, const MethodDescriptor* method, - map< ::TString, ::TString> vars) { - vars["method_name"] = "RPCTo" + vars["method_name"]; - vars["return_type"] = "GRPCProtoCall *"; - PrintMethodSignature(printer, method, vars); -} - -void PrintV2Signature(Printer* printer, const MethodDescriptor* method, - map< ::TString, ::TString> vars) { - if (method->client_streaming()) { - vars["return_type"] = "GRPCStreamingProtoCall *"; - } else { - vars["return_type"] = "GRPCUnaryProtoCall *"; - } - vars["method_name"] = - grpc_generator::LowercaseFirstLetter(vars["method_name"]); - - PrintAllComments(method, printer); - - printer->Print(vars, "- ($return_type$)$method_name$With"); - if (method->client_streaming()) { - printer->Print("ResponseHandler:(id<GRPCProtoResponseHandler>)handler"); - } else { - printer->Print(vars, - "Message:($request_class$ *)message " - "responseHandler:(id<GRPCProtoResponseHandler>)handler"); - } - printer->Print(" callOptions:(GRPCCallOptions *_Nullable)callOptions"); -} - -inline map< ::TString, ::TString> GetMethodVars( - const MethodDescriptor* method) { - map< ::TString, ::TString> res; - res["method_name"] = method->name(); - res["request_type"] = method->input_type()->name(); - res["response_type"] = method->output_type()->name(); - res["request_class"] = ClassName(method->input_type()); - res["response_class"] = ClassName(method->output_type()); - return res; -} - -void PrintMethodDeclarations(Printer* printer, const MethodDescriptor* method) { - map< ::TString, ::TString> vars = GetMethodVars(method); - - PrintProtoRpcDeclarationAsPragma(printer, method, vars); - - PrintSimpleSignature(printer, method, vars); - printer->Print(";\n\n"); - PrintAdvancedSignature(printer, method, vars); - printer->Print(";\n\n\n"); -} - -void PrintV2MethodDeclarations(Printer* printer, - const MethodDescriptor* method) { - map< ::TString, ::TString> vars = GetMethodVars(method); - - PrintProtoRpcDeclarationAsPragma(printer, method, vars); - - PrintV2Signature(printer, method, vars); - printer->Print(";\n\n"); -} - -void PrintSimpleImplementation(Printer* printer, const MethodDescriptor* method, - map< ::TString, ::TString> vars) { - printer->Print("{\n"); - printer->Print(vars, " [[self RPCTo$method_name$With"); - if (method->client_streaming()) { - printer->Print("RequestsWriter:requestWriter"); - } else { - printer->Print("Request:request"); - } - if (method->server_streaming()) { - printer->Print(" eventHandler:eventHandler] start];\n"); - } else { - printer->Print(" handler:handler] start];\n"); - } - printer->Print("}\n"); -} - -void PrintAdvancedImplementation(Printer* printer, - const MethodDescriptor* method, - map< ::TString, ::TString> vars) { - printer->Print("{\n"); - printer->Print(vars, " return [self RPCToMethod:@\"$method_name$\"\n"); - - printer->Print(" requestsWriter:"); - if (method->client_streaming()) { - printer->Print("requestWriter\n"); - } else { - printer->Print("[GRXWriter writerWithValue:request]\n"); - } - - printer->Print(vars, " responseClass:[$response_class$ class]\n"); - - printer->Print(" responsesWriteable:[GRXWriteable "); - if (method->server_streaming()) { - printer->Print("writeableWithEventHandler:eventHandler]];\n"); - } else { - printer->Print("writeableWithSingleHandler:handler]];\n"); - } - - printer->Print("}\n"); -} - -void PrintV2Implementation(Printer* printer, const MethodDescriptor* method, - map< ::TString, ::TString> vars) { - printer->Print(" {\n"); - if (method->client_streaming()) { - printer->Print(vars, " return [self RPCToMethod:@\"$method_name$\"\n"); - printer->Print(" responseHandler:handler\n"); - printer->Print(" callOptions:callOptions\n"); - printer->Print( - vars, " responseClass:[$response_class$ class]];\n}\n\n"); - } else { - printer->Print(vars, " return [self RPCToMethod:@\"$method_name$\"\n"); - printer->Print(" message:message\n"); - printer->Print(" responseHandler:handler\n"); - printer->Print(" callOptions:callOptions\n"); - printer->Print( - vars, " responseClass:[$response_class$ class]];\n}\n\n"); - } -} - -void PrintMethodImplementations(Printer* printer, - const MethodDescriptor* method, - const Parameters& generator_params) { - map< ::TString, ::TString> vars = GetMethodVars(method); - - PrintProtoRpcDeclarationAsPragma(printer, method, vars); - - if (!generator_params.no_v1_compatibility) { - // TODO(jcanizales): Print documentation from the method. - PrintSimpleSignature(printer, method, vars); - PrintSimpleImplementation(printer, method, vars); - - printer->Print("// Returns a not-yet-started RPC object.\n"); - PrintAdvancedSignature(printer, method, vars); - PrintAdvancedImplementation(printer, method, vars); - } - - PrintV2Signature(printer, method, vars); - PrintV2Implementation(printer, method, vars); -} - -} // namespace - -::TString GetAllMessageClasses(const FileDescriptor* file) { - ::TString output; - set< ::TString> classes; - for (int i = 0; i < file->service_count(); i++) { - const auto service = file->service(i); - for (int i = 0; i < service->method_count(); i++) { - const auto method = service->method(i); - classes.insert(ClassName(method->input_type())); - classes.insert(ClassName(method->output_type())); - } - } - for (auto one_class : classes) { - output += "@class " + one_class + ";\n"; - } - - return output; -} - -::TString GetProtocol(const ServiceDescriptor* service, - const Parameters& generator_params) { - ::TString output; - - if (generator_params.no_v1_compatibility) return output; - - // Scope the output stream so it closes and finalizes output to the string. - grpc::protobuf::io::StringOutputStream output_stream(&output); - Printer printer(&output_stream, '$'); - - map< ::TString, ::TString> vars = { - {"service_class", ServiceClassName(service)}}; - - printer.Print(vars, - "/**\n" - " * The methods in this protocol belong to a set of old APIs " - "that have been deprecated. They do not\n" - " * recognize call options provided in the initializer. Using " - "the v2 protocol is recommended.\n" - " */\n"); - printer.Print(vars, "@protocol $service_class$ <NSObject>\n\n"); - for (int i = 0; i < service->method_count(); i++) { - PrintMethodDeclarations(&printer, service->method(i)); - } - printer.Print("@end\n\n"); - - return output; -} - -::TString GetV2Protocol(const ServiceDescriptor* service) { - ::TString output; - - // Scope the output stream so it closes and finalizes output to the string. - grpc::protobuf::io::StringOutputStream output_stream(&output); - Printer printer(&output_stream, '$'); - - map< ::TString, ::TString> vars = { - {"service_class", ServiceClassName(service) + "2"}}; - - printer.Print(vars, "@protocol $service_class$ <NSObject>\n\n"); - for (int i = 0; i < service->method_count(); i++) { - PrintV2MethodDeclarations(&printer, service->method(i)); - } - printer.Print("@end\n\n"); - - return output; -} - -::TString GetInterface(const ServiceDescriptor* service, - const Parameters& generator_params) { - ::TString output; - - // Scope the output stream so it closes and finalizes output to the string. - grpc::protobuf::io::StringOutputStream output_stream(&output); - Printer printer(&output_stream, '$'); - - map< ::TString, ::TString> vars = { - {"service_class", ServiceClassName(service)}}; - - printer.Print(vars, - "/**\n" - " * Basic service implementation, over gRPC, that only does\n" - " * marshalling and parsing.\n" - " */\n"); - printer.Print(vars, - "@interface $service_class$ :" - " GRPCProtoService<$service_class$2"); - if (!generator_params.no_v1_compatibility) { - printer.Print(vars, ", $service_class$"); - } - printer.Print(">\n"); - printer.Print( - "- (instancetype)initWithHost:(NSString *)host " - "callOptions:(GRPCCallOptions " - "*_Nullable)callOptions" - " NS_DESIGNATED_INITIALIZER;\n"); - printer.Print( - "+ (instancetype)serviceWithHost:(NSString *)host " - "callOptions:(GRPCCallOptions *_Nullable)callOptions;\n"); - if (!generator_params.no_v1_compatibility) { - printer.Print( - "// The following methods belong to a set of old APIs that have been " - "deprecated.\n"); - printer.Print("- (instancetype)initWithHost:(NSString *)host;\n"); - printer.Print("+ (instancetype)serviceWithHost:(NSString *)host;\n"); - } - printer.Print("@end\n"); - - return output; -} - -::TString GetSource(const ServiceDescriptor* service, - const Parameters& generator_params) { - ::TString output; - { - // Scope the output stream so it closes and finalizes output to the string. - grpc::protobuf::io::StringOutputStream output_stream(&output); - Printer printer(&output_stream, '$'); - - map< ::TString, ::TString> vars = { - {"service_name", service->name()}, - {"service_class", ServiceClassName(service)}, - {"package", service->file()->package()}}; - - printer.Print(vars, - "@implementation $service_class$\n\n" - "#pragma clang diagnostic push\n" - "#pragma clang diagnostic ignored " - "\"-Wobjc-designated-initializers\"\n\n" - "// Designated initializer\n" - "- (instancetype)initWithHost:(NSString *)host " - "callOptions:(GRPCCallOptions *_Nullable)callOptions {\n" - " return [super initWithHost:host\n" - " packageName:@\"$package$\"\n" - " serviceName:@\"$service_name$\"\n" - " callOptions:callOptions];\n" - "}\n\n"); - if (!generator_params.no_v1_compatibility) { - printer.Print(vars, - "- (instancetype)initWithHost:(NSString *)host {\n" - " return [super initWithHost:host\n" - " packageName:@\"$package$\"\n" - " serviceName:@\"$service_name$\"];\n" - "}\n\n"); - } - printer.Print("#pragma clang diagnostic pop\n\n"); - - if (!generator_params.no_v1_compatibility) { - printer.Print( - "// Override superclass initializer to disallow different" - " package and service names.\n" - "- (instancetype)initWithHost:(NSString *)host\n" - " packageName:(NSString *)packageName\n" - " serviceName:(NSString *)serviceName {\n" - " return [self initWithHost:host];\n" - "}\n\n"); - } - printer.Print( - "- (instancetype)initWithHost:(NSString *)host\n" - " packageName:(NSString *)packageName\n" - " serviceName:(NSString *)serviceName\n" - " callOptions:(GRPCCallOptions *)callOptions {\n" - " return [self initWithHost:host callOptions:callOptions];\n" - "}\n\n"); - - printer.Print("#pragma mark - Class Methods\n\n"); - if (!generator_params.no_v1_compatibility) { - printer.Print( - "+ (instancetype)serviceWithHost:(NSString *)host {\n" - " return [[self alloc] initWithHost:host];\n" - "}\n\n"); - } - printer.Print( - "+ (instancetype)serviceWithHost:(NSString *)host " - "callOptions:(GRPCCallOptions *_Nullable)callOptions {\n" - " return [[self alloc] initWithHost:host callOptions:callOptions];\n" - "}\n\n"); - - printer.Print("#pragma mark - Method Implementations\n\n"); - - for (int i = 0; i < service->method_count(); i++) { - PrintMethodImplementations(&printer, service->method(i), - generator_params); - } - - printer.Print("@end\n"); - } - return output; -} - -} // namespace grpc_objective_c_generator diff --git a/contrib/libs/grpc/src/compiler/objective_c_generator.h b/contrib/libs/grpc/src/compiler/objective_c_generator.h deleted file mode 100644 index 9770f65436..0000000000 --- a/contrib/libs/grpc/src/compiler/objective_c_generator.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_H -#define GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_H - -#include "src/compiler/config.h" - -namespace grpc_objective_c_generator { - -struct Parameters { - // Do not generate V1 interface and implementation - bool no_v1_compatibility; -}; - -using ::grpc::protobuf::FileDescriptor; -using ::grpc::protobuf::ServiceDescriptor; -using ::TString; - -// Returns forward declaration of classes in the generated header file. -string GetAllMessageClasses(const FileDescriptor* file); - -// Returns the content to be included defining the @protocol segment at the -// insertion point of the generated implementation file. This interface is -// legacy and for backwards compatibility. -string GetProtocol(const ServiceDescriptor* service, - const Parameters& generator_params); - -// Returns the content to be included defining the @protocol segment at the -// insertion point of the generated implementation file. -string GetV2Protocol(const ServiceDescriptor* service); - -// Returns the content to be included defining the @interface segment at the -// insertion point of the generated implementation file. -string GetInterface(const ServiceDescriptor* service, - const Parameters& generator_params); - -// Returns the content to be included in the "global_scope" insertion point of -// the generated implementation file. -string GetSource(const ServiceDescriptor* service, - const Parameters& generator_params); - -} // namespace grpc_objective_c_generator - -#endif // GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_H diff --git a/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h b/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h deleted file mode 100644 index c8336a3fc9..0000000000 --- a/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H -#define GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H - -#include <map> - -#include <google/protobuf/compiler/objectivec/objectivec_helpers.h> - -#include "src/compiler/config.h" -#include "src/compiler/generator_helpers.h" - -namespace grpc_objective_c_generator { - -using ::grpc::protobuf::FileDescriptor; -using ::grpc::protobuf::ServiceDescriptor; -using ::TString; - -inline string MessageHeaderName(const FileDescriptor* file) { - return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h"; -} - -inline string ServiceClassName(const ServiceDescriptor* service) { - const FileDescriptor* file = service->file(); - string prefix = google::protobuf::compiler::objectivec::FileClassPrefix(file); - return prefix + service->name(); -} - -inline ::TString LocalImport(const ::TString& import) { - return ::TString("#import \"" + import + "\"\n"); -} - -inline ::TString FrameworkImport(const ::TString& import, - const ::TString& framework) { - // Flattens the directory structure: grab the file name only - std::size_t pos = import.rfind("/"); - // If pos is npos, pos + 1 is 0, which gives us the entire string, - // so there's no need to check that - ::TString filename = import.substr(pos + 1, import.size() - (pos + 1)); - return ::TString("#import <" + framework + "/" + filename + ">\n"); -} - -inline ::TString SystemImport(const ::TString& import) { - return ::TString("#import <" + import + ">\n"); -} - -inline ::TString PreprocConditional(::TString symbol, bool invert) { - return invert ? "!defined(" + symbol + ") || !" + symbol - : "defined(" + symbol + ") && " + symbol; -} - -inline ::TString PreprocIf(const ::TString& symbol, - const ::TString& if_true) { - return ::TString("#if " + PreprocConditional(symbol, false) + "\n" + - if_true + "#endif\n"); -} - -inline ::TString PreprocIfNot(const ::TString& symbol, - const ::TString& if_true) { - return ::TString("#if " + PreprocConditional(symbol, true) + "\n" + - if_true + "#endif\n"); -} - -inline ::TString PreprocIfElse(const ::TString& symbol, - const ::TString& if_true, - const ::TString& if_false) { - return ::TString("#if " + PreprocConditional(symbol, false) + "\n" + - if_true + "#else\n" + if_false + "#endif\n"); -} - -inline ::TString PreprocIfNotElse(const ::TString& symbol, - const ::TString& if_true, - const ::TString& if_false) { - return ::TString("#if " + PreprocConditional(symbol, true) + "\n" + - if_true + "#else\n" + if_false + "#endif\n"); -} - -} // namespace grpc_objective_c_generator -#endif // GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H diff --git a/contrib/libs/grpc/src/compiler/php_generator.cc b/contrib/libs/grpc/src/compiler/php_generator.cc deleted file mode 100644 index a0c1ef9be1..0000000000 --- a/contrib/libs/grpc/src/compiler/php_generator.cc +++ /dev/null @@ -1,340 +0,0 @@ -/* - * - * Copyright 2016 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <map> - -#include <google/protobuf/compiler/php/php_generator.h> - -#include "src/compiler/config.h" -#include "src/compiler/generator_helpers.h" -#include "src/compiler/php_generator_helpers.h" - -using google::protobuf::compiler::php::GeneratedClassName; -using grpc::protobuf::Descriptor; -using grpc::protobuf::FileDescriptor; -using grpc::protobuf::MethodDescriptor; -using grpc::protobuf::ServiceDescriptor; -using grpc::protobuf::io::Printer; -using grpc::protobuf::io::StringOutputStream; -using std::map; - -namespace grpc_php_generator { -namespace { - -TString ConvertToPhpNamespace(const TString& name) { - std::vector<TString> tokens = grpc_generator::tokenize(name, "."); - std::ostringstream oss; - for (unsigned int i = 0; i < tokens.size(); i++) { - oss << (i == 0 ? "" : "\\") - << grpc_generator::CapitalizeFirstLetter(tokens[i]); - } - return oss.str(); -} - -TString PackageName(const FileDescriptor* file) { - if (file->options().has_php_namespace()) { - return file->options().php_namespace(); - } else { - return ConvertToPhpNamespace(file->package()); - } -} - -TString MessageIdentifierName(const TString& name, - const FileDescriptor* file) { - std::vector<TString> tokens = grpc_generator::tokenize(name, "."); - std::ostringstream oss; - if (PackageName(file) != "") { - oss << PackageName(file) << "\\"; - } - oss << grpc_generator::CapitalizeFirstLetter(tokens[tokens.size() - 1]); - return oss.str(); -} - -void PrintMethod(const MethodDescriptor* method, Printer* out) { - const Descriptor* input_type = method->input_type(); - const Descriptor* output_type = method->output_type(); - map<TString, TString> vars; - vars["service_name"] = method->service()->full_name(); - vars["name"] = method->name(); - vars["input_type_id"] = - MessageIdentifierName(GeneratedClassName(input_type), input_type->file()); - vars["output_type_id"] = MessageIdentifierName( - GeneratedClassName(output_type), output_type->file()); - - out->Print("/**\n"); - out->Print(GetPHPComments(method, " *").c_str()); - if (method->client_streaming()) { - if (method->server_streaming()) { - vars["return_type_id"] = "\\Grpc\\BidiStreamingCall"; - } else { - vars["return_type_id"] = "\\Grpc\\ClientStreamingCall"; - } - out->Print(vars, - " * @param array $$metadata metadata\n" - " * @param array $$options call options\n" - " * @return $return_type_id$\n */\n" - "public function $name$($$metadata = [], " - "$$options = []) {\n"); - out->Indent(); - out->Indent(); - if (method->server_streaming()) { - out->Print("return $$this->_bidiRequest("); - } else { - out->Print("return $$this->_clientStreamRequest("); - } - out->Print(vars, - "'/$service_name$/$name$',\n" - "['\\$output_type_id$','decode'],\n" - "$$metadata, $$options);\n"); - } else { - if (method->server_streaming()) { - vars["return_type_id"] = "\\Grpc\\ServerStreamingCall"; - } else { - vars["return_type_id"] = "\\Grpc\\UnaryCall"; - } - out->Print(vars, - " * @param \\$input_type_id$ $$argument input argument\n" - " * @param array $$metadata metadata\n" - " * @param array $$options call options\n" - " * @return $return_type_id$\n */\n" - "public function $name$(\\$input_type_id$ $$argument,\n" - " $$metadata = [], $$options = []) {\n"); - out->Indent(); - out->Indent(); - if (method->server_streaming()) { - out->Print("return $$this->_serverStreamRequest("); - } else { - out->Print("return $$this->_simpleRequest("); - } - out->Print(vars, - "'/$service_name$/$name$',\n" - "$$argument,\n" - "['\\$output_type_id$', 'decode'],\n" - "$$metadata, $$options);\n"); - } - out->Outdent(); - out->Outdent(); - out->Print("}\n\n"); -} - -void PrintServerMethod(const MethodDescriptor* method, Printer* out) { - map<TString, TString> vars; - const Descriptor* input_type = method->input_type(); - const Descriptor* output_type = method->output_type(); - vars["service_name"] = method->service()->full_name(); - vars["method_name"] = method->name(); - vars["input_type_id"] = - MessageIdentifierName(GeneratedClassName(input_type), input_type->file()); - vars["output_type_id"] = MessageIdentifierName( - GeneratedClassName(output_type), output_type->file()); - - out->Print("/**\n"); - out->Print(GetPHPComments(method, " *").c_str()); - - const char* method_template; - if (method->client_streaming() && method->server_streaming()) { - method_template = - " * @param \\Grpc\\ServerCallReader $$reader read client request data " - "of \\$input_type_id$\n" - " * @param \\Grpc\\ServerCallWriter $$writer write response data of " - "\\$output_type_id$\n" - " * @param \\Grpc\\ServerContext $$context server request context\n" - " * @return void\n" - " */\n" - "public function $method_name$(\n" - " \\Grpc\\ServerCallReader $$reader,\n" - " \\Grpc\\ServerCallWriter $$writer,\n" - " \\Grpc\\ServerContext $$context\n" - "): void {\n" - " $$context->setStatus(\\Grpc\\Status::unimplemented());\n" - " $$writer->finish();\n" - "}\n\n"; - } else if (method->client_streaming()) { - method_template = - " * @param \\Grpc\\ServerCallReader $$reader read client request data " - "of \\$input_type_id$\n" - " * @param \\Grpc\\ServerContext $$context server request context\n" - " * @return \\$output_type_id$ for response data, null if if error " - "occured\n" - " * initial metadata (if any) and status (if not ok) should be set " - "to $$context\n" - " */\n" - "public function $method_name$(\n" - " \\Grpc\\ServerCallReader $$reader,\n" - " \\Grpc\\ServerContext $$context\n" - "): ?\\$output_type_id$ {\n" - " $$context->setStatus(\\Grpc\\Status::unimplemented());\n" - " return null;\n" - "}\n\n"; - } else if (method->server_streaming()) { - method_template = - " * @param \\$input_type_id$ $$request client request\n" - " * @param \\Grpc\\ServerCallWriter $$writer write response data of " - "\\$output_type_id$\n" - " * @param \\Grpc\\ServerContext $$context server request context\n" - " * @return void\n" - " */\n" - "public function $method_name$(\n" - " \\$input_type_id$ $$request,\n" - " \\Grpc\\ServerCallWriter $$writer,\n" - " \\Grpc\\ServerContext $$context\n" - "): void {\n" - " $$context->setStatus(\\Grpc\\Status::unimplemented());\n" - " $$writer->finish();\n" - "}\n\n"; - } else { - method_template = - " * @param \\$input_type_id$ $$request client request\n" - " * @param \\Grpc\\ServerContext $$context server request context\n" - " * @return \\$output_type_id$ for response data, null if if error " - "occured\n" - " * initial metadata (if any) and status (if not ok) should be set " - "to $$context\n" - " */\n" - "public function $method_name$(\n" - " \\$input_type_id$ $$request,\n" - " \\Grpc\\ServerContext $$context\n" - "): ?\\$output_type_id$ {\n" - " $$context->setStatus(\\Grpc\\Status::unimplemented());\n" - " return null;\n" - "}\n\n"; - } - out->Print(vars, method_template); -} - -void PrintServerMethodDescriptors(const ServiceDescriptor* service, - Printer* out) { - map<TString, TString> vars; - vars["service_name"] = service->full_name(); - - out->Print( - "/**\n" - " * Get the method descriptors of the service for server registration\n" - " *\n" - " * @return array of \\Grpc\\MethodDescriptor for the service methods\n" - " */\n" - "public final function getMethodDescriptors(): array\n{\n"); - out->Indent(); - out->Indent(); - out->Print("return [\n"); - out->Indent(); - out->Indent(); - for (int i = 0; i < service->method_count(); i++) { - auto method = service->method(i); - auto input_type = method->input_type(); - vars["method_name"] = method->name(); - vars["input_type_id"] = MessageIdentifierName( - GeneratedClassName(input_type), input_type->file()); - if (method->client_streaming() && method->server_streaming()) { - vars["call_type"] = "BIDI_STREAMING_CALL"; - } else if (method->client_streaming()) { - vars["call_type"] = "CLIENT_STREAMING_CALL"; - } else if (method->server_streaming()) { - vars["call_type"] = "SERVER_STREAMING_CALL"; - } else { - vars["call_type"] = "UNARY_CALL"; - } - out->Print( - vars, - "'/$service_name$/$method_name$' => new \\Grpc\\MethodDescriptor(\n" - " $$this,\n" - " '$method_name$',\n" - " '\\$input_type_id$',\n" - " \\Grpc\\MethodDescriptor::$call_type$\n" - "),\n"); - } - out->Outdent(); - out->Outdent(); - out->Print("];\n"); - out->Outdent(); - out->Outdent(); - out->Print("}\n\n"); -} - -// Prints out the service descriptor object -void PrintService(const ServiceDescriptor* service, - const TString& class_suffix, bool is_server, - Printer* out) { - map<TString, TString> vars; - out->Print("/**\n"); - out->Print(GetPHPComments(service, " *").c_str()); - out->Print(" */\n"); - vars["name"] = GetPHPServiceClassname(service, class_suffix, is_server); - vars["extends"] = is_server ? "" : "extends \\Grpc\\BaseStub "; - out->Print(vars, "class $name$ $extends${\n\n"); - out->Indent(); - out->Indent(); - if (!is_server) { - out->Print( - "/**\n * @param string $$hostname hostname\n" - " * @param array $$opts channel options\n" - " * @param \\Grpc\\Channel $$channel (optional) re-use channel object\n" - " */\n" - "public function __construct($$hostname, $$opts, " - "$$channel = null) {\n"); - out->Indent(); - out->Indent(); - out->Print("parent::__construct($$hostname, $$opts, $$channel);\n"); - out->Outdent(); - out->Outdent(); - out->Print("}\n\n"); - } - for (int i = 0; i < service->method_count(); i++) { - if (is_server) { - PrintServerMethod(service->method(i), out); - } else { - PrintMethod(service->method(i), out); - } - } - if (is_server) { - PrintServerMethodDescriptors(service, out); - } - out->Outdent(); - out->Outdent(); - out->Print("}\n"); -} -} // namespace - -TString GenerateFile(const FileDescriptor* file, - const ServiceDescriptor* service, - const TString& class_suffix, bool is_server) { - TString output; - { - StringOutputStream output_stream(&output); - Printer out(&output_stream, '$'); - - out.Print("<?php\n"); - out.Print("// GENERATED CODE -- DO NOT EDIT!\n\n"); - - TString leading_comments = GetPHPComments(file, "//"); - if (!leading_comments.empty()) { - out.Print("// Original file comments:\n"); - out.PrintRaw(leading_comments.c_str()); - } - - map<TString, TString> vars; - TString php_namespace = PackageName(file); - vars["package"] = php_namespace; - out.Print(vars, "namespace $package$;\n\n"); - - PrintService(service, class_suffix, is_server, &out); - } - return output; -} - -} // namespace grpc_php_generator diff --git a/contrib/libs/grpc/src/compiler/php_generator_helpers.h b/contrib/libs/grpc/src/compiler/php_generator_helpers.h deleted file mode 100644 index 93479e20a2..0000000000 --- a/contrib/libs/grpc/src/compiler/php_generator_helpers.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * - * Copyright 2016 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_PHP_GENERATOR_HELPERS_H -#define GRPC_INTERNAL_COMPILER_PHP_GENERATOR_HELPERS_H - -#include <algorithm> - -#include "src/compiler/config.h" -#include "src/compiler/generator_helpers.h" - -namespace grpc_php_generator { - -inline TString GetPHPServiceClassname( - const grpc::protobuf::ServiceDescriptor* service, - const TString& class_suffix, bool is_server) { - return service->name() + - (class_suffix == "" ? (is_server ? "" : "Client") : class_suffix) + - (is_server ? "Stub" : ""); -} - -// ReplaceAll replaces all instances of search with replace in s. -inline TString ReplaceAll(TString s, const TString& search, - const TString& replace) { - size_t pos = 0; - while ((pos = s.find(search, pos)) != TString::npos) { - s.replace(pos, search.length(), replace); - pos += replace.length(); - } - return s; -} - -inline TString GetPHPServiceFilename( - const grpc::protobuf::FileDescriptor* file, - const grpc::protobuf::ServiceDescriptor* service, - const TString& class_suffix, bool is_server) { - std::ostringstream oss; - if (file->options().has_php_namespace()) { - oss << ReplaceAll(file->options().php_namespace(), "\\", "/"); - } else { - std::vector<TString> tokens = - grpc_generator::tokenize(file->package(), "."); - for (unsigned int i = 0; i < tokens.size(); i++) { - oss << (i == 0 ? "" : "/") - << grpc_generator::CapitalizeFirstLetter(tokens[i]); - } - } - return oss.str() + "/" + - GetPHPServiceClassname(service, class_suffix, is_server) + ".php"; -} - -// Get leading or trailing comments in a string. Comment lines start with "// ". -// Leading detached comments are put in front of leading comments. -template <typename DescriptorType> -inline TString GetPHPComments(const DescriptorType* desc, - TString prefix) { - return ReplaceAll(grpc_generator::GetPrefixedComments(desc, true, prefix), - "*/", "*/"); -} - -} // namespace grpc_php_generator - -#endif // GRPC_INTERNAL_COMPILER_PHP_GENERATOR_HELPERS_H diff --git a/contrib/libs/grpc/src/compiler/ruby_generator.cc b/contrib/libs/grpc/src/compiler/ruby_generator.cc deleted file mode 100644 index f5b9e9db87..0000000000 --- a/contrib/libs/grpc/src/compiler/ruby_generator.cc +++ /dev/null @@ -1,215 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "src/compiler/ruby_generator.h" - -#include <cctype> -#include <map> -#include <vector> - -#include "src/compiler/config.h" -#include "src/compiler/ruby_generator_helpers-inl.h" -#include "src/compiler/ruby_generator_map-inl.h" -#include "src/compiler/ruby_generator_string-inl.h" - -using grpc::protobuf::FileDescriptor; -using grpc::protobuf::MethodDescriptor; -using grpc::protobuf::ServiceDescriptor; -using grpc::protobuf::io::Printer; -using grpc::protobuf::io::StringOutputStream; -using std::map; -using std::vector; - -namespace grpc_ruby_generator { -namespace { - -// Prints out the method using the ruby gRPC DSL. -void PrintMethod(const MethodDescriptor* method, Printer* out) { - TString input_type = RubyTypeOf(method->input_type()); - if (method->client_streaming()) { - input_type = "stream(" + input_type + ")"; - } - TString output_type = RubyTypeOf(method->output_type()); - if (method->server_streaming()) { - output_type = "stream(" + output_type + ")"; - } - std::map<TString, TString> method_vars = ListToDict({ - "mth.name", - method->name(), - "input.type", - input_type, - "output.type", - output_type, - }); - out->Print(GetRubyComments(method, true).c_str()); - out->Print(method_vars, "rpc :$mth.name$, $input.type$, $output.type$\n"); - out->Print(GetRubyComments(method, false).c_str()); -} - -// Prints out the service using the ruby gRPC DSL. -void PrintService(const ServiceDescriptor* service, Printer* out) { - if (service->method_count() == 0) { - return; - } - - // Begin the service module - std::map<TString, TString> module_vars = ListToDict({ - "module.name", - Modularize(service->name()), - }); - out->Print(module_vars, "module $module.name$\n"); - out->Indent(); - - out->Print(GetRubyComments(service, true).c_str()); - out->Print("class Service\n"); - - // Write the indented class body. - out->Indent(); - out->Print("\n"); - out->Print("include ::GRPC::GenericService\n"); - out->Print("\n"); - out->Print("self.marshal_class_method = :encode\n"); - out->Print("self.unmarshal_class_method = :decode\n"); - std::map<TString, TString> pkg_vars = - ListToDict({"service_full_name", service->full_name()}); - out->Print(pkg_vars, "self.service_name = '$service_full_name$'\n"); - out->Print("\n"); - for (int i = 0; i < service->method_count(); ++i) { - PrintMethod(service->method(i), out); - } - out->Outdent(); - - out->Print("end\n"); - out->Print("\n"); - out->Print("Stub = Service.rpc_stub_class\n"); - - // End the service module - out->Outdent(); - out->Print("end\n"); - out->Print(GetRubyComments(service, false).c_str()); -} - -} // namespace - -// The following functions are copied directly from the source for the protoc -// ruby generator -// to ensure compatibility (with the exception of int and string type changes). -// See -// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/ruby/ruby_generator.cc#L250 -// TODO: keep up to date with protoc code generation, though this behavior isn't -// expected to change -bool IsLower(char ch) { return ch >= 'a' && ch <= 'z'; } - -char ToUpper(char ch) { return IsLower(ch) ? (ch - 'a' + 'A') : ch; } - -// Package names in protobuf are snake_case by convention, but Ruby module -// names must be PascalCased. -// -// foo_bar_baz -> FooBarBaz -TString PackageToModule(const TString& name) { - bool next_upper = true; - TString result; - result.reserve(name.size()); - - for (TString::size_type i = 0; i < name.size(); i++) { - if (name[i] == '_') { - next_upper = true; - } else { - if (next_upper) { - result.push_back(ToUpper(name[i])); - } else { - result.push_back(name[i]); - } - next_upper = false; - } - } - - return result; -} -// end copying of protoc generator for ruby code - -TString GetServices(const FileDescriptor* file) { - TString output; - { - // Scope the output stream so it closes and finalizes output to the string. - - StringOutputStream output_stream(&output); - Printer out(&output_stream, '$'); - - // Don't write out any output if there no services, to avoid empty service - // files being generated for proto files that don't declare any. - if (file->service_count() == 0) { - return output; - } - - TString package_name = RubyPackage(file); - - // Write out a file header. - std::map<TString, TString> header_comment_vars = ListToDict({ - "file.name", - file->name(), - "file.package", - package_name, - }); - out.Print("# Generated by the protocol buffer compiler. DO NOT EDIT!\n"); - out.Print(header_comment_vars, - "# Source: $file.name$ for package '$file.package$'\n"); - - TString leading_comments = GetRubyComments(file, true); - if (!leading_comments.empty()) { - out.Print("# Original file comments:\n"); - out.PrintRaw(leading_comments.c_str()); - } - - out.Print("\n"); - out.Print("require 'grpc'\n"); - // Write out require statemment to import the separately generated file - // that defines the messages used by the service. This is generated by the - // main ruby plugin. - std::map<TString, TString> dep_vars = ListToDict({ - "dep.name", - MessagesRequireName(file), - }); - out.Print(dep_vars, "require '$dep.name$'\n"); - - // Write out services within the modules - out.Print("\n"); - std::vector<TString> modules = Split(package_name, '.'); - for (size_t i = 0; i < modules.size(); ++i) { - std::map<TString, TString> module_vars = ListToDict({ - "module.name", - PackageToModule(modules[i]), - }); - out.Print(module_vars, "module $module.name$\n"); - out.Indent(); - } - for (int i = 0; i < file->service_count(); ++i) { - auto service = file->service(i); - PrintService(service, &out); - } - for (size_t i = 0; i < modules.size(); ++i) { - out.Outdent(); - out.Print("end\n"); - } - - out.Print(GetRubyComments(file, false).c_str()); - } - return output; -} - -} // namespace grpc_ruby_generator diff --git a/contrib/libs/grpc/src/compiler/ruby_generator.h b/contrib/libs/grpc/src/compiler/ruby_generator.h deleted file mode 100644 index 325dc02294..0000000000 --- a/contrib/libs/grpc/src/compiler/ruby_generator.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_H -#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_H - -#include "src/compiler/config.h" - -namespace grpc_ruby_generator { - -TString GetServices(const grpc::protobuf::FileDescriptor* file); - -} // namespace grpc_ruby_generator - -#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_H diff --git a/contrib/libs/grpc/src/compiler/ruby_generator_helpers-inl.h b/contrib/libs/grpc/src/compiler/ruby_generator_helpers-inl.h deleted file mode 100644 index 9a10976619..0000000000 --- a/contrib/libs/grpc/src/compiler/ruby_generator_helpers-inl.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H -#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H - -#include "src/compiler/config.h" -#include "src/compiler/generator_helpers.h" -#include "src/compiler/ruby_generator_string-inl.h" - -namespace grpc_ruby_generator { - -inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file, - TString* file_name_or_error) { - // Get output file name. - static const unsigned proto_suffix_length = 6; // length of ".proto" - if (file->name().size() > proto_suffix_length && - file->name().find_last_of(".proto") == file->name().size() - 1) { - *file_name_or_error = - file->name().substr(0, file->name().size() - proto_suffix_length) + - "_services_pb.rb"; - return true; - } else { - *file_name_or_error = "Invalid proto file name: must end with .proto"; - return false; - } -} - -inline TString MessagesRequireName( - const grpc::protobuf::FileDescriptor* file) { - return Replace(file->name(), ".proto", "_pb"); -} - -// Get leading or trailing comments in a string. Comment lines start with "# ". -// Leading detached comments are put in front of leading comments. -template <typename DescriptorType> -inline TString GetRubyComments(const DescriptorType* desc, bool leading) { - return grpc_generator::GetPrefixedComments(desc, leading, "#"); -} - -} // namespace grpc_ruby_generator - -#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H diff --git a/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h b/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h deleted file mode 100644 index 1221a5a705..0000000000 --- a/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H -#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H - -#include <initializer_list> -#include <iostream> -#include <map> -#include <ostream> // NOLINT -#include <vector> - -#include "src/compiler/config.h" - -using std::initializer_list; -using std::map; -using std::vector; - -namespace grpc_ruby_generator { - -// Converts an initializer list of the form { key0, value0, key1, value1, ... } -// into a map of key* to value*. Is merely a readability helper for later code. -inline std::map<TString, TString> ListToDict( - const initializer_list<TString>& values) { - if (values.size() % 2 != 0) { - std::cerr << "Not every 'key' has a value in `values`." << std::endl; - } - std::map<TString, TString> value_map; - auto value_iter = values.begin(); - for (unsigned i = 0; i < values.size() / 2; ++i) { - TString key = *value_iter; - ++value_iter; - TString value = *value_iter; - value_map[key] = value; - ++value_iter; - } - return value_map; -} - -} // namespace grpc_ruby_generator - -#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H diff --git a/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h b/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h deleted file mode 100644 index 0df783023e..0000000000 --- a/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H -#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H - -#include <algorithm> -#include <sstream> -#include <vector> - -#include "src/compiler/config.h" - -using std::getline; -using std::transform; - -namespace grpc_ruby_generator { - -// Split splits a string using char into elems. -inline std::vector<TString>& Split(const TString& s, char delim, - std::vector<TString>* elems) { - std::stringstream ss(s); - TString item; - while (getline(ss, item, delim)) { - elems->push_back(item); - } - return *elems; -} - -// Split splits a string using char, returning the result in a vector. -inline std::vector<TString> Split(const TString& s, char delim) { - std::vector<TString> elems; - Split(s, delim, &elems); - return elems; -} - -// Replace replaces from with to in s. -inline TString Replace(TString s, const TString& from, - const TString& to) { - size_t start_pos = s.find(from); - if (start_pos == TString::npos) { - return s; - } - s.replace(start_pos, from.length(), to); - return s; -} - -// ReplaceAll replaces all instances of search with replace in s. -inline TString ReplaceAll(TString s, const TString& search, - const TString& replace) { - size_t pos = 0; - while ((pos = s.find(search, pos)) != TString::npos) { - s.replace(pos, search.length(), replace); - pos += replace.length(); - } - return s; -} - -// ReplacePrefix replaces from with to in s if search is a prefix of s. -inline bool ReplacePrefix(TString* s, const TString& from, - const TString& to) { - size_t start_pos = s->find(from); - if (start_pos == TString::npos || start_pos != 0) { - return false; - } - s->replace(start_pos, from.length(), to); - return true; -} - -// Modularize converts a string into a ruby module compatible name -inline TString Modularize(TString s) { - if (s.empty()) { - return s; - } - TString new_string = ""; - bool was_last_underscore = false; - new_string.append(1, ::toupper(s[0])); - for (TString::size_type i = 1; i < s.size(); ++i) { - if (was_last_underscore && s[i] != '_') { - new_string.append(1, ::toupper(s[i])); - } else if (s[i] != '_') { - new_string.append(1, s[i]); - } - was_last_underscore = s[i] == '_'; - } - return new_string; -} - -// RubyPackage gets the ruby package in either proto or ruby_package format -inline TString RubyPackage(const grpc::protobuf::FileDescriptor* file) { - TString package_name = file->package(); - if (file->options().has_ruby_package()) { - package_name = file->options().ruby_package(); - - // If :: is in the package convert the Ruby formatted name - // -> A::B::C - // to use the dot seperator notation - // -> A.B.C - package_name = ReplaceAll(package_name, "::", "."); - } - return package_name; -} - -// RubyTypeOf updates a proto type to the required ruby equivalent. -inline TString RubyTypeOf(const grpc::protobuf::Descriptor* descriptor) { - TString proto_type = descriptor->full_name(); - if (descriptor->file()->options().has_ruby_package()) { - // remove the leading package if present - ReplacePrefix(&proto_type, descriptor->file()->package(), ""); - ReplacePrefix(&proto_type, ".", ""); // remove the leading . (no package) - proto_type = RubyPackage(descriptor->file()) + "." + proto_type; - } - TString res("." + proto_type); - if (res.find('.') == TString::npos) { - return res; - } else { - std::vector<TString> prefixes_and_type = Split(res, '.'); - res.clear(); - for (unsigned int i = 0; i < prefixes_and_type.size(); ++i) { - if (i != 0) { - res += "::"; // switch '.' to the ruby module delim - } - if (i < prefixes_and_type.size() - 1) { - res += Modularize(prefixes_and_type[i]); // capitalize pkgs - } else { - res += prefixes_and_type[i]; - } - } - return res; - } -} - -} // namespace grpc_ruby_generator - -#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H diff --git a/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt deleted file mode 100644 index 6e637b3aa5..0000000000 --- a/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,66 +0,0 @@ -====================Apache-2.0==================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - - -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== - * Copyright 2015 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2015-2016 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2016 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2017 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2018 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2019 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2020 gRPC authors. - - -====================COPYRIGHT==================== -// Copyright 2021 The gRPC Authors - - -====================COPYRIGHT==================== -// Copyright 2021 gRPC authors. - - -====================COPYRIGHT==================== -// Copyright 2021 the gRPC authors. diff --git a/contrib/libs/grpc/src/core/lib/debug/stats_data_bq_schema.sql b/contrib/libs/grpc/src/core/lib/debug/stats_data_bq_schema.sql deleted file mode 100644 index 7d1ab1dae9..0000000000 --- a/contrib/libs/grpc/src/core/lib/debug/stats_data_bq_schema.sql +++ /dev/null @@ -1,98 +0,0 @@ -client_calls_created_per_iteration:FLOAT, -server_calls_created_per_iteration:FLOAT, -cqs_created_per_iteration:FLOAT, -client_channels_created_per_iteration:FLOAT, -client_subchannels_created_per_iteration:FLOAT, -server_channels_created_per_iteration:FLOAT, -syscall_poll_per_iteration:FLOAT, -syscall_wait_per_iteration:FLOAT, -pollset_kick_per_iteration:FLOAT, -pollset_kicked_without_poller_per_iteration:FLOAT, -pollset_kicked_again_per_iteration:FLOAT, -pollset_kick_wakeup_fd_per_iteration:FLOAT, -pollset_kick_wakeup_cv_per_iteration:FLOAT, -pollset_kick_own_thread_per_iteration:FLOAT, -syscall_epoll_ctl_per_iteration:FLOAT, -pollset_fd_cache_hits_per_iteration:FLOAT, -histogram_slow_lookups_per_iteration:FLOAT, -syscall_write_per_iteration:FLOAT, -syscall_read_per_iteration:FLOAT, -tcp_backup_pollers_created_per_iteration:FLOAT, -tcp_backup_poller_polls_per_iteration:FLOAT, -http2_op_batches_per_iteration:FLOAT, -http2_op_cancel_per_iteration:FLOAT, -http2_op_send_initial_metadata_per_iteration:FLOAT, -http2_op_send_message_per_iteration:FLOAT, -http2_op_send_trailing_metadata_per_iteration:FLOAT, -http2_op_recv_initial_metadata_per_iteration:FLOAT, -http2_op_recv_message_per_iteration:FLOAT, -http2_op_recv_trailing_metadata_per_iteration:FLOAT, -http2_settings_writes_per_iteration:FLOAT, -http2_pings_sent_per_iteration:FLOAT, -http2_writes_begun_per_iteration:FLOAT, -http2_writes_offloaded_per_iteration:FLOAT, -http2_writes_continued_per_iteration:FLOAT, -http2_partial_writes_per_iteration:FLOAT, -http2_initiate_write_due_to_initial_write_per_iteration:FLOAT, -http2_initiate_write_due_to_start_new_stream_per_iteration:FLOAT, -http2_initiate_write_due_to_send_message_per_iteration:FLOAT, -http2_initiate_write_due_to_send_initial_metadata_per_iteration:FLOAT, -http2_initiate_write_due_to_send_trailing_metadata_per_iteration:FLOAT, -http2_initiate_write_due_to_retry_send_ping_per_iteration:FLOAT, -http2_initiate_write_due_to_continue_pings_per_iteration:FLOAT, -http2_initiate_write_due_to_goaway_sent_per_iteration:FLOAT, -http2_initiate_write_due_to_rst_stream_per_iteration:FLOAT, -http2_initiate_write_due_to_close_from_api_per_iteration:FLOAT, -http2_initiate_write_due_to_stream_flow_control_per_iteration:FLOAT, -http2_initiate_write_due_to_transport_flow_control_per_iteration:FLOAT, -http2_initiate_write_due_to_send_settings_per_iteration:FLOAT, -http2_initiate_write_due_to_bdp_estimator_ping_per_iteration:FLOAT, -http2_initiate_write_due_to_flow_control_unstalled_by_setting_per_iteration:FLOAT, -http2_initiate_write_due_to_flow_control_unstalled_by_update_per_iteration:FLOAT, -http2_initiate_write_due_to_application_ping_per_iteration:FLOAT, -http2_initiate_write_due_to_keepalive_ping_per_iteration:FLOAT, -http2_initiate_write_due_to_transport_flow_control_unstalled_per_iteration:FLOAT, -http2_initiate_write_due_to_ping_response_per_iteration:FLOAT, -http2_initiate_write_due_to_force_rst_stream_per_iteration:FLOAT, -http2_spurious_writes_begun_per_iteration:FLOAT, -hpack_recv_indexed_per_iteration:FLOAT, -hpack_recv_lithdr_incidx_per_iteration:FLOAT, -hpack_recv_lithdr_incidx_v_per_iteration:FLOAT, -hpack_recv_lithdr_notidx_per_iteration:FLOAT, -hpack_recv_lithdr_notidx_v_per_iteration:FLOAT, -hpack_recv_lithdr_nvridx_per_iteration:FLOAT, -hpack_recv_lithdr_nvridx_v_per_iteration:FLOAT, -hpack_recv_uncompressed_per_iteration:FLOAT, -hpack_recv_huffman_per_iteration:FLOAT, -hpack_recv_binary_per_iteration:FLOAT, -hpack_recv_binary_base64_per_iteration:FLOAT, -hpack_send_indexed_per_iteration:FLOAT, -hpack_send_lithdr_incidx_per_iteration:FLOAT, -hpack_send_lithdr_incidx_v_per_iteration:FLOAT, -hpack_send_lithdr_notidx_per_iteration:FLOAT, -hpack_send_lithdr_notidx_v_per_iteration:FLOAT, -hpack_send_lithdr_nvridx_per_iteration:FLOAT, -hpack_send_lithdr_nvridx_v_per_iteration:FLOAT, -hpack_send_uncompressed_per_iteration:FLOAT, -hpack_send_huffman_per_iteration:FLOAT, -hpack_send_binary_per_iteration:FLOAT, -hpack_send_binary_base64_per_iteration:FLOAT, -combiner_locks_initiated_per_iteration:FLOAT, -combiner_locks_scheduled_items_per_iteration:FLOAT, -combiner_locks_scheduled_final_items_per_iteration:FLOAT, -combiner_locks_offloaded_per_iteration:FLOAT, -call_combiner_locks_initiated_per_iteration:FLOAT, -call_combiner_locks_scheduled_items_per_iteration:FLOAT, -call_combiner_set_notify_on_cancel_per_iteration:FLOAT, -call_combiner_cancelled_per_iteration:FLOAT, -executor_scheduled_short_items_per_iteration:FLOAT, -executor_scheduled_long_items_per_iteration:FLOAT, -executor_scheduled_to_self_per_iteration:FLOAT, -executor_wakeup_initiated_per_iteration:FLOAT, -executor_queue_drained_per_iteration:FLOAT, -executor_push_retries_per_iteration:FLOAT, -server_requested_calls_per_iteration:FLOAT, -server_slowpath_requests_queued_per_iteration:FLOAT, -cq_ev_queue_trylock_failures_per_iteration:FLOAT, -cq_ev_queue_trylock_successes_per_iteration:FLOAT, -cq_ev_queue_transient_pop_failures_per_iteration:FLOAT diff --git a/contrib/libs/grpc/src/core/lib/gprpp/capture.h b/contrib/libs/grpc/src/core/lib/gprpp/capture.h deleted file mode 100644 index 07949fd1c9..0000000000 --- a/contrib/libs/grpc/src/core/lib/gprpp/capture.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_GPRPP_CAPTURE_H -#define GRPC_CORE_LIB_GPRPP_CAPTURE_H - -#include <grpc/support/port_platform.h> - -#include <tuple> -#include <utility> - -#include "y_absl/utility/utility.h" - -namespace grpc_core { - -namespace detail { - -template <typename F, typename... Captures> -class Capture { - public: - explicit Capture(F f, Captures... captures) - : f_(std::move(f)), captures_(std::move(captures)...) {} - - template <typename... Args> - decltype(std::declval<F>()(static_cast<Captures*>(nullptr)..., - std::declval<Args>()...)) - operator()(Args... args) { - auto f = &f_; - return y_absl::apply( - [f, &args...](Captures&... captures) { - return (*f)(&captures..., std::move(args)...); - }, - captures_); - } - - private: - GPR_NO_UNIQUE_ADDRESS F f_; - GPR_NO_UNIQUE_ADDRESS std::tuple<Captures...> captures_; -}; - -} // namespace detail - -// C++11 helper - best explained by usage: -// -// BigThing big_thing; -// auto f = Capture( -// [](BigThing* c, int a, int b) { /*...*/ }, -// std::move(big_thing)); -// -// results in: f being a callable that takes arguments (int a, int b), and -// captures the original value of big_thing by move. Each call, a pointer to -// each captured thing is inserted into the argument list at the beginning so it -// can be manipulated. -// -// Captured values are mutable, and it's the users responsibility to ensure, -// should this callable be invoked from different threads, that proper locking -// is implemented. -template <typename F, typename... Captures> -detail::Capture<F, Captures...> Capture(F f, Captures... captures) { - return detail::Capture<F, Captures...>(std::move(f), std::move(captures)...); -} - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_GPRPP_CAPTURE_H diff --git a/contrib/libs/grpc/src/core/lib/gprpp/match.h b/contrib/libs/grpc/src/core/lib/gprpp/match.h deleted file mode 100644 index 39892fe473..0000000000 --- a/contrib/libs/grpc/src/core/lib/gprpp/match.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_GPRPP_MATCH_H -#define GRPC_CORE_LIB_GPRPP_MATCH_H - -#include <grpc/support/port_platform.h> - -#include "y_absl/types/variant.h" - -#include "src/core/lib/gprpp/overload.h" - -namespace grpc_core { - -namespace detail { - -template <typename... Cases> -struct MatchPointerExtractor { - OverloadType<Cases...> cases; - template <typename T> - auto operator()(T& value) -> decltype(cases(&value)) { - return cases(&value); - } -}; - -} // namespace detail - -/// Match on a variant. -/// Given variant \a value, and a set of callables \a fs, call the appropriate -/// callable based on the type contained in \a value. -/// -/// Example (prints "hoorah"): -/// variant<int, string> v = 42; -/// Match(v, -/// [](int i) { puts("hoorah"); }, -/// [](string s) { puts("boo"); }); -template <typename... Fs, typename T0, typename... Ts> -auto Match(const y_absl::variant<T0, Ts...>& value, Fs... fs) - -> decltype(std::declval<OverloadType<Fs...>>()(std::declval<T0>())) { - return y_absl::visit(Overload(std::move(fs)...), value); -} - -/// A version of Match that takes a mutable pointer to a variant and calls its -/// overload callables with a mutable pointer to the current variant value. -/// -/// Example: -/// variant<int, string> v = 42; -/// MatchMutable(&v, -/// [](int* i) { *i = 1; }, -/// [](string* s) { *s = "foo"; }); -/// // v now contains 1. -template <typename... Fs, typename T0, typename... Ts> -auto MatchMutable(y_absl::variant<T0, Ts...>* value, Fs... fs) - -> decltype(std::declval<OverloadType<Fs...>>()(std::declval<T0*>())) { - return y_absl::visit(detail::MatchPointerExtractor<Fs...>{OverloadType<Fs...>( - std::move(fs)...)}, - *value); -} - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_GPRPP_MATCH_H diff --git a/contrib/libs/grpc/src/core/lib/gprpp/overload.h b/contrib/libs/grpc/src/core/lib/gprpp/overload.h deleted file mode 100644 index c243a8c010..0000000000 --- a/contrib/libs/grpc/src/core/lib/gprpp/overload.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_GPRPP_OVERLOAD_H -#define GRPC_CORE_LIB_GPRPP_OVERLOAD_H - -#include <grpc/support/port_platform.h> - -#include <utility> - -namespace grpc_core { - -template <typename... Cases> -struct OverloadType; -// Compose one overload with N more -- use inheritance to leverage using and the -// empty base class optimization. -template <typename Case, typename... Cases> -struct OverloadType<Case, Cases...> : public Case, - public OverloadType<Cases...> { - explicit OverloadType(Case&& c, Cases&&... cases) - : Case(std::forward<Case>(c)), - OverloadType<Cases...>(std::forward<Cases>(cases)...) {} - using Case::operator(); - using OverloadType<Cases...>::operator(); -}; -// Overload of a single case is just that case itself -template <typename Case> -struct OverloadType<Case> : public Case { - explicit OverloadType(Case&& c) : Case(std::forward<Case>(c)) {} - using Case::operator(); -}; - -/// Compose callables into a single callable. -/// e.g. given [](int i) { puts("a"); } and [](double d) { puts("b"); }, -/// return a callable object like: -/// struct { -/// void operator()(int i) { puts("a"); } -/// void operator()(double i) { puts("b"); } -/// }; -/// Preserves all captures. -template <typename... Cases> -OverloadType<Cases...> Overload(Cases... cases) { - return OverloadType<Cases...>(std::move(cases)...); -} - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_GPRPP_OVERLOAD_H diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.h b/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.h deleted file mode 100644 index 2ac002b6f3..0000000000 --- a/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright 2016 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_TIMER_GENERIC_H -#define GRPC_CORE_LIB_IOMGR_TIMER_GENERIC_H - -#include <grpc/support/port_platform.h> - -#include <grpc/support/time.h> - -#include "src/core/lib/iomgr/exec_ctx.h" - -struct grpc_timer { - gpr_atm deadline; - uint32_t heap_index; /* INVALID_HEAP_INDEX if not in heap */ - bool pending; - struct grpc_timer* next; - struct grpc_timer* prev; - grpc_closure* closure; -#ifndef NDEBUG - struct grpc_timer* hash_table_next; -#endif -}; - -#endif /* GRPC_CORE_LIB_IOMGR_TIMER_GENERIC_H */ diff --git a/contrib/libs/grpc/src/core/lib/profiling/stap_probes.d b/contrib/libs/grpc/src/core/lib/profiling/stap_probes.d deleted file mode 100644 index 153de91752..0000000000 --- a/contrib/libs/grpc/src/core/lib/profiling/stap_probes.d +++ /dev/null @@ -1,7 +0,0 @@ -provider _stap { - probe add_mark(int tag); - probe add_important_mark(int tag); - probe timing_ns_begin(int tag); - probe timing_ns_end(int tag); -}; - diff --git a/contrib/libs/grpc/src/core/lib/promise/arena_promise.h b/contrib/libs/grpc/src/core/lib/promise/arena_promise.h deleted file mode 100644 index ef0fff11e3..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/arena_promise.h +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H -#define GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H - -#include <grpc/support/port_platform.h> - -#include <grpc/support/log.h> - -#include "src/core/lib/gprpp/arena.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -namespace arena_promise_detail { - -// Type erased promise stored in the arena. -template <typename T> -class ImplInterface { - public: - // Poll the promise, once. - virtual Poll<T> PollOnce() = 0; - // Destroy the underlying callable object if there is one. - // Since we don't delete (the arena owns the memory) but we may need to call a - // destructor, we expose this for when the ArenaPromise object is destroyed. - virtual void Destroy() = 0; - - protected: - ~ImplInterface() = default; -}; - -// Implementation of ImplInterface for an empty object. -// Used when an empty ArenaPromise is created, or when the ArenaPromise is moved -// from. Since in either case these objects should not be polled, we simply -// crash if it is. -template <typename T> -class NullImpl final : public ImplInterface<T> { - public: - Poll<T> PollOnce() override { - abort(); - GPR_UNREACHABLE_CODE(return Pending{}); - } - void Destroy() override {} - - static ImplInterface<T>* Get() { - static NullImpl<T> instance; - return &instance; - } - - private: - ~NullImpl() = default; -}; - -// Implementation of ImplInterface for a callable object. -template <typename T, typename Callable> -class CallableImpl final : public ImplInterface<T> { - public: - explicit CallableImpl(Callable&& callable) : callable_(std::move(callable)) {} - // Forward polls to the callable object. - Poll<T> PollOnce() override { return callable_(); } - // Destroy destructs the callable object. - void Destroy() override { this->~CallableImpl(); } - - private: - // Should only be called by Destroy(). - ~CallableImpl() = default; - - Callable callable_; -}; - -// If a callable object is empty we can substitute any instance of that callable -// for the one we call (for how could we tell the difference)? -// Since this corresponds to a lambda with no fields, and we expect these to be -// reasonably common, we can elide the arena allocation entirely and simply poll -// a global shared instance. -// (this comes up often when the promise only accesses context data from the -// containing activity). -template <typename T, typename Callable> -class SharedImpl final : public ImplInterface<T>, private Callable { - public: - // Call the callable, or at least an exact duplicate of it - if you have no - // members, all your instances look the same. - Poll<T> PollOnce() override { return Callable::operator()(); } - // Nothing to destroy. - void Destroy() override {} - // Return a pointer to the shared instance - these are singletons, and are - // needed just to get the vtable in place. - static SharedImpl* Get(Callable&& callable) { - static_assert(sizeof(SharedImpl) == sizeof(void*), - "SharedImpl should be pointer sized"); - static SharedImpl impl(std::forward<Callable>(callable)); - return &impl; - } - - private: - explicit SharedImpl(Callable&& callable) - : Callable(std::forward<Callable>(callable)) {} - ~SharedImpl() = default; -}; - -// Redirector type: given a callable type, expose a Make() function that creates -// the appropriate underlying implementation. -template <typename T, typename Callable, typename Ignored = void> -struct ChooseImplForCallable; - -template <typename T, typename Callable> -struct ChooseImplForCallable< - T, Callable, y_absl::enable_if_t<!std::is_empty<Callable>::value>> { - static ImplInterface<T>* Make(Arena* arena, Callable&& callable) { - return arena->template New<CallableImpl<T, Callable>>( - std::forward<Callable>(callable)); - } -}; - -template <typename T, typename Callable> -struct ChooseImplForCallable< - T, Callable, y_absl::enable_if_t<std::is_empty<Callable>::value>> { - static ImplInterface<T>* Make(Arena*, Callable&& callable) { - return SharedImpl<T, Callable>::Get(std::forward<Callable>(callable)); - } -}; - -// Wrap ChooseImplForCallable with a friend approachable syntax. -template <typename T, typename Callable> -ImplInterface<T>* MakeImplForCallable(Arena* arena, Callable&& callable) { - return ChooseImplForCallable<T, Callable>::Make( - arena, std::forward<Callable>(callable)); -} - -} // namespace arena_promise_detail - -// A promise for which the state memory is allocated from an arena. -template <typename T> -class ArenaPromise { - public: - // Construct an empty, uncallable, invalid ArenaPromise. - ArenaPromise() = default; - - // Construct an ArenaPromise that will call the given callable when polled. - template <typename Callable> - ArenaPromise(Arena* arena, Callable&& callable) - : impl_(arena_promise_detail::MakeImplForCallable<T>( - arena, std::forward<Callable>(callable))) {} - - // ArenaPromise is not copyable. - ArenaPromise(const ArenaPromise&) = delete; - ArenaPromise& operator=(const ArenaPromise&) = delete; - // ArenaPromise is movable. - ArenaPromise(ArenaPromise&& other) noexcept : impl_(other.impl_) { - other.impl_ = arena_promise_detail::NullImpl<T>::Get(); - } - ArenaPromise& operator=(ArenaPromise&& other) noexcept { - impl_ = other.impl_; - other.impl_ = arena_promise_detail::NullImpl<T>::Get(); - return *this; - } - - // Destruction => call Destroy on the underlying impl object. - ~ArenaPromise() { impl_->Destroy(); } - - // Expose the promise interface: a call operator that returns Poll<T>. - Poll<T> operator()() { return impl_->PollOnce(); } - - private: - // Underlying impl object. - arena_promise_detail::ImplInterface<T>* impl_ = - arena_promise_detail::NullImpl<T>::Get(); -}; - -} // namespace grpc_core - -#endif /* GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H */ diff --git a/contrib/libs/grpc/src/core/lib/promise/detail/basic_join.h b/contrib/libs/grpc/src/core/lib/promise/detail/basic_join.h deleted file mode 100644 index 799109faf0..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/detail/basic_join.h +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_JOIN_H -#define GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_JOIN_H - -#include <grpc/support/port_platform.h> - -#include <assert.h> -#include <stddef.h> - -#include <array> -#include <tuple> -#include <type_traits> -#include <utility> - -#include "y_absl/types/variant.h" -#include "y_absl/utility/utility.h" - -#include "src/core/lib/gprpp/bitset.h" -#include "src/core/lib/gprpp/construct_destruct.h" -#include "src/core/lib/promise/detail/promise_factory.h" -#include "src/core/lib/promise/detail/promise_like.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { -namespace promise_detail { - -// This union can either be a functor, or the result of the functor (after -// mapping via a trait). Allows us to remember the result of one joined functor -// until the rest are ready. -template <typename Traits, typename F> -union Fused { - explicit Fused(F&& f) : f(std::forward<F>(f)) {} - explicit Fused(PromiseLike<F>&& f) : f(std::forward<PromiseLike<F>>(f)) {} - ~Fused() {} - // Wrap the functor in a PromiseLike to handle immediately returning functors - // and the like. - using Promise = PromiseLike<F>; - GPR_NO_UNIQUE_ADDRESS Promise f; - // Compute the result type: We take the result of the promise, and pass it via - // our traits, so that, for example, TryJoin and take a StatusOr<T> and just - // store a T. - using Result = typename Traits::template ResultType<typename Promise::Result>; - GPR_NO_UNIQUE_ADDRESS Result result; -}; - -// A join gets composed of joints... these are just wrappers around a Fused for -// their data, with some machinery as methods to get the system working. -template <typename Traits, size_t kRemaining, typename... Fs> -struct Joint : public Joint<Traits, kRemaining - 1, Fs...> { - // The index into Fs for this Joint - static constexpr size_t kIdx = sizeof...(Fs) - kRemaining; - // The next join (the one we derive from) - using NextJoint = Joint<Traits, kRemaining - 1, Fs...>; - // From Fs, extract the functor for this joint. - using F = typename std::tuple_element<kIdx, std::tuple<Fs...>>::type; - // Generate the Fused type for this functor. - using Fsd = Fused<Traits, F>; - GPR_NO_UNIQUE_ADDRESS Fsd fused; - // Figure out what kind of bitmask will be used by the outer join. - using Bits = BitSet<sizeof...(Fs)>; - // Initialize from a tuple of pointers to Fs - explicit Joint(std::tuple<Fs*...> fs) - : NextJoint(fs), fused(std::move(*std::get<kIdx>(fs))) {} - // Copy: assume that the Fuse is still in the promise state (since it's not - // legal to copy after the first poll!) - Joint(const Joint& j) : NextJoint(j), fused(j.fused.f) {} - // Move: assume that the Fuse is still in the promise state (since it's not - // legal to move after the first poll!) - Joint(Joint&& j) noexcept - : NextJoint(std::forward<NextJoint>(j)), fused(std::move(j.fused.f)) {} - // Destruct: check bits to see if we're in promise or result state, and call - // the appropriate destructor. Recursively, call up through the join. - void DestructAll(const Bits& bits) { - if (!bits.is_set(kIdx)) { - Destruct(&fused.f); - } else { - Destruct(&fused.result); - } - NextJoint::DestructAll(bits); - } - // Poll all joints up, and then call finally. - template <typename F> - auto Run(Bits* bits, F finally) -> decltype(finally()) { - // If we're still in the promise state... - if (!bits->is_set(kIdx)) { - // Poll the promise - auto r = fused.f(); - if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) { - // If it's done, then ask the trait to unwrap it and store that result - // in the Fused, and continue the iteration. Note that OnResult could - // instead choose to return a value instead of recursing through the - // iteration, in that case we continue returning the same result up. - // Here is where TryJoin can escape out. - return Traits::OnResult( - std::move(*p), [this, bits, &finally](typename Fsd::Result result) { - bits->set(kIdx); - Destruct(&fused.f); - Construct(&fused.result, std::move(result)); - return NextJoint::Run(bits, std::move(finally)); - }); - } - } - // That joint is still pending... we'll still poll the result of the joints. - return NextJoint::Run(bits, std::move(finally)); - } -}; - -// Terminating joint... for each of the recursions, do the thing we're supposed -// to do at the end. -template <typename Traits, typename... Fs> -struct Joint<Traits, 0, Fs...> { - explicit Joint(std::tuple<Fs*...>) {} - Joint(const Joint&) {} - Joint(Joint&&) noexcept {} - template <typename T> - void DestructAll(const T&) {} - template <typename F> - auto Run(BitSet<sizeof...(Fs)>*, F finally) -> decltype(finally()) { - return finally(); - } -}; - -template <typename Traits, typename... Fs> -class BasicJoin { - private: - // How many things are we joining? - static constexpr size_t N = sizeof...(Fs); - // Bitset: if a bit is 0, that joint is still in promise state. If it's 1, - // then the joint has a result. - GPR_NO_UNIQUE_ADDRESS BitSet<N> state_; - // The actual joints, wrapped in an anonymous union to give us control of - // construction/destruction. - union { - GPR_NO_UNIQUE_ADDRESS Joint<Traits, sizeof...(Fs), Fs...> joints_; - }; - - // Access joint index I - template <size_t I> - Joint<Traits, sizeof...(Fs) - I, Fs...>* GetJoint() { - return static_cast<Joint<Traits, sizeof...(Fs) - I, Fs...>*>(&joints_); - } - - // The tuple of results of all our promises - using Tuple = std::tuple<typename Fused<Traits, Fs>::Result...>; - - // Collect up all the results and construct a tuple. - template <size_t... I> - Tuple Finish(y_absl::index_sequence<I...>) { - return Tuple(std::move(GetJoint<I>()->fused.result)...); - } - - public: - explicit BasicJoin(Fs&&... fs) : joints_(std::tuple<Fs*...>(&fs...)) {} - BasicJoin& operator=(const BasicJoin&) = delete; - // Copy a join - only available before polling. - BasicJoin(const BasicJoin& other) { - assert(other.state_.none()); - Construct(&joints_, other.joints_); - } - // Move a join - only available before polling. - BasicJoin(BasicJoin&& other) noexcept { - assert(other.state_.none()); - Construct(&joints_, std::move(other.joints_)); - } - ~BasicJoin() { joints_.DestructAll(state_); } - using Result = decltype(Traits::Wrap(std::declval<Tuple>())); - // Poll the join - Poll<Result> operator()() { - // Poll the joints... - return joints_.Run(&state_, [this]() -> Poll<Result> { - // If all of them are completed, collect the results, and then ask our - // traits to wrap them - allowing for example TryJoin to turn tuple<A,B,C> - // into StatusOr<tuple<A,B,C>>. - if (state_.all()) { - return Traits::Wrap(Finish(y_absl::make_index_sequence<N>())); - } else { - return Pending(); - } - }); - } -}; - -} // namespace promise_detail -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_JOIN_H diff --git a/contrib/libs/grpc/src/core/lib/promise/for_each.h b/contrib/libs/grpc/src/core/lib/promise/for_each.h deleted file mode 100644 index b09f5e8493..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/for_each.h +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_FOR_EACH_H -#define GRPC_CORE_LIB_PROMISE_FOR_EACH_H - -#include <grpc/support/port_platform.h> - -#include <type_traits> -#include <utility> - -#include "y_absl/status/status.h" -#include "y_absl/types/variant.h" - -#include "src/core/lib/promise/detail/promise_factory.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -namespace for_each_detail { - -// Helper function: at the end of each iteration of a for-each loop, this is -// called. If the iteration failed, return failure. If the iteration succeeded, -// then call the next iteration. -template <typename Reader, typename CallPoll> -Poll<y_absl::Status> FinishIteration(y_absl::Status* r, Reader* reader, - CallPoll call_poll) { - if (r->ok()) { - auto next = reader->Next(); - return call_poll(next); - } - return std::move(*r); -} - -// Done creates statuses for the end of the iteration. It's templated on the -// type of the result of the ForEach loop, so that we can introduce new types -// easily. -template <typename T> -struct Done; - -template <> -struct Done<y_absl::Status> { - static y_absl::Status Make() { return y_absl::OkStatus(); } -}; - -template <typename Reader, typename Action> -class ForEach { - private: - using ReaderNext = decltype(std::declval<Reader>().Next()); - using ReaderResult = typename PollTraits<decltype( - std::declval<ReaderNext>()())>::Type::value_type; - using ActionFactory = promise_detail::PromiseFactory<ReaderResult, Action>; - using ActionPromise = typename ActionFactory::Promise; - - public: - using Result = - typename PollTraits<decltype(std::declval<ActionPromise>()())>::Type; - ForEach(Reader reader, Action action) - : reader_(std::move(reader)), - action_factory_(std::move(action)), - state_(reader_.Next()) {} - - ForEach(const ForEach&) = delete; - ForEach& operator=(const ForEach&) = delete; - // noexcept causes compiler errors on older gcc's - // NOLINTNEXTLINE(performance-noexcept-move-constructor) - ForEach(ForEach&&) = default; - // noexcept causes compiler errors on older gcc's - // NOLINTNEXTLINE(performance-noexcept-move-constructor) - ForEach& operator=(ForEach&&) = default; - - Poll<Result> operator()() { - return y_absl::visit(CallPoll<false>{this}, state_); - } - - private: - Reader reader_; - ActionFactory action_factory_; - y_absl::variant<ReaderNext, ActionPromise> state_; - - // Call the inner poll function, and if it's finished, start the next - // iteration. If kSetState==true, also set the current state in self->state_. - // We omit that on the first iteration because it's common to poll once and - // not change state, which saves us some work. - template <bool kSetState> - struct CallPoll { - ForEach* const self; - - Poll<Result> operator()(ReaderNext& reader_next) { - auto r = reader_next(); - if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) { - if (p->has_value()) { - auto action = self->action_factory_.Repeated(std::move(**p)); - return CallPoll<true>{self}(action); - } else { - return Done<Result>::Make(); - } - } - if (kSetState) { - self->state_.template emplace<ReaderNext>(std::move(reader_next)); - } - return Pending(); - } - - Poll<Result> operator()(ActionPromise& promise) { - auto r = promise(); - if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) { - return FinishIteration(p, &self->reader_, CallPoll<true>{self}); - } - if (kSetState) { - self->state_.template emplace<ActionPromise>(std::move(promise)); - } - return Pending(); - } - }; -}; - -} // namespace for_each_detail - -/// For each item acquired by calling Reader::Next, run the promise Action. -template <typename Reader, typename Action> -for_each_detail::ForEach<Reader, Action> ForEach(Reader reader, Action action) { - return for_each_detail::ForEach<Reader, Action>(std::move(reader), - std::move(action)); -} - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_FOR_EACH_H diff --git a/contrib/libs/grpc/src/core/lib/promise/if.h b/contrib/libs/grpc/src/core/lib/promise/if.h deleted file mode 100644 index 475f1c60e9..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/if.h +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_IF_H -#define GRPC_CORE_LIB_PROMISE_IF_H - -#include <grpc/support/port_platform.h> - -#include <type_traits> - -#include "y_absl/status/statusor.h" -#include "y_absl/types/variant.h" - -#include "src/core/lib/promise/detail/promise_factory.h" -#include "src/core/lib/promise/detail/promise_like.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -namespace promise_detail { - -template <typename CallPoll, typename T, typename F> -typename CallPoll::PollResult ChooseIf(CallPoll call_poll, bool result, - T* if_true, F* if_false) { - if (result) { - auto promise = if_true->Once(); - return call_poll(promise); - } else { - auto promise = if_false->Once(); - return call_poll(promise); - } -} - -template <typename CallPoll, typename T, typename F> -typename CallPoll::PollResult ChooseIf(CallPoll call_poll, - y_absl::StatusOr<bool> result, T* if_true, - F* if_false) { - if (!result.ok()) { - return typename CallPoll::PollResult(result.status()); - } else if (*result) { - auto promise = if_true->Once(); - return call_poll(promise); - } else { - auto promise = if_false->Once(); - return call_poll(promise); - } -} - -template <typename C, typename T, typename F> -class If { - private: - using TrueFactory = promise_detail::PromiseFactory<void, T>; - using FalseFactory = promise_detail::PromiseFactory<void, F>; - using ConditionPromise = PromiseLike<C>; - using TruePromise = typename TrueFactory::Promise; - using FalsePromise = typename FalseFactory::Promise; - using Result = - typename PollTraits<decltype(std::declval<TruePromise>()())>::Type; - - public: - If(C condition, T if_true, F if_false) - : state_(Evaluating{ConditionPromise(std::move(condition)), - TrueFactory(std::move(if_true)), - FalseFactory(std::move(if_false))}) {} - - Poll<Result> operator()() { - return y_absl::visit(CallPoll<false>{this}, state_); - } - - private: - struct Evaluating { - ConditionPromise condition; - TrueFactory if_true; - FalseFactory if_false; - }; - using State = y_absl::variant<Evaluating, TruePromise, FalsePromise>; - State state_; - - template <bool kSetState> - struct CallPoll { - using PollResult = Poll<Result>; - - If* const self; - - PollResult operator()(Evaluating& evaluating) const { - static_assert( - !kSetState, - "shouldn't need to set state coming through the initial branch"); - auto r = evaluating.condition(); - if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) { - return ChooseIf(CallPoll<true>{self}, std::move(*p), - &evaluating.if_true, &evaluating.if_false); - } - return Pending(); - } - - template <class Promise> - PollResult operator()(Promise& promise) const { - auto r = promise(); - if (kSetState && y_absl::holds_alternative<Pending>(r)) { - self->state_.template emplace<Promise>(std::move(promise)); - } - return r; - } - }; -}; - -} // namespace promise_detail - -// If promise combinator. -// Takes 3 promise factories, and evaluates the first. -// If it returns failure, returns failure for the entire combinator. -// If it returns true, evaluates the second promise. -// If it returns false, evaluates the third promise. -template <typename C, typename T, typename F> -promise_detail::If<C, T, F> If(C condition, T if_true, F if_false) { - return promise_detail::If<C, T, F>(std::move(condition), std::move(if_true), - std::move(if_false)); -} - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_IF_H diff --git a/contrib/libs/grpc/src/core/lib/promise/intra_activity_waiter.h b/contrib/libs/grpc/src/core/lib/promise/intra_activity_waiter.h deleted file mode 100644 index 889323bf3e..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/intra_activity_waiter.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_INTRA_ACTIVITY_WAITER_H -#define GRPC_CORE_LIB_PROMISE_INTRA_ACTIVITY_WAITER_H - -#include <grpc/support/port_platform.h> - -#include "src/core/lib/promise/activity.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -// Helper type to track wakeups between objects in the same activity. -// Can be fairly fast as no ref counting or locking needs to occur. -class IntraActivityWaiter { - public: - // Register for wakeup, return Pending(). If state is not ready to proceed, - // Promises should bottom out here. - Pending pending() { - waiting_ = true; - return Pending(); - } - // Wake the activity - void Wake() { - if (waiting_) { - waiting_ = false; - Activity::WakeupCurrent(); - } - } - - private: - bool waiting_ = false; -}; - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_INTRA_ACTIVITY_WAITER_H diff --git a/contrib/libs/grpc/src/core/lib/promise/join.h b/contrib/libs/grpc/src/core/lib/promise/join.h deleted file mode 100644 index 35331874ee..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/join.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_JOIN_H -#define GRPC_CORE_LIB_PROMISE_JOIN_H - -#include <grpc/support/port_platform.h> - -#include "y_absl/meta/type_traits.h" - -#include "src/core/lib/promise/detail/basic_join.h" - -namespace grpc_core { -namespace promise_detail { - -struct JoinTraits { - template <typename T> - using ResultType = y_absl::remove_reference_t<T>; - template <typename T, typename F> - static auto OnResult(T result, F kontinue) - -> decltype(kontinue(std::move(result))) { - return kontinue(std::move(result)); - } - template <typename T> - static T Wrap(T x) { - return x; - } -}; - -template <typename... Promises> -using Join = BasicJoin<JoinTraits, Promises...>; - -} // namespace promise_detail - -/// Combinator to run all promises to completion, and return a tuple -/// of their results. -template <typename... Promise> -promise_detail::Join<Promise...> Join(Promise... promises) { - return promise_detail::Join<Promise...>(std::move(promises)...); -} - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_JOIN_H diff --git a/contrib/libs/grpc/src/core/lib/promise/latch.h b/contrib/libs/grpc/src/core/lib/promise/latch.h deleted file mode 100644 index b97b186b40..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/latch.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_LATCH_H -#define GRPC_CORE_LIB_PROMISE_LATCH_H - -#include <grpc/support/port_platform.h> - -#include <grpc/support/log.h> - -#include "src/core/lib/promise/activity.h" -#include "src/core/lib/promise/intra_activity_waiter.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -// Latch provides a single set waitable object. -// Initially the Latch is unset. -// It can be waited upon by the Wait method, which produces a Promise that -// resolves when the Latch is Set to a value of type T. -template <typename T> -class Latch { - public: - // This is the type of the promise returned by Wait. - class WaitPromise { - public: - Poll<T*> operator()() const { - if (latch_->has_value_) { - return &latch_->value_; - } else { - return latch_->waiter_.pending(); - } - } - - private: - friend class Latch; - explicit WaitPromise(Latch* latch) : latch_(latch) {} - Latch* latch_; - }; - - Latch() = default; - Latch(const Latch&) = delete; - Latch& operator=(const Latch&) = delete; - Latch(Latch&& other) noexcept - : value_(std::move(other.value_)), has_value_(other.has_value_) { -#ifndef NDEBUG - GPR_DEBUG_ASSERT(!other.has_had_waiters_); -#endif - } - Latch& operator=(Latch&& other) noexcept { -#ifndef NDEBUG - GPR_DEBUG_ASSERT(!other.has_had_waiters_); -#endif - value_ = std::move(other.value_); - has_value_ = other.has_value_; - return *this; - } - - // Produce a promise to wait for a value from this latch. - WaitPromise Wait() { -#ifndef NDEBUG - has_had_waiters_ = true; -#endif - return WaitPromise(this); - } - - // Set the value of the latch. Can only be called once. - void Set(T value) { - GPR_DEBUG_ASSERT(!has_value_); - value_ = std::move(value); - has_value_ = true; - waiter_.Wake(); - } - - private: - // The value stored (if has_value_ is true), otherwise some random value, we - // don't care. - // Why not y_absl::optional<>? Writing things this way lets us compress - // has_value_ with waiter_ and leads to some significant memory savings for - // some scenarios. - GPR_NO_UNIQUE_ADDRESS T value_; - // True if we have a value set, false otherwise. - bool has_value_ = false; -#ifndef NDEBUG - // Has this latch ever had waiters. - bool has_had_waiters_ = false; -#endif - IntraActivityWaiter waiter_; -}; - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_LATCH_H diff --git a/contrib/libs/grpc/src/core/lib/promise/observable.h b/contrib/libs/grpc/src/core/lib/promise/observable.h deleted file mode 100644 index d99dedb745..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/observable.h +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_OBSERVABLE_H -#define GRPC_CORE_LIB_PROMISE_OBSERVABLE_H - -#include <grpc/support/port_platform.h> - -#include <stdint.h> - -#include <limits> -#include <memory> -#include <type_traits> - -#include "y_absl/base/thread_annotations.h" -#include "y_absl/synchronization/mutex.h" -#include "y_absl/types/optional.h" -#include "y_absl/types/variant.h" - -#include "src/core/lib/promise/activity.h" -#include "src/core/lib/promise/detail/promise_like.h" -#include "src/core/lib/promise/poll.h" -#include "src/core/lib/promise/wait_set.h" - -namespace grpc_core { - -namespace promise_detail { - -using ObservableVersion = uint64_t; -static constexpr ObservableVersion kTombstoneVersion = - std::numeric_limits<ObservableVersion>::max(); - -} // namespace promise_detail - -class WatchCommitter { - public: - void Commit() { version_seen_ = promise_detail::kTombstoneVersion; } - - protected: - promise_detail::ObservableVersion version_seen_ = 0; -}; - -namespace promise_detail { - -// Shared state between Observable and Observer. -template <typename T> -class ObservableState { - public: - explicit ObservableState(y_absl::optional<T> value) - : value_(std::move(value)) {} - - // Publish that we're closed. - void Close() { - mu_.Lock(); - version_ = kTombstoneVersion; - value_.reset(); - auto wakeup = waiters_.TakeWakeupSet(); - mu_.Unlock(); - wakeup.Wakeup(); - } - - // Synchronously publish a new value, and wake any waiters. - void Push(T value) { - mu_.Lock(); - version_++; - value_ = std::move(value); - auto wakeup = waiters_.TakeWakeupSet(); - mu_.Unlock(); - wakeup.Wakeup(); - } - - Poll<y_absl::optional<T>> PollGet(ObservableVersion* version_seen) { - y_absl::MutexLock lock(&mu_); - if (!Started()) return Pending(); - *version_seen = version_; - return value_; - } - - Poll<y_absl::optional<T>> PollNext(ObservableVersion* version_seen) { - y_absl::MutexLock lock(&mu_); - if (!NextValueReady(version_seen)) return Pending(); - return value_; - } - - Poll<y_absl::optional<T>> PollWatch(ObservableVersion* version_seen) { - if (*version_seen == kTombstoneVersion) return Pending(); - - y_absl::MutexLock lock(&mu_); - if (!NextValueReady(version_seen)) return Pending(); - // Watch needs to be woken up if the value changes even if it's ready now. - waiters_.AddPending(Activity::current()->MakeNonOwningWaker()); - return value_; - } - - private: - // Returns true if an initial value is set. - // If one is not set, add ourselves as pending to waiters_, and return false. - bool Started() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) { - if (!value_.has_value()) { - if (version_ != kTombstoneVersion) { - // We allow initial no-value, which does not indicate closure. - waiters_.AddPending(Activity::current()->MakeNonOwningWaker()); - return false; - } - } - return true; - } - - // If no value is ready, add ourselves as pending to waiters_ and return - // false. - // If the next value is ready, update the last version seen and return true. - bool NextValueReady(ObservableVersion* version_seen) - Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) { - if (!Started()) return false; - if (version_ == *version_seen) { - waiters_.AddPending(Activity::current()->MakeNonOwningWaker()); - return false; - } - *version_seen = version_; - return true; - } - - y_absl::Mutex mu_; - WaitSet waiters_ Y_ABSL_GUARDED_BY(mu_); - ObservableVersion version_ Y_ABSL_GUARDED_BY(mu_) = 1; - y_absl::optional<T> value_ Y_ABSL_GUARDED_BY(mu_); -}; - -// Promise implementation for Observer::Get. -template <typename T> -class ObservableGet { - public: - ObservableGet(ObservableVersion* version_seen, ObservableState<T>* state) - : version_seen_(version_seen), state_(state) {} - - Poll<y_absl::optional<T>> operator()() { - return state_->PollGet(version_seen_); - } - - private: - ObservableVersion* version_seen_; - ObservableState<T>* state_; -}; - -// Promise implementation for Observer::Next. -template <typename T> -class ObservableNext { - public: - ObservableNext(ObservableVersion* version_seen, ObservableState<T>* state) - : version_seen_(version_seen), state_(state) {} - - Poll<y_absl::optional<T>> operator()() { - return state_->PollNext(version_seen_); - } - - private: - ObservableVersion* version_seen_; - ObservableState<T>* state_; -}; - -template <typename T, typename F> -class ObservableWatch final : private WatchCommitter { - private: - using Promise = PromiseLike<decltype( - std::declval<F>()(std::declval<T>(), std::declval<WatchCommitter*>()))>; - using Result = typename Promise::Result; - - public: - explicit ObservableWatch(F factory, std::shared_ptr<ObservableState<T>> state) - : state_(std::move(state)), factory_(std::move(factory)) {} - ObservableWatch(const ObservableWatch&) = delete; - ObservableWatch& operator=(const ObservableWatch&) = delete; - ObservableWatch(ObservableWatch&& other) noexcept - : state_(std::move(other.state_)), - promise_(std::move(other.promise_)), - factory_(std::move(other.factory_)) {} - ObservableWatch& operator=(ObservableWatch&&) noexcept = default; - - Poll<Result> operator()() { - auto r = state_->PollWatch(&version_seen_); - if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) { - if (p->has_value()) { - promise_ = Promise(factory_(std::move(**p), this)); - } else { - promise_ = {}; - } - } - if (promise_.has_value()) { - return (*promise_)(); - } else { - return Pending(); - } - } - - private: - std::shared_ptr<ObservableState<T>> state_; - y_absl::optional<Promise> promise_; - F factory_; -}; - -} // namespace promise_detail - -template <typename T> -class Observable; - -// Observer watches an Observable for updates. -// It can see either the latest value or wait for a new value, but is not -// guaranteed to see every value pushed to the Observable. -template <typename T> -class Observer { - public: - Observer(const Observer&) = delete; - Observer& operator=(const Observer&) = delete; - Observer(Observer&& other) noexcept - : version_seen_(other.version_seen_), state_(std::move(other.state_)) {} - Observer& operator=(Observer&& other) noexcept { - version_seen_ = other.version_seen_; - state_ = std::move(other.state_); - return *this; - } - - // Return a promise that will produce an optional<T>. - // If the Observable is still present, this will be a value T, but if the - // Observable has been closed, this will be nullopt. Borrows data from the - // Observer, so this value must stay valid until the promise is resolved. Only - // one Next, Get call is allowed to be outstanding at a time. - promise_detail::ObservableGet<T> Get() { - return promise_detail::ObservableGet<T>{&version_seen_, &*state_}; - } - - // Return a promise that will produce the next unseen value as an optional<T>. - // If the Observable is still present, this will be a value T, but if the - // Observable has been closed, this will be nullopt. Borrows data from the - // Observer, so this value must stay valid until the promise is resolved. Only - // one Next, Get call is allowed to be outstanding at a time. - promise_detail::ObservableNext<T> Next() { - return promise_detail::ObservableNext<T>{&version_seen_, &*state_}; - } - - private: - using State = promise_detail::ObservableState<T>; - friend class Observable<T>; - explicit Observer(std::shared_ptr<State> state) : state_(state) {} - promise_detail::ObservableVersion version_seen_ = 0; - std::shared_ptr<State> state_; -}; - -// Observable models a single writer multiple reader broadcast channel. -// Readers can observe the latest value, or await a new latest value, but they -// are not guaranteed to observe every value. -template <typename T> -class Observable { - public: - Observable() : state_(std::make_shared<State>(y_absl::nullopt)) {} - explicit Observable(T value) - : state_(std::make_shared<State>(std::move(value))) {} - ~Observable() { state_->Close(); } - Observable(const Observable&) = delete; - Observable& operator=(const Observable&) = delete; - - // Push a new value into the observable. - void Push(T value) { state_->Push(std::move(value)); } - - // Create a new Observer - which can pull the current state from this - // Observable. - Observer<T> MakeObserver() { return Observer<T>(state_); } - - // Create a new Watch - a promise that pushes state into the passed in promise - // factory. The promise factory takes two parameters - the current value and a - // commit token. If the commit token is used (the Commit function on it is - // called), then no further Watch updates are provided. - template <typename F> - promise_detail::ObservableWatch<T, F> Watch(F f) { - return promise_detail::ObservableWatch<T, F>(std::move(f), state_); - } - - private: - using State = promise_detail::ObservableState<T>; - std::shared_ptr<State> state_; -}; - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_OBSERVABLE_H diff --git a/contrib/libs/grpc/src/core/lib/promise/pipe.h b/contrib/libs/grpc/src/core/lib/promise/pipe.h deleted file mode 100644 index 2600ef49e5..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/pipe.h +++ /dev/null @@ -1,599 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_PIPE_H -#define GRPC_CORE_LIB_PROMISE_PIPE_H - -#include <grpc/support/port_platform.h> - -#include <assert.h> -#include <stddef.h> -#include <stdint.h> - -#include <new> -#include <type_traits> -#include <utility> - -#include "y_absl/container/inlined_vector.h" -#include "y_absl/status/status.h" -#include "y_absl/status/statusor.h" -#include "y_absl/types/optional.h" -#include "y_absl/types/variant.h" - -#include "src/core/lib/promise/activity.h" -#include "src/core/lib/promise/detail/promise_factory.h" -#include "src/core/lib/promise/intra_activity_waiter.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -template <typename T> -struct Pipe; -template <typename T> -class PipeSender; -template <typename T> -class PipeReceiver; - -namespace pipe_detail { - -template <typename T> -class Push; -template <typename T> -class Next; - -template <class T> -class Promise { - public: - virtual Poll<bool> Step(T* output) = 0; - virtual void Stop() = 0; - - protected: - inline virtual ~Promise() = default; -}; - -struct alignas(alignof(void*)) Scratch { - uint8_t scratch[32]; -}; - -template <typename T> -class FilterInterface { - public: - FilterInterface() = default; - FilterInterface(const FilterInterface&) = delete; - FilterInterface& operator=(const FilterInterface&) = delete; - virtual Promise<T>* Step(T* p, Scratch* scratch_space) = 0; - virtual void UpdateReceiver(PipeReceiver<T>* receiver) = 0; - - protected: - inline virtual ~FilterInterface() {} - static void SetReceiverIndex(PipeReceiver<T>* receiver, int idx, - FilterInterface* p); - char AllocIndex(PipeReceiver<T>* receiver); -}; - -template <typename T, typename F> -class Filter; - -} // namespace pipe_detail - -// Send end of a Pipe. -template <typename T> -class PipeSender { - public: - PipeSender(const PipeSender&) = delete; - PipeSender& operator=(const PipeSender&) = delete; - - PipeSender(PipeSender&& other) noexcept - : receiver_(other.receiver_), push_(other.push_) { - if (receiver_ != nullptr) { - receiver_->sender_ = this; - other.receiver_ = nullptr; - } - if (push_ != nullptr) { - push_->sender_ = this; - other.push_ = nullptr; - } - } - PipeSender& operator=(PipeSender&& other) noexcept { - if (receiver_ != nullptr) { - receiver_->sender_ = nullptr; - } - if (push_ != nullptr) { - push_->sender_ = nullptr; - } - receiver_ = other.receiver_; - if (receiver_ != nullptr) { - receiver_->sender_ = this; - other.receiver_ = nullptr; - } - if (push_ != nullptr) { - push_->sender_ = this; - other.push_ = nullptr; - } - return *this; - } - - ~PipeSender() { - if (receiver_ != nullptr) { - receiver_->MarkClosed(); - } - if (push_ != nullptr) { - push_->sender_ = nullptr; - } - } - - // Send a single message along the pipe. - // Returns a promise that will resolve to a bool - true if the message was - // sent, false if it could never be sent. Blocks the promise until the - // receiver is either closed or able to receive another message. - pipe_detail::Push<T> Push(T value); - - // Attach a promise factory based filter to this pipe. - // The overall promise returned from this will be active until the pipe is - // closed. If this promise is cancelled before the pipe is closed, the pipe - // will close. The filter will be run _after_ any other registered filters. - template <typename F> - pipe_detail::Filter<T, F> Filter(F f); - - private: - friend struct Pipe<T>; - friend class PipeReceiver<T>; - friend class pipe_detail::Next<T>; - friend class pipe_detail::Push<T>; - explicit PipeSender(PipeReceiver<T>* receiver) : receiver_(receiver) {} - PipeReceiver<T>* receiver_; - pipe_detail::Push<T>* push_ = nullptr; -}; - -// Receive end of a Pipe. -template <typename T> -class PipeReceiver { - public: - PipeReceiver(const PipeReceiver&) = delete; - PipeReceiver& operator=(const PipeReceiver&) = delete; - - PipeReceiver(PipeReceiver&& other) noexcept - : sender_(other.sender_), - next_(other.next_), - filters_(std::move(other.filters_)), - pending_(std::move(other.pending_)), - waiting_to_send_(std::move(other.waiting_to_send_)), - waiting_to_receive_(other.waiting_to_receive_) { - if (sender_ != nullptr) { - sender_->receiver_ = this; - other.sender_ = nullptr; - } - if (next_ != nullptr) { - next_->receiver_ = this; - other.next_ = nullptr; - } - for (auto filter : filters_) { - filter->UpdateReceiver(this); - } - } - PipeReceiver& operator=(PipeReceiver&& other) noexcept { - if (sender_ != nullptr) { - sender_->receiver_ = nullptr; - } - if (next_ != nullptr) { - next_->receiver_ = nullptr; - } - sender_ = other.sender_; - next_ = other.next_; - filters_ = std::move(other.filters_); - for (auto filter : filters_) { - filter->UpdateReceiver(this); - } - pending_ = std::move(other.pending_); - waiting_to_send_ = std::move(other.waiting_to_send_); - waiting_to_receive_ = std::move(other.waiting_to_receive_); - if (sender_ != nullptr) { - sender_->receiver_ = this; - other.sender_ = nullptr; - } - if (next_ != nullptr) { - next_->receiver_ = this; - other.next_ = nullptr; - } - return *this; - } - ~PipeReceiver() { - MarkClosed(); - if (next_ != nullptr) { - next_->receiver_ = nullptr; - } - } - - // Receive a single message from the pipe. - // Returns a promise that will resolve to an optional<T> - with a value if a - // message was received, or no value if the other end of the pipe was closed. - // Blocks the promise until the receiver is either closed or a message is - // available. - pipe_detail::Next<T> Next(); - - // Attach a promise factory based filter to this pipe. - // The overall promise returned from this will be active until the pipe is - // closed. If this promise is cancelled before the pipe is closed, the pipe - // will close. The filter will be run _after_ any other registered filters. - template <typename F> - pipe_detail::Filter<T, F> Filter(F f); - - private: - friend struct Pipe<T>; - friend class PipeSender<T>; - friend class pipe_detail::Next<T>; - friend class pipe_detail::Push<T>; - friend class pipe_detail::FilterInterface<T>; - explicit PipeReceiver(PipeSender<T>* sender) : sender_(sender) {} - PipeSender<T>* sender_; - pipe_detail::Next<T>* next_ = nullptr; - y_absl::InlinedVector<pipe_detail::FilterInterface<T>*, 12> filters_; - y_absl::optional<T> pending_; - IntraActivityWaiter waiting_to_send_; - IntraActivityWaiter waiting_to_receive_; - - void MarkClosed() { - if (sender_ == nullptr) { - return; - } - - sender_->receiver_ = nullptr; - - waiting_to_receive_.Wake(); - waiting_to_send_.Wake(); - sender_ = nullptr; - - for (auto* filter : filters_) { - if (filter != nullptr) { - filter->UpdateReceiver(nullptr); - } - } - } -}; - -namespace pipe_detail { - -// Implementation of PipeSender::Push promise. -template <typename T> -class Push { - public: - Push(const Push&) = delete; - Push& operator=(const Push&) = delete; - Push(Push&& other) noexcept - : sender_(other.sender_), push_(std::move(other.push_)) { - if (sender_ != nullptr) { - sender_->push_ = this; - other.sender_ = nullptr; - } - } - Push& operator=(Push&& other) noexcept { - if (sender_ != nullptr) { - sender_->push_ = nullptr; - } - sender_ = other.sender_; - push_ = std::move(other.push_); - if (sender_ != nullptr) { - sender_->push_ = this; - other.sender_ = nullptr; - } - return *this; - } - - ~Push() { - if (sender_ != nullptr) { - assert(sender_->push_ == this); - sender_->push_ = nullptr; - } - } - - Poll<bool> operator()() { - auto* receiver = sender_->receiver_; - if (receiver == nullptr) { - return false; - } - if (receiver->pending_.has_value()) { - return receiver->waiting_to_send_.pending(); - } - receiver->pending_ = std::move(push_); - receiver->waiting_to_receive_.Wake(); - sender_->push_ = nullptr; - sender_ = nullptr; - return true; - } - - private: - friend class PipeSender<T>; - Push(PipeSender<T>* sender, T push) - : sender_(sender), push_(std::move(push)) { - assert(sender_->push_ == nullptr); - sender_->push_ = this; - } - PipeSender<T>* sender_; - T push_; -}; - -// Implementation of PipeReceiver::Next promise. -template <typename T> -class Next { - public: - Next(const Next&) = delete; - Next& operator=(const Next&) = delete; - Next(Next&& other) noexcept - : receiver_(other.receiver_), - next_filter_(other.next_filter_), - current_promise_(nullptr) { - assert(other.current_promise_ == nullptr); - if (receiver_ != nullptr) { - receiver_->next_ = this; - other.receiver_ = nullptr; - } - } - Next& operator=(Next&& other) noexcept { - assert(current_promise_ == nullptr); - assert(other.current_promise_ == nullptr); - if (receiver_ != nullptr) { - receiver_->next_ = nullptr; - } - receiver_ = other.receiver_; - next_filter_ = other.next_filter_; - if (receiver_ != nullptr) { - receiver_->next_ = this; - other.receiver_ = nullptr; - } - return *this; - } - - ~Next() { - if (receiver_ != nullptr) { - assert(receiver_->next_ == this); - receiver_->next_ = nullptr; - } - if (current_promise_ != nullptr) { - current_promise_->Stop(); - } - } - - Poll<y_absl::optional<T>> operator()() { - if (receiver_->pending_.has_value()) { - auto* pending = &*receiver_->pending_; - if (current_promise_ != nullptr) { - auto r = current_promise_->Step(pending); - if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) { - current_promise_->Stop(); - current_promise_ = nullptr; - if (!*p) { - receiver_->MarkClosed(); - return y_absl::optional<T>(); - } - } else { - return Pending(); - } - } - while (true) { - if (next_filter_ >= receiver_->filters_.size()) { - auto result = y_absl::optional<T>(std::move(*pending)); - receiver_->pending_.reset(); - receiver_->waiting_to_send_.Wake(); - receiver_->next_ = nullptr; - receiver_ = nullptr; - return result; - } - auto* filter = receiver_->filters_[next_filter_]; - current_promise_ = filter ? filter->Step(pending, &scratch_) : nullptr; - next_filter_++; - if (current_promise_ == - reinterpret_cast<Promise<T>*>(uintptr_t(false))) { - current_promise_ = nullptr; - receiver_->MarkClosed(); - return y_absl::optional<T>(); - } else if (current_promise_ == - reinterpret_cast<Promise<T>*>(uintptr_t(true))) { - current_promise_ = nullptr; - } else { - return Pending(); - } - } - } - if (receiver_->sender_ == nullptr) { - return y_absl::optional<T>(); - } - return receiver_->waiting_to_receive_.pending(); - } - - private: - friend class PipeReceiver<T>; - explicit Next(PipeReceiver<T>* receiver) : receiver_(receiver) { - assert(receiver_->next_ == nullptr); - receiver_->next_ = this; - } - PipeReceiver<T>* receiver_; - size_t next_filter_ = 0; - Promise<T>* current_promise_ = nullptr; - Scratch scratch_; -}; - -template <typename T, typename F> -class Filter final : private FilterInterface<T> { - public: - Filter(PipeReceiver<T>* receiver, F f) - : active_{receiver, promise_detail::PromiseFactory<T, F>(std::move(f))}, - index_(this->AllocIndex(receiver)){}; - explicit Filter(y_absl::Status already_finished) - : done_(std::move(already_finished)) {} - ~Filter() { - if (index_ != kTombstoneIndex) { - this->SetReceiverIndex(active_.receiver, index_, nullptr); - active_.~Active(); - } else { - done_.~Status(); - } - } - Filter(Filter&& other) noexcept : index_(other.index_) { - if (index_ != kTombstoneIndex) { - new (&active_) Active(std::move(other.active_)); - other.active_.~Active(); - new (&other.done_) y_absl::Status(y_absl::OkStatus()); - other.index_ = kTombstoneIndex; - this->SetReceiverIndex(active_.receiver, index_, this); - } else { - new (&done_) y_absl::Status(std::move(other.done_)); - } - } - - Filter(const Filter&) = delete; - Filter& operator=(const Filter&) = delete; - - Poll<y_absl::Status> operator()() { - if (index_ == kTombstoneIndex) { - return std::move(done_); - } - return Pending(); - } - - private: - static constexpr char kTombstoneIndex = -1; - struct Active { - GPR_NO_UNIQUE_ADDRESS PipeReceiver<T>* receiver; - GPR_NO_UNIQUE_ADDRESS promise_detail::PromiseFactory<T, F> factory; - }; - union { - GPR_NO_UNIQUE_ADDRESS Active active_; - GPR_NO_UNIQUE_ADDRESS y_absl::Status done_; - }; - GPR_NO_UNIQUE_ADDRESS char index_; - - class PromiseImpl final : public ::grpc_core::pipe_detail::Promise<T> { - using PF = typename promise_detail::PromiseFactory<T, F>::Promise; - - public: - PromiseImpl(PF f, Filter* filter) : f_(std::move(f)), filter_(filter) {} - - Poll<bool> Step(T* output) final { - auto r = f_(); - if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) { - if (p->ok()) { - *output = std::move(**p); - return true; - } else { - filter_->SetReceiverIndex(filter_->active_.receiver, filter_->index_, - nullptr); - filter_->active_.~Active(); - filter_->index_ = kTombstoneIndex; - new (&filter_->done_) y_absl::Status(std::move(p->status())); - Activity::WakeupCurrent(); - return false; - } - } else { - return Pending(); - } - } - - void Stop() final { this->~PromiseImpl(); } - - private: - PF f_; - Filter* filter_; - }; - - Promise<T>* Step(T* p, Scratch* scratch) final { - if (index_ != kTombstoneIndex) { - PromiseImpl promise(active_.factory.Repeated(std::move(*p)), this); - auto r = promise.Step(p); - if (auto* result = y_absl::get_if<kPollReadyIdx>(&r)) { - return reinterpret_cast<Promise<T>*>(uintptr_t(*result)); - } - static_assert(sizeof(promise) <= sizeof(Scratch), - "scratch size too small"); - static_assert(alignof(decltype(promise)) <= alignof(Scratch), - "bad alignment"); - return new (scratch) decltype(promise)(std::move(promise)); - } else { - return nullptr; - } - } - - void UpdateReceiver(PipeReceiver<T>* receiver) final { - if (index_ != kTombstoneIndex) { - if (receiver == nullptr) { - active_.~Active(); - index_ = kTombstoneIndex; - new (&done_) y_absl::Status(y_absl::OkStatus()); - } else { - active_.receiver = receiver; - } - Activity::WakeupCurrent(); - } - } -}; - -template <typename T> -void FilterInterface<T>::SetReceiverIndex(PipeReceiver<T>* receiver, int idx, - FilterInterface* p) { - receiver->filters_[idx] = p; -} - -template <typename T> -char FilterInterface<T>::AllocIndex(PipeReceiver<T>* receiver) { - auto r = receiver->filters_.size(); - receiver->filters_.push_back(this); - return r; -} - -} // namespace pipe_detail - -template <typename T> -pipe_detail::Push<T> PipeSender<T>::Push(T value) { - return pipe_detail::Push<T>(this, std::move(value)); -} - -template <typename T> -pipe_detail::Next<T> PipeReceiver<T>::Next() { - return pipe_detail::Next<T>(this); -} - -template <typename T> -template <typename F> -pipe_detail::Filter<T, F> PipeSender<T>::Filter(F f) { - if (receiver_) { - return pipe_detail::Filter<T, F>(receiver_, std::move(f)); - } else { - return pipe_detail::Filter<T, F>(y_absl::OkStatus()); - } -} - -template <typename T> -template <typename F> -pipe_detail::Filter<T, F> PipeReceiver<T>::Filter(F f) { - return pipe_detail::Filter<T, F>(this, std::move(f)); -} - -// A Pipe is an intra-Activity communications channel that transmits T's from -// one end to the other. -// It is only safe to use a Pipe within the context of a single Activity. -// No synchronization is performed internally. -template <typename T> -struct Pipe { - Pipe() : sender(&receiver), receiver(&sender) {} - Pipe(const Pipe&) = delete; - Pipe& operator=(const Pipe&) = delete; - Pipe(Pipe&&) noexcept = default; - Pipe& operator=(Pipe&&) noexcept = default; - - PipeSender<T> sender; - PipeReceiver<T> receiver; -}; - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_PIPE_H diff --git a/contrib/libs/grpc/src/core/lib/promise/promise.h b/contrib/libs/grpc/src/core/lib/promise/promise.h deleted file mode 100644 index aba0150e91..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/promise.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_PROMISE_H -#define GRPC_CORE_LIB_PROMISE_PROMISE_H - -#include <grpc/support/port_platform.h> - -#include <functional> -#include <type_traits> - -#include "y_absl/types/optional.h" -#include "y_absl/types/variant.h" - -#include "src/core/lib/promise/detail/promise_like.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -// A Promise is any functor that takes no arguments and returns Poll<T>. -// Most of the time we just pass around the functor, but occasionally -// it pays to have a type erased variant, which we define here. -template <typename T> -using Promise = std::function<Poll<T>()>; - -// Helper to execute a promise immediately and return either the result or -// nothing. -template <typename Promise> -auto NowOrNever(Promise promise) - -> y_absl::optional<typename promise_detail::PromiseLike<Promise>::Result> { - auto r = promise_detail::PromiseLike<Promise>(std::move(promise))(); - if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) { - return std::move(*p); - } - return {}; -} - -// A promise that never completes. -template <typename T> -struct Never { - Poll<T> operator()() { return Pending(); } -}; - -namespace promise_detail { -// A promise that immediately completes. -template <typename T> -class Immediate { - public: - explicit Immediate(T value) : value_(std::move(value)) {} - - Poll<T> operator()() { return std::move(value_); } - - private: - T value_; -}; - -} // namespace promise_detail - -// Return \a value immediately -template <typename T> -promise_detail::Immediate<T> Immediate(T value) { - return promise_detail::Immediate<T>(std::move(value)); -} - -// Typecheck that a promise returns the expected return type. -// usage: auto promise = WithResult<int>([]() { return 3; }); -// NOTE: there are tests in promise_test.cc that are commented out because they -// should fail to compile. When modifying this code these should be uncommented -// and their miscompilation verified. -template <typename T, typename F> -auto WithResult(F f) -> - typename std::enable_if<std::is_same<decltype(f()), Poll<T>>::value, - F>::type { - return f; -} - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_PROMISE_H diff --git a/contrib/libs/grpc/src/core/lib/promise/try_join.h b/contrib/libs/grpc/src/core/lib/promise/try_join.h deleted file mode 100644 index 7070e49060..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/try_join.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_TRY_JOIN_H -#define GRPC_CORE_LIB_PROMISE_TRY_JOIN_H - -#include <grpc/support/port_platform.h> - -#include <type_traits> - -#include "y_absl/meta/type_traits.h" -#include "y_absl/status/status.h" -#include "y_absl/status/statusor.h" - -#include "src/core/lib/promise/detail/basic_join.h" -#include "src/core/lib/promise/detail/status.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -namespace promise_detail { - -// Extract the T from a StatusOr<T> -template <typename T> -T IntoResult(y_absl::StatusOr<T>* status) { - return std::move(**status); -} - -// TryJoin returns a StatusOr<tuple<A,B,C>> for f()->Poll<StatusOr<A>>, -// g()->Poll<StatusOr<B>>, h()->Poll<StatusOr<C>>. If one of those should be a -// Status instead, we need a placeholder type to return, and this is it. -struct Empty {}; -inline Empty IntoResult(y_absl::Status*) { return Empty{}; } - -// Traits object to pass to BasicJoin -struct TryJoinTraits { - template <typename T> - using ResultType = - decltype(IntoResult(std::declval<y_absl::remove_reference_t<T>*>())); - template <typename T, typename F> - static auto OnResult(T result, F kontinue) - -> decltype(kontinue(IntoResult(&result))) { - using Result = - typename PollTraits<decltype(kontinue(IntoResult(&result)))>::Type; - if (!result.ok()) { - return Result(IntoStatus(&result)); - } - return kontinue(IntoResult(&result)); - } - template <typename T> - static y_absl::StatusOr<T> Wrap(T x) { - return y_absl::StatusOr<T>(std::move(x)); - } -}; - -// Implementation of TryJoin combinator. -template <typename... Promises> -using TryJoin = BasicJoin<TryJoinTraits, Promises...>; - -} // namespace promise_detail - -// Run all promises. -// If any fail, cancel the rest and return the failure. -// If all succeed, return Ok(tuple-of-results). -template <typename... Promises> -promise_detail::TryJoin<Promises...> TryJoin(Promises... promises) { - return promise_detail::TryJoin<Promises...>(std::move(promises)...); -} - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_TRY_JOIN_H diff --git a/contrib/libs/grpc/src/core/lib/promise/try_seq.h b/contrib/libs/grpc/src/core/lib/promise/try_seq.h deleted file mode 100644 index 432a5b46ec..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/try_seq.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_TRY_SEQ_H -#define GRPC_CORE_LIB_PROMISE_TRY_SEQ_H - -#include <grpc/support/port_platform.h> - -#include <tuple> -#include <utility> - -#include "y_absl/status/status.h" -#include "y_absl/status/statusor.h" -#include "y_absl/types/variant.h" - -#include "src/core/lib/promise/detail/basic_seq.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -namespace promise_detail { - -template <typename T> -struct TrySeqTraits { - using UnwrappedType = T; - using WrappedType = y_absl::StatusOr<T>; - template <typename Next> - static auto CallFactory(Next* next, T&& value) - -> decltype(next->Once(std::forward<T>(value))) { - return next->Once(std::forward<T>(value)); - } - template <typename Result, typename RunNext> - static Poll<Result> CheckResultAndRunNext(T prior, RunNext run_next) { - return run_next(std::move(prior)); - } -}; - -template <typename T> -struct TrySeqTraits<y_absl::StatusOr<T>> { - using UnwrappedType = T; - using WrappedType = y_absl::StatusOr<T>; - template <typename Next> - static auto CallFactory(Next* next, y_absl::StatusOr<T>&& status) - -> decltype(next->Once(std::move(*status))) { - return next->Once(std::move(*status)); - } - template <typename Result, typename RunNext> - static Poll<Result> CheckResultAndRunNext(y_absl::StatusOr<T> prior, - RunNext run_next) { - if (!prior.ok()) return Result(prior.status()); - return run_next(std::move(prior)); - } -}; -template <> -struct TrySeqTraits<y_absl::Status> { - using UnwrappedType = void; - using WrappedType = y_absl::Status; - template <typename Next> - static auto CallFactory(Next* next, y_absl::Status&&) - -> decltype(next->Once()) { - return next->Once(); - } - template <typename Result, typename RunNext> - static Poll<Result> CheckResultAndRunNext(y_absl::Status prior, - RunNext run_next) { - if (!prior.ok()) return Result(prior); - return run_next(std::move(prior)); - } -}; - -template <typename... Fs> -using TrySeq = BasicSeq<TrySeqTraits, Fs...>; - -} // namespace promise_detail - -// Try a sequence of operations. -// * Run the first functor as a promise. -// * Feed its success result into the second functor to create a promise, -// then run that. -// * ... -// * Feed the second-final success result into the final functor to create a -// promise, then run that, with the overall success result being that -// promises success result. -// If any step fails, fail everything. -// Functors can return StatusOr<> to signal that a value is fed forward, or -// Status to indicate only success/failure. In the case of returning Status, -// the construction functors take no arguments. -template <typename... Functors> -promise_detail::TrySeq<Functors...> TrySeq(Functors... functors) { - return promise_detail::TrySeq<Functors...>(std::move(functors)...); -} - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_TRY_SEQ_H diff --git a/contrib/libs/grpc/src/core/lib/promise/wait_set.h b/contrib/libs/grpc/src/core/lib/promise/wait_set.h deleted file mode 100644 index 5d0b3714bf..0000000000 --- a/contrib/libs/grpc/src/core/lib/promise/wait_set.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_PROMISE_WAIT_SET_H -#define GRPC_CORE_LIB_PROMISE_WAIT_SET_H - -#include <grpc/support/port_platform.h> - -#include <utility> - -#include "y_absl/container/flat_hash_set.h" - -#include "src/core/lib/promise/activity.h" -#include "src/core/lib/promise/poll.h" - -namespace grpc_core { - -// Helper type that can be used to enqueue many Activities waiting for some -// external state. -// Typically the external state should be guarded by mu_, and a call to -// WakeAllAndUnlock should be made when the state changes. -// Promises should bottom out polling inside pending(), which will register for -// wakeup and return Pending(). -// Queues handles to Activities, and not Activities themselves, meaning that if -// an Activity is destroyed prior to wakeup we end up holding only a small -// amount of memory (around 16 bytes + malloc overhead) until the next wakeup -// occurs. -class WaitSet final { - using WakerSet = y_absl::flat_hash_set<Waker>; - - public: - // Register for wakeup, return Pending(). If state is not ready to proceed, - // Promises should bottom out here. - Pending AddPending(Waker waker) { - pending_.emplace(std::move(waker)); - return Pending(); - } - - class WakeupSet { - public: - void Wakeup() { - while (!wakeup_.empty()) { - wakeup_.extract(wakeup_.begin()).value().Wakeup(); - } - } - - private: - friend class WaitSet; - explicit WakeupSet(WakerSet&& wakeup) - : wakeup_(std::forward<WakerSet>(wakeup)) {} - WakerSet wakeup_; - }; - - GRPC_MUST_USE_RESULT WakeupSet TakeWakeupSet() { - return WakeupSet(std::move(pending_)); - } - - private: - // Handles to activities that need to be awoken. - WakerSet pending_; -}; - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_PROMISE_WAIT_SET_H diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/cel_authorization_engine.h b/contrib/libs/grpc/src/core/lib/security/authorization/cel_authorization_engine.h deleted file mode 100644 index 53d27369b1..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/cel_authorization_engine.h +++ /dev/null @@ -1,85 +0,0 @@ - -// Copyright 2020 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_CEL_AUTHORIZATION_ENGINE_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_CEL_AUTHORIZATION_ENGINE_H - -#include <grpc/support/port_platform.h> - -#include <map> -#include <memory> -#include <util/generic/string.h> -#include <vector> - -#include "y_absl/container/flat_hash_set.h" -#include "envoy/config/rbac/v3/rbac.upb.h" -#include "google/api/expr/v1alpha1/syntax.upb.h" -#include "upb/upb.hpp" - -#include <grpc/support/log.h> - -#include "src/core/lib/security/authorization/evaluate_args.h" -#include "src/core/lib/security/authorization/mock_cel/activation.h" - -namespace grpc_core { - -// CelAuthorizationEngine makes an AuthorizationDecision to ALLOW or DENY the -// current action based on the condition fields in provided RBAC policies. -// The engine may be constructed with one or two policies. If two polcies, -// the first policy is deny-if-matched and the second is allow-if-matched. -// The engine returns UNDECIDED decision if it fails to find a match in any -// policy. This engine ignores the principal and permission fields in RBAC -// policies. It is the caller's responsibility to provide RBAC policies that -// are compatible with this engine. -// -// Example: -// CelAuthorizationEngine* engine = -// CelAuthorizationEngine::CreateCelAuthorizationEngine(rbac_policies); -// engine->Evaluate(evaluate_args); // returns authorization decision. -class CelAuthorizationEngine { - public: - // rbac_policies must be a vector containing either a single policy of any - // kind, or one deny policy and one allow policy, in that order. - static std::unique_ptr<CelAuthorizationEngine> CreateCelAuthorizationEngine( - const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies); - - // Users should use the CreateCelAuthorizationEngine factory function - // instead of calling the CelAuthorizationEngine constructor directly. - explicit CelAuthorizationEngine( - const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies); - // TODO(mywang@google.com): add an Evaluate member function. - - private: - enum Action { - kAllow, - kDeny, - }; - - std::unique_ptr<mock_cel::Activation> CreateActivation( - const EvaluateArgs& args); - - std::map<const TString, const google_api_expr_v1alpha1_Expr*> - deny_if_matched_; - std::map<const TString, const google_api_expr_v1alpha1_Expr*> - allow_if_matched_; - upb::Arena arena_; - y_absl::flat_hash_set<TString> envoy_attributes_; - y_absl::flat_hash_set<TString> header_keys_; - std::unique_ptr<mock_cel::CelMap> headers_; -}; - -} // namespace grpc_core - -#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_CEL_AUTHORIZATION_ENGINE_H */ diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h b/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h deleted file mode 100644 index 0e958afcdb..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_ENGINE_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_ENGINE_H - -#include <grpc/support/port_platform.h> - -#include "src/core/lib/security/authorization/authorization_engine.h" -#include "src/core/lib/security/authorization/matchers.h" -#include "src/core/lib/security/authorization/rbac_policy.h" - -namespace grpc_core { - -// GrpcAuthorizationEngine can be either an Allow engine or Deny engine. This -// engine makes authorization decisions to Allow or Deny incoming RPC request -// based on permission and principal configs in the provided RBAC policy and the -// engine type. This engine ignores condition field in RBAC config. It is the -// caller's responsibility to provide RBAC policies that are compatible with -// this engine. -class GrpcAuthorizationEngine : public AuthorizationEngine { - public: - // Builds GrpcAuthorizationEngine without any policies. - explicit GrpcAuthorizationEngine(Rbac::Action action) : action_(action) {} - // Builds GrpcAuthorizationEngine with allow/deny RBAC policy. - explicit GrpcAuthorizationEngine(Rbac policy); - - Rbac::Action action() { return action_; } - - // Required only for testing purpose. - size_t num_policies() { return policies_.size(); } - - // Evaluates incoming request against RBAC policy and makes a decision to - // whether allow/deny this request. - Decision Evaluate(const EvaluateArgs& args) const override; - - private: - struct Policy { - TString name; - std::unique_ptr<AuthorizationMatcher> matcher; - }; - - Rbac::Action action_; - std::vector<Policy> policies_; -}; - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_ENGINE_H diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h b/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h deleted file mode 100644 index bd521d66d6..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_POLICY_PROVIDER_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_POLICY_PROVIDER_H - -#include <grpc/support/port_platform.h> - -#include <memory> - -#include "y_absl/status/statusor.h" - -#include "src/core/lib/gprpp/sync.h" -#include "src/core/lib/gprpp/thd.h" -#include "src/core/lib/security/authorization/authorization_policy_provider.h" -#include "src/core/lib/security/authorization/rbac_translator.h" - -namespace grpc_core { - -// Provider class will get SDK Authorization policy from string during -// initialization. This policy will be translated to Envoy RBAC policies and -// used to initialize allow and deny AuthorizationEngine objects. This provider -// will return the same authorization engines everytime. -class StaticDataAuthorizationPolicyProvider - : public grpc_authorization_policy_provider { - public: - static y_absl::StatusOr<RefCountedPtr<grpc_authorization_policy_provider>> - Create(y_absl::string_view authz_policy); - - // Use factory method "Create" to create an instance of - // StaticDataAuthorizationPolicyProvider. - explicit StaticDataAuthorizationPolicyProvider(RbacPolicies policies); - - AuthorizationEngines engines() override { - return {allow_engine_, deny_engine_}; - } - - void Orphan() override {} - - private: - RefCountedPtr<AuthorizationEngine> allow_engine_; - RefCountedPtr<AuthorizationEngine> deny_engine_; -}; - -// Provider class will get SDK Authorization policy from provided file path. -// This policy will be translated to Envoy RBAC policies and used to initialize -// allow and deny AuthorizationEngine objects. This provider will periodically -// load file contents in specified path, and upon modification update the engine -// instances with new policy configuration. During reload if the file contents -// are invalid or there are I/O errors, we will skip that particular update and -// log error status. The authorization decisions will be made using the latest -// valid policy. -class FileWatcherAuthorizationPolicyProvider - : public grpc_authorization_policy_provider { - public: - static y_absl::StatusOr<RefCountedPtr<grpc_authorization_policy_provider>> - Create(y_absl::string_view authz_policy_path, - unsigned int refresh_interval_sec); - - // Use factory method "Create" to create an instance of - // FileWatcherAuthorizationPolicyProvider. - FileWatcherAuthorizationPolicyProvider(y_absl::string_view authz_policy_path, - unsigned int refresh_interval_sec, - y_absl::Status* status); - - void Orphan() override; - - AuthorizationEngines engines() override { - MutexLock lock(&mu_); - return {allow_engine_, deny_engine_}; - } - - private: - // Force an update from the file system regardless of the interval. - y_absl::Status ForceUpdate(); - - TString authz_policy_path_; - TString file_contents_; - unsigned int refresh_interval_sec_; - - std::unique_ptr<Thread> refresh_thread_; - gpr_event shutdown_event_; - - Mutex mu_; - // Engines created using authz_policy_. - RefCountedPtr<AuthorizationEngine> allow_engine_ Y_ABSL_GUARDED_BY(mu_); - RefCountedPtr<AuthorizationEngine> deny_engine_ Y_ABSL_GUARDED_BY(mu_); -}; - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_POLICY_PROVIDER_H diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/matchers.h b/contrib/libs/grpc/src/core/lib/security/authorization/matchers.h deleted file mode 100644 index 95ebd51583..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/matchers.h +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MATCHERS_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MATCHERS_H - -#include <grpc/support/port_platform.h> - -#include <memory> - -#include "src/core/lib/matchers/matchers.h" -#include "src/core/lib/security/authorization/evaluate_args.h" -#include "src/core/lib/security/authorization/rbac_policy.h" - -namespace grpc_core { - -// Describes the rules for matching permission or principal. -class AuthorizationMatcher { - public: - virtual ~AuthorizationMatcher() = default; - - // Returns whether or not the permission/principal matches the rules of the - // matcher. - virtual bool Matches(const EvaluateArgs& args) const = 0; - - // Creates an instance of a matcher based off the rules defined in Permission - // config. - static std::unique_ptr<AuthorizationMatcher> Create( - Rbac::Permission permission); - - // Creates an instance of a matcher based off the rules defined in Principal - // config. - static std::unique_ptr<AuthorizationMatcher> Create( - Rbac::Principal principal); -}; - -class AlwaysAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit AlwaysAuthorizationMatcher() = default; - - bool Matches(const EvaluateArgs&) const override { return true; } -}; - -class AndAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit AndAuthorizationMatcher( - std::vector<std::unique_ptr<AuthorizationMatcher>> matchers) - : matchers_(std::move(matchers)) {} - - bool Matches(const EvaluateArgs& args) const override; - - private: - std::vector<std::unique_ptr<AuthorizationMatcher>> matchers_; -}; - -class OrAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit OrAuthorizationMatcher( - std::vector<std::unique_ptr<AuthorizationMatcher>> matchers) - : matchers_(std::move(matchers)) {} - - bool Matches(const EvaluateArgs& args) const override; - - private: - std::vector<std::unique_ptr<AuthorizationMatcher>> matchers_; -}; - -// Negates matching the provided permission/principal. -class NotAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit NotAuthorizationMatcher( - std::unique_ptr<AuthorizationMatcher> matcher) - : matcher_(std::move(matcher)) {} - - bool Matches(const EvaluateArgs& args) const override; - - private: - std::unique_ptr<AuthorizationMatcher> matcher_; -}; - -// TODO(ashithasantosh): Add matcher implementation for metadata field. - -// Perform a match against HTTP headers. -class HeaderAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit HeaderAuthorizationMatcher(HeaderMatcher matcher) - : matcher_(std::move(matcher)) {} - - bool Matches(const EvaluateArgs& args) const override; - - private: - const HeaderMatcher matcher_; -}; - -// Perform a match against IP Cidr Range. -class IpAuthorizationMatcher : public AuthorizationMatcher { - public: - enum class Type { - kDestIp, - kSourceIp, - kDirectRemoteIp, - kRemoteIp, - }; - - IpAuthorizationMatcher(Type type, Rbac::CidrRange range); - - bool Matches(const EvaluateArgs& args) const override; - - private: - const Type type_; - // Subnet masked address. - grpc_resolved_address subnet_address_; - const uint32_t prefix_len_; -}; - -// Perform a match against port number of the destination (local) address. -class PortAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit PortAuthorizationMatcher(int port) : port_(port) {} - - bool Matches(const EvaluateArgs& args) const override; - - private: - const int port_; -}; - -// Matches the principal name as described in the peer certificate. Uses URI SAN -// or DNS SAN in that order, otherwise uses subject field. -class AuthenticatedAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit AuthenticatedAuthorizationMatcher(StringMatcher auth) - : matcher_(std::move(auth)) {} - - bool Matches(const EvaluateArgs& args) const override; - - private: - const StringMatcher matcher_; -}; - -// Perform a match against the request server from the client's connection -// request. This is typically TLS SNI. Currently unsupported. -class ReqServerNameAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit ReqServerNameAuthorizationMatcher( - StringMatcher requested_server_name) - : matcher_(std::move(requested_server_name)) {} - - bool Matches(const EvaluateArgs&) const override; - - private: - const StringMatcher matcher_; -}; - -// Perform a match against the path header of HTTP request. -class PathAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit PathAuthorizationMatcher(StringMatcher path) - : matcher_(std::move(path)) {} - - bool Matches(const EvaluateArgs& args) const override; - - private: - const StringMatcher matcher_; -}; - -// Performs a match for policy field in RBAC, which is a collection of -// permission and principal matchers. Policy matches iff, we find a match in one -// of its permissions and a match in one of its principals. -class PolicyAuthorizationMatcher : public AuthorizationMatcher { - public: - explicit PolicyAuthorizationMatcher(Rbac::Policy policy) - : permissions_( - AuthorizationMatcher::Create(std::move(policy.permissions))), - principals_( - AuthorizationMatcher::Create(std::move(policy.principals))) {} - - bool Matches(const EvaluateArgs& args) const override; - - private: - std::unique_ptr<AuthorizationMatcher> permissions_; - std::unique_ptr<AuthorizationMatcher> principals_; -}; - -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MATCHERS_H diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/activation.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/activation.h deleted file mode 100644 index 05f00a5048..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/activation.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H - -#include <grpc/support/port_platform.h> - -#include "y_absl/strings/string_view.h" - -#include "src/core/lib/security/authorization/mock_cel/cel_value.h" - -namespace grpc_core { -namespace mock_cel { - -// Base class for an activation. This is a temporary stub implementation of CEL -// APIs. Once gRPC imports the CEL library, this class will be removed. -class BaseActivation { - public: - BaseActivation() = default; - - // Non-copyable/non-assignable - BaseActivation(const BaseActivation&) = delete; - BaseActivation& operator=(const BaseActivation&) = delete; -}; - -// Instance of Activation class is used by evaluator. -// It provides binding between references used in expressions -// and actual values. This is a temporary stub implementation of CEL APIs. -// Once gRPC imports the CEL library, this class will be removed. -class Activation : public BaseActivation { - public: - Activation() = default; - - // Non-copyable/non-assignable - Activation(const Activation&) = delete; - Activation& operator=(const Activation&) = delete; - - // Insert value into Activation. - void InsertValue(y_absl::string_view /*name*/, const CelValue& /*value*/) {} -}; - -} // namespace mock_cel -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h deleted file mode 100644 index 630b0bc0d2..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2020 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H - -#include <grpc/support/port_platform.h> - -#include <memory> - -#include "y_absl/memory/memory.h" - -#include "src/core/lib/security/authorization/mock_cel/flat_expr_builder.h" - -namespace grpc_core { -namespace mock_cel { - -// This is a temporary stub implementation of CEL APIs. -// Once gRPC imports the CEL library, this file will be removed. - -struct InterpreterOptions { - bool short_circuiting = true; -}; - -inline std::unique_ptr<CelExpressionBuilder> CreateCelExpressionBuilder( - const InterpreterOptions& options) { - return y_absl::make_unique<FlatExprBuilder>(); -} - -} // namespace mock_cel -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H
\ No newline at end of file diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h deleted file mode 100644 index 2b4c3666e7..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2020 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H - -#include <grpc/support/port_platform.h> - -#include <memory> -#include <vector> - -#include "y_absl/status/statusor.h" -#include "google/api/expr/v1alpha1/syntax.upb.h" - -#include "src/core/lib/security/authorization/mock_cel/activation.h" -#include "src/core/lib/security/authorization/mock_cel/cel_value.h" - -namespace grpc_core { -namespace mock_cel { - -// This is a temporary stub implementation of CEL APIs. -// Once gRPC imports the CEL library, this file will be removed. - -// Base interface for expression evaluating objects. -class CelExpression { - public: - virtual ~CelExpression() = default; - - // Evaluates expression and returns value. - // activation contains bindings from parameter names to values - virtual y_absl::StatusOr<CelValue> Evaluate( - const BaseActivation& activation) const = 0; -}; - -// Base class for Expression Builder implementations -// Provides user with factory to register extension functions. -// ExpressionBuilder MUST NOT be destroyed before CelExpression objects -// it built. -class CelExpressionBuilder { - public: - virtual ~CelExpressionBuilder() = default; - - // Creates CelExpression object from AST tree. - // expr specifies root of AST tree - virtual y_absl::StatusOr<std::unique_ptr<CelExpression>> CreateExpression( - const google_api_expr_v1alpha1_Expr* expr, - const google_api_expr_v1alpha1_SourceInfo* source_info) const = 0; - - virtual y_absl::StatusOr<std::unique_ptr<CelExpression>> CreateExpression( - const google_api_expr_v1alpha1_Expr* expr, - const google_api_expr_v1alpha1_SourceInfo* source_info, - std::vector<y_absl::Status>* warnings) const = 0; -}; - -} // namespace mock_cel -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H
\ No newline at end of file diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_value.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_value.h deleted file mode 100644 index ccb4ffeab0..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_value.h +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2020 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_VALUE_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_VALUE_H - -// CelValue is a holder, capable of storing all kinds of data -// supported by CEL. -// CelValue defines explicitly typed/named getters/setters. -// When storing pointers to objects, CelValue does not accept ownership -// to them and does not control their lifecycle. Instead objects are expected -// to be either external to expression evaluation, and controlled beyond the -// scope or to be allocated and associated with some allocation/ownership -// controller (Arena). -// Usage examples: -// (a) For primitive types: -// CelValue value = CelValue::CreateInt64(1); -// (b) For string: -// TString* msg("test"); -// CelValue value = CelValue::CreateString(msg); - -#include <grpc/support/port_platform.h> - -#include <memory> - -#include "y_absl/memory/memory.h" -#include "y_absl/strings/string_view.h" -#include "y_absl/types/span.h" - -namespace grpc_core { -namespace mock_cel { - -// Break cyclic depdendencies for container types. -class CelMap { - public: - CelMap() = default; -}; - -// This is a temporary stub implementation of CEL APIs. -// Once gRPC imports the CEL library, this class will be removed. -class CelValue { - public: - // Default constructor. - // Creates CelValue with null data type. - CelValue() : CelValue(nullptr) {} - - // We will use factory methods instead of public constructors - // The reason for this is the high risk of implicit type conversions - // between bool/int/pointer types. - // We rely on copy elision to avoid extra copying. - static CelValue CreateNull() { return CelValue(nullptr); } - - static CelValue CreateInt64(int64_t /*value*/) { return CreateNull(); } - - static CelValue CreateUint64(uint64_t /*value*/) { return CreateNull(); } - - static CelValue CreateStringView(y_absl::string_view /*value*/) { - return CreateNull(); - } - - static CelValue CreateString(const TString* /*str*/) { - return CreateNull(); - } - - static CelValue CreateMap(const CelMap* /*value*/) { return CreateNull(); } - - private: - // Constructs CelValue wrapping value supplied as argument. - // Value type T should be supported by specification of ValueHolder. - template <class T> - explicit CelValue(T /*value*/) {} -}; - -// CelMap implementation that uses STL map container as backing storage. -class ContainerBackedMapImpl : public CelMap { - public: - ContainerBackedMapImpl() = default; - - static std::unique_ptr<CelMap> Create( - y_absl::Span<std::pair<CelValue, CelValue>> /*key_values*/) { - return y_absl::make_unique<ContainerBackedMapImpl>(); - } -}; - -} // namespace mock_cel -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_VALUE_H diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h deleted file mode 100644 index e6d4aea743..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2020 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H - -#include <grpc/support/port_platform.h> - -#include <memory> -#include <set> -#include <vector> - -#include "y_absl/status/statusor.h" -#include "google/api/expr/v1alpha1/syntax.upb.h" - -#include "src/core/lib/security/authorization/mock_cel/activation.h" -#include "src/core/lib/security/authorization/mock_cel/cel_expression.h" -#include "src/core/lib/security/authorization/mock_cel/cel_value.h" - -namespace grpc_core { -namespace mock_cel { - -// This is a temporary stub implementation of CEL APIs. -// Once gRPC imports the CEL library, this file will be removed. - -class ExecutionPath { - public: - ExecutionPath() = default; -}; - -// Implementation of the CelExpression that utilizes flattening -// of the expression tree. -class CelExpressionFlatImpl : public CelExpression { - // Constructs CelExpressionFlatImpl instance. - // path is flat execution path that is based upon - // flattened AST tree. Max iterations dictates the maximum number of - // iterations in the comprehension expressions (use 0 to disable the upper - // bound). - public: - CelExpressionFlatImpl(const google_api_expr_v1alpha1_Expr* root_expr, - ExecutionPath path, int max_iterations, - std::set<TString> iter_variable_names, - bool enable_unknowns = false, - bool enable_unknown_function_results = false) {} - - // Implementation of CelExpression evaluate method. - y_absl::StatusOr<CelValue> Evaluate( - const BaseActivation& activation) const override { - return CelValue::CreateNull(); - } -}; - -} // namespace mock_cel -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H
\ No newline at end of file diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h deleted file mode 100644 index c4f4568fd0..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_FLAT_EXPR_BUILDER_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_FLAT_EXPR_BUILDER_H - -#include <grpc/support/port_platform.h> - -#include <memory> - -#include "src/core/lib/security/authorization/mock_cel/evaluator_core.h" - -namespace grpc_core { -namespace mock_cel { - -// This is a temporary stub implementation of CEL APIs. -// Once gRPC imports the CEL library, this file will be removed. - -// CelExpressionBuilder implementation. -// Builds instances of CelExpressionFlatImpl. -class FlatExprBuilder : public CelExpressionBuilder { - public: - FlatExprBuilder() = default; - - y_absl::StatusOr<std::unique_ptr<CelExpression>> CreateExpression( - const google_api_expr_v1alpha1_Expr* expr, - const google_api_expr_v1alpha1_SourceInfo* source_info) const override { - ExecutionPath path; - return y_absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0, - std::set<TString>{}); - } - - y_absl::StatusOr<std::unique_ptr<CelExpression>> CreateExpression( - const google_api_expr_v1alpha1_Expr* expr, - const google_api_expr_v1alpha1_SourceInfo* source_info, - std::vector<y_absl::Status>* warnings) const override { - ExecutionPath path; - return y_absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0, - std::set<TString>{}); - } -}; - -} // namespace mock_cel -} // namespace grpc_core - -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_FLAT_EXPR_BUILDER_H diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/rbac_policy.h b/contrib/libs/grpc/src/core/lib/security/authorization/rbac_policy.h deleted file mode 100644 index eb691b0ec9..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/rbac_policy.h +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_POLICY_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_POLICY_H - -#include <grpc/support/port_platform.h> - -#include <memory> - -#include "src/core/lib/matchers/matchers.h" - -namespace grpc_core { - -// Represents Envoy RBAC Proto. [See -// https://github.com/envoyproxy/envoy/blob/release/v1.17/api/envoy/config/rbac/v3/rbac.proto] -struct Rbac { - enum class Action { - kAllow, - kDeny, - }; - - struct CidrRange { - CidrRange() = default; - CidrRange(TString address_prefix, uint32_t prefix_len); - - CidrRange(CidrRange&& other) noexcept; - CidrRange& operator=(CidrRange&& other) noexcept; - - TString ToString() const; - - TString address_prefix; - uint32_t prefix_len; - }; - - // TODO(ashithasantosh): Add metadata field to Permission and Principal. - struct Permission { - enum class RuleType { - kAnd, - kOr, - kNot, - kAny, - kHeader, - kPath, - kDestIp, - kDestPort, - kReqServerName, - }; - - Permission() = default; - // For kAnd/kOr RuleType. - Permission(Permission::RuleType type, - std::vector<std::unique_ptr<Permission>> permissions); - // For kNot RuleType. - Permission(Permission::RuleType type, Permission permission); - // For kAny RuleType. - explicit Permission(Permission::RuleType type); - // For kHeader RuleType. - Permission(Permission::RuleType type, HeaderMatcher header_matcher); - // For kPath/kReqServerName RuleType. - Permission(Permission::RuleType type, StringMatcher string_matcher); - // For kDestIp RuleType. - Permission(Permission::RuleType type, CidrRange ip); - // For kDestPort RuleType. - Permission(Permission::RuleType type, int port); - - Permission(Permission&& other) noexcept; - Permission& operator=(Permission&& other) noexcept; - - TString ToString() const; - - RuleType type; - HeaderMatcher header_matcher; - StringMatcher string_matcher; - CidrRange ip; - int port; - // For type kAnd/kOr/kNot. For kNot type, the vector will have only one - // element. - std::vector<std::unique_ptr<Permission>> permissions; - }; - - struct Principal { - enum class RuleType { - kAnd, - kOr, - kNot, - kAny, - kPrincipalName, - kSourceIp, - kDirectRemoteIp, - kRemoteIp, - kHeader, - kPath, - }; - - Principal() = default; - // For kAnd/kOr RuleType. - Principal(Principal::RuleType type, - std::vector<std::unique_ptr<Principal>> principals); - // For kNot RuleType. - Principal(Principal::RuleType type, Principal principal); - // For kAny RuleType. - explicit Principal(Principal::RuleType type); - // For kPrincipalName/kPath RuleType. - Principal(Principal::RuleType type, StringMatcher string_matcher); - // For kSourceIp/kDirectRemoteIp/kRemoteIp RuleType. - Principal(Principal::RuleType type, CidrRange ip); - // For kHeader RuleType. - Principal(Principal::RuleType type, HeaderMatcher header_matcher); - - Principal(Principal&& other) noexcept; - Principal& operator=(Principal&& other) noexcept; - - TString ToString() const; - - RuleType type; - HeaderMatcher header_matcher; - StringMatcher string_matcher; - CidrRange ip; - // For type kAnd/kOr/kNot. For kNot type, the vector will have only one - // element. - std::vector<std::unique_ptr<Principal>> principals; - }; - - struct Policy { - Policy() = default; - Policy(Permission permissions, Principal principals); - - Policy(Policy&& other) noexcept; - Policy& operator=(Policy&& other) noexcept; - - TString ToString() const; - - Permission permissions; - Principal principals; - }; - - Rbac() = default; - Rbac(Rbac::Action action, std::map<TString, Policy> policies); - - Rbac(Rbac&& other) noexcept; - Rbac& operator=(Rbac&& other) noexcept; - - TString ToString() const; - - Action action; - std::map<TString, Policy> policies; -}; - -} // namespace grpc_core - -#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_POLICY_H */ diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/rbac_translator.h b/contrib/libs/grpc/src/core/lib/security/authorization/rbac_translator.h deleted file mode 100644 index ab687859ab..0000000000 --- a/contrib/libs/grpc/src/core/lib/security/authorization/rbac_translator.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_TRANSLATOR_H -#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_TRANSLATOR_H - -#include <grpc/support/port_platform.h> - -#include "y_absl/status/statusor.h" - -#include "src/core/lib/json/json.h" -#include "src/core/lib/security/authorization/rbac_policy.h" - -namespace grpc_core { - -struct RbacPolicies { - Rbac deny_policy; - Rbac allow_policy; -}; - -// Translates SDK authorization policy to Envoy RBAC policies. Returns error on -// failure. -// authz_policy: Authorization Policy string in JSON format. -y_absl::StatusOr<RbacPolicies> GenerateRbacPolicies( - y_absl::string_view authz_policy); - -} // namespace grpc_core - -#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_TRANSLATOR_H */ diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/altscontext.proto b/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/altscontext.proto deleted file mode 100644 index 9a1dad5f56..0000000000 --- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/altscontext.proto +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2018 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -import "transport_security_common.proto"; - -package grpc.gcp; - -option java_package = "io.grpc.alts.internal"; - -message AltsContext { - // The application protocol negotiated for this connection. - string application_protocol = 1; - - // The record protocol negotiated for this connection. - string record_protocol = 2; - - // The security level of the created secure channel. - SecurityLevel security_level = 3; - - // The peer service account. - string peer_service_account = 4; - - // The local service account. - string local_service_account = 5; - - // The RPC protocol versions supported by the peer. - RpcProtocolVersions peer_rpc_versions = 6; -} diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/handshaker.proto b/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/handshaker.proto deleted file mode 100644 index 84a4153b70..0000000000 --- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/handshaker.proto +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright 2018 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -import "transport_security_common.proto"; - -package grpc.gcp; - -option java_package = "io.grpc.alts.internal"; - -enum HandshakeProtocol { - // Default value. - HANDSHAKE_PROTOCOL_UNSPECIFIED = 0; - - // TLS handshake protocol. - TLS = 1; - - // Application Layer Transport Security handshake protocol. - ALTS = 2; -} - -enum NetworkProtocol { - NETWORK_PROTOCOL_UNSPECIFIED = 0; - TCP = 1; - UDP = 2; -} - -message Endpoint { - // IP address. It should contain an IPv4 or IPv6 string literal, e.g. - // "192.168.0.1" or "2001:db8::1". - string ip_address = 1; - - // Port number. - int32 port = 2; - - // Network protocol (e.g., TCP, UDP) associated with this endpoint. - NetworkProtocol protocol = 3; -} - -message Identity { - oneof identity_oneof { - // Service account of a connection endpoint. - string service_account = 1; - - // Hostname of a connection endpoint. - string hostname = 2; - } -} - -message StartClientHandshakeReq { - // Handshake security protocol requested by the client. - HandshakeProtocol handshake_security_protocol = 1; - - // The application protocols supported by the client, e.g., "h2" (for http2), - // "grpc". - repeated string application_protocols = 2; - - // The record protocols supported by the client, e.g., - // "ALTSRP_GCM_AES128". - repeated string record_protocols = 3; - - // (Optional) Describes which server identities are acceptable by the client. - // If target identities are provided and none of them matches the peer - // identity of the server, handshake will fail. - repeated Identity target_identities = 4; - - // (Optional) Application may specify a local identity. Otherwise, the - // handshaker chooses a default local identity. - Identity local_identity = 5; - - // (Optional) Local endpoint information of the connection to the server, - // such as local IP address, port number, and network protocol. - Endpoint local_endpoint = 6; - - // (Optional) Endpoint information of the remote server, such as IP address, - // port number, and network protocol. - Endpoint remote_endpoint = 7; - - // (Optional) If target name is provided, a secure naming check is performed - // to verify that the peer authenticated identity is indeed authorized to run - // the target name. - string target_name = 8; - - // (Optional) RPC protocol versions supported by the client. - RpcProtocolVersions rpc_versions = 9; -} - -message ServerHandshakeParameters { - // The record protocols supported by the server, e.g., - // "ALTSRP_GCM_AES128". - repeated string record_protocols = 1; - - // (Optional) A list of local identities supported by the server, if - // specified. Otherwise, the handshaker chooses a default local identity. - repeated Identity local_identities = 2; -} - -message StartServerHandshakeReq { - // The application protocols supported by the server, e.g., "h2" (for http2), - // "grpc". - repeated string application_protocols = 1; - - // Handshake parameters (record protocols and local identities supported by - // the server) mapped by the handshake protocol. Each handshake security - // protocol (e.g., TLS or ALTS) has its own set of record protocols and local - // identities. Since protobuf does not support enum as key to the map, the key - // to handshake_parameters is the integer value of HandshakeProtocol enum. - map<int32, ServerHandshakeParameters> handshake_parameters = 2; - - // Bytes in out_frames returned from the peer's HandshakerResp. It is possible - // that the peer's out_frames are split into multiple HandshakReq messages. - bytes in_bytes = 3; - - // (Optional) Local endpoint information of the connection to the client, - // such as local IP address, port number, and network protocol. - Endpoint local_endpoint = 4; - - // (Optional) Endpoint information of the remote client, such as IP address, - // port number, and network protocol. - Endpoint remote_endpoint = 5; - - // (Optional) RPC protocol versions supported by the server. - RpcProtocolVersions rpc_versions = 6; -} - -message NextHandshakeMessageReq { - // Bytes in out_frames returned from the peer's HandshakerResp. It is possible - // that the peer's out_frames are split into multiple NextHandshakerMessageReq - // messages. - bytes in_bytes = 1; -} - -message HandshakerReq { - oneof req_oneof { - // The start client handshake request message. - StartClientHandshakeReq client_start = 1; - - // The start server handshake request message. - StartServerHandshakeReq server_start = 2; - - // The next handshake request message. - NextHandshakeMessageReq next = 3; - } -} - -message HandshakerResult { - // The application protocol negotiated for this connection. - string application_protocol = 1; - - // The record protocol negotiated for this connection. - string record_protocol = 2; - - // Cryptographic key data. The key data may be more than the key length - // required for the record protocol, thus the client of the handshaker - // service needs to truncate the key data into the right key length. - bytes key_data = 3; - - // The authenticated identity of the peer. - Identity peer_identity = 4; - - // The local identity used in the handshake. - Identity local_identity = 5; - - // Indicate whether the handshaker service client should keep the channel - // between the handshaker service open, e.g., in order to handle - // post-handshake messages in the future. - bool keep_channel_open = 6; - - // The RPC protocol versions supported by the peer. - RpcProtocolVersions peer_rpc_versions = 7; -} - -message HandshakerStatus { - // The status code. This could be the gRPC status code. - uint32 code = 1; - - // The status details. - string details = 2; -} - -message HandshakerResp { - // Frames to be given to the peer for the NextHandshakeMessageReq. May be - // empty if no out_frames have to be sent to the peer or if in_bytes in the - // HandshakerReq are incomplete. All the non-empty out frames must be sent to - // the peer even if the handshaker status is not OK as these frames may - // contain the alert frames. - bytes out_frames = 1; - - // Number of bytes in the in_bytes consumed by the handshaker. It is possible - // that part of in_bytes in HandshakerReq was unrelated to the handshake - // process. - uint32 bytes_consumed = 2; - - // This is set iff the handshake was successful. out_frames may still be set - // to frames that needs to be forwarded to the peer. - HandshakerResult result = 3; - - // Status of the handshaker. - HandshakerStatus status = 4; -} - -service HandshakerService { - // Handshaker service accepts a stream of handshaker request, returning a - // stream of handshaker response. Client is expected to send exactly one - // message with either client_start or server_start followed by one or more - // messages with next. Each time client sends a request, the handshaker - // service expects to respond. Client does not have to wait for service's - // response before sending next request. - rpc DoHandshake(stream HandshakerReq) - returns (stream HandshakerResp) { - } -} diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/transport_security_common.proto b/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/transport_security_common.proto deleted file mode 100644 index d0f861e644..0000000000 --- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/transport_security_common.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package grpc.gcp; - -option java_package = "io.grpc.alts.internal"; - -// The security level of the created channel. The list is sorted in increasing -// level of security. This order must always be maintained. -enum SecurityLevel { - SECURITY_NONE = 0; - INTEGRITY_ONLY = 1; - INTEGRITY_AND_PRIVACY = 2; -} - -// Max and min supported RPC protocol versions. -message RpcProtocolVersions { - // RPC version contains a major version and a minor version. - message Version { - uint32 major = 1; - uint32 minor = 2; - } - // Maximum supported RPC version. - Version max_rpc_version = 1; - // Minimum supported RPC version. - Version min_rpc_version = 2; -} diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/BUILD b/contrib/libs/grpc/src/core/tsi/test_creds/BUILD deleted file mode 100644 index 1ff24718ec..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/BUILD +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -licenses(["notice"]) - -exports_files([ - "ca.pem", - "server1.key", - "server1.pem", - "server0.key", - "server0.pem", - "client.key", - "client.pem", - "badserver.key", - "badserver.pem", - "badclient.key", - "badclient.pem", - "multi-domain.key", - "multi-domain.pem", -]) diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/badclient.key b/contrib/libs/grpc/src/core/tsi/test_creds/badclient.key deleted file mode 100644 index 6cd102b830..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/badclient.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDvdzKDTYvRgjBO -UOrzDwkAZGwNFHHlMYyMGI5tItj3tCzXkbpM0uz3ZjHVahu+eYc+KvYApM64F2dB -b16hs713FCk8mihYABjnSndrQsl/U2v8YFT7DipfLReqqaOGu2o9HdvWfiUlaiC/ -UGGfR+YblpK7CG+7/hvTXtUsMw+OppoeH9z87rhOJMxtiC7XwU5rhEmab/1f1XM/ -nLoZrfDAcTbDywoeu826SJ3mifajq7oK3LDdNLjWZwfEsCO1qp2C4gLvBlOOKsWO -LNby6ByxCOPlCTa0UCaVuoNclYol71jyi17KW+Nk0nNe9yaVcyr6H0z3bImfJhbS -u4rzI93nAgMBAAECggEBAOIPOJRTpGaH7GpCYUpLK0g/hPFkF5EyEWg/1lSYzRIp -+RsX6zOS+zkiNHEv1jkeKNo7XDiHXM7U6RkQtdkZAQdk9PjM3sEUdm4CEnIjfmzA -p/R8TD0kxkNLIkhuFH2gd05y3ZHDS/XiFkAE9eOT0FrC7om6ESD7ZfFIWR18pncW -ZGq7tFAZZRmpkum2D+MJy1gWxIXBxt5madTEpRxQd56toEnfx372F0y4zkcX3pnE -4H6FaJUBjdvKl2QzF5c0jBqgxMRvWP5YfNu8+dmaQORPkpzSptOPmZM9VKV+tJVS -1xnOI6DtrnNZRojegR/E6KhNyiPTYy97UgYzdKS+SSECgYEA+wgSIqrfkeqqotJx -cGxF4x9v/ldKr5hlhJNoKXLkepkcrvhhxfHKgjWz1nZY/+Rpg42GFMvxWRrGTMIJ -ddiOr24p0HCkusWRMKQL7XxvuHDq0ro8SGqXzqWGuH31R+YNP8dy2pqd3OlwzTgg -8v0wwzx8AuyP5Ys4M20Ewv7Xuy0CgYEA9DSGMU8jmjxJ/uPDCXWOEAqtE78wTtIw -uMBv+ge0inc37xf+fN6D/ziTrJvgw/XyT15pmQdOlXx3Sg1h9XBZeIlaeCdFWrFB -oYrVsiuoXRswfkFwA0yOkCsHyGiI4TE0W1rGbqP158IjwXPczBswWI7i/D6LpINL -BD7YYpfHmeMCgYB08AiKr7Cf54H/gSqo5TcVGzLvdzhqXgKEZKp0DHpUhfivpTLe -o8jjKSMSN2U0JvHj/0xDadGO4YMYhJcll3C4VggSejaybpA46WJJCdt9PtSUv36P -eWAoOkFstfhJuufXGxDstnPtUa1jW881gi5x9D4MmqhZlKXkhtdeApr6LQKBgQDd -ItsJt9JTjpirGfC5lhwI5sIICa9jEO9RveEoluWkJYUfG6k1xgHdkYwYWCdXDFZa -DPKuwnEk6MrU4f181joO7sJf35/sGmuGL0SHzQTvGvn0uqkGM8M9RdoMXqzkzzvM -Jg1ej1bUgXcDbTnaEhzbdLiTFsg5NzMtKwOjdDIpZQKBgEIHeJIqiGjYgf7mUlX2 -vNWgFNlzApkFSCQ8TkzkDOjtCdSHfdRDJ6+q8cS2TSQ7QPoAlI1woS0G48TNbVSo -wD0jNVRTdpA6R5FPsg09ohB/caSn0zlGVha2GS08ceYrn7nn4PSZ/UIYTm3pjUlV -H5tvHv0gG2C5vy3tIYQtSQCk ------END PRIVATE KEY----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/badclient.pem b/contrib/libs/grpc/src/core/tsi/test_creds/badclient.pem deleted file mode 100644 index 345da3932d..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/badclient.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDszCCApugAwIBAgIUONWbkUn1obHCw9L7lMNEE5REvb8wDQYJKoZIhvcNAQEL -BQAwaTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEiMCAGA1UEAwwZYmFkY2xpZW50LnRl -c3QuZ29vZ2xlLmNvbTAeFw0yMDAzMTcxNzQzMjNaFw0zMDAzMTUxNzQzMjNaMGkx -CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl -cm5ldCBXaWRnaXRzIFB0eSBMdGQxIjAgBgNVBAMMGWJhZGNsaWVudC50ZXN0Lmdv -b2dsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvdzKDTYvR -gjBOUOrzDwkAZGwNFHHlMYyMGI5tItj3tCzXkbpM0uz3ZjHVahu+eYc+KvYApM64 -F2dBb16hs713FCk8mihYABjnSndrQsl/U2v8YFT7DipfLReqqaOGu2o9HdvWfiUl -aiC/UGGfR+YblpK7CG+7/hvTXtUsMw+OppoeH9z87rhOJMxtiC7XwU5rhEmab/1f -1XM/nLoZrfDAcTbDywoeu826SJ3mifajq7oK3LDdNLjWZwfEsCO1qp2C4gLvBlOO -KsWOLNby6ByxCOPlCTa0UCaVuoNclYol71jyi17KW+Nk0nNe9yaVcyr6H0z3bImf -JhbSu4rzI93nAgMBAAGjUzBRMB0GA1UdDgQWBBTKJskEYd2ndrwihPTg2PzYF/kP -gzAfBgNVHSMEGDAWgBTKJskEYd2ndrwihPTg2PzYF/kPgzAPBgNVHRMBAf8EBTAD -AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBoGwWR0pLM1icX4bIJ6yduFU/A4jSiqET6 -gvJhwgErilqTKfH6Y89rqtzW8k4UurAOCsE4FA6wbkHWwrUMnClY4lkHJh+MuNaJ -nCGrK8wRKGb/mqW9d5pP72Et1Q6OW6DAKqGfjDWh2MzSPHBxcCLeyigO1wqd4W1T -nvvql6l4L+B5IT/c+/EHO3PwbI9v6MGTtLjsZgkRKItaPh+YeJdmBYhRD1BvWb6s -VwEb7aQ1oSF+esUvMmjGVuHXuQvWJahnjYdYT2DikyqR+AwaKzre4GJMHsX3/Cf8 -qdxyI+B1jUwNr7sLA2EYDjnUR0jEHcrOBSpIQyRMGWduj0P16yb9 ------END CERTIFICATE----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/badserver.key b/contrib/libs/grpc/src/core/tsi/test_creds/badserver.key deleted file mode 100644 index 1f5a31666c..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/badserver.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDRY2Z886nT6KF4 -tjgJTX0l1M4j8bQp+jKfXz+hwUZbn/PnCXJlu/5denpyu4XrLxr6Ix4Il97SrKfQ -iGaSZQ8hcq6WQdEDfuo/U7R/dk6lYG7q+yg7+xHm02DzVdPLp09kLhU+fWH3Wek0 -9GCk9iC1/sVTIomBYpar61Ris04iA1QveR+LZKNkQ8rL2i191Djs8cdrn9yhWdfJ -Ai89lLl6S6d8cXru1LwtEe0ejctnKf6ANqMnmyWTbHV8h0Cc3fbAnx92HsWDMJKe -8mI0CClauxrlagMHyw10NuFb9/MBEkFPJfxcUyW6F45LmqGHVfcxx6/BU7XRbWx8 -aQM/pt2LAgMBAAECggEBAKWpei3D7op9FDvYF0+s4iXrT0j682r+y8xx5HtK2iql -y6fwPnUlHqPAwl5B5TtkonhjDmEIH0AZYBBJyrVqhWUWQfEZk4+rexOtWzI5XRHU -0QzSt0t1Yf15IcyEDDSlY9fD6gTt2HOFzE+cRVZecRTsxBv5SEd4w/KzFqmcaWXY -Q7mLvCs6eQ55LBQ6EMweZ3XE57qPf71oV8Ckxv/jstLlkE+3JICgEAaiOEzi7oCm -hYbkoU2VNewx5EA5ka52DQzbVYYYuDbjqtVPXCmlVdejBBmUCAlhdjAIDBYq/RMf -sVMagAo19Wt5lYuNGD9qzMUmzZPaVmkg4yUmU8EYFVkCgYEA8Tyup/0yx+/tp8KQ -cLyGc4RDUTfabL8mlvxcbEge9fQ12aHE3cA/hkHCI7AZxwrHYwb1hxzLaOmKYfFC -oLxfzx81p5BO0lQWcKiFZ6ISiku4TPdmBaauKKxd62kFUPO4Q6Zk1MFHMXrvZUxZ -BsK058HZ5JALDdQ5wBfJE5P58rcCgYEA3jPDMiXsH1s5gM/bh0s+cC1AFSst6YM3 -rRPmHrqJJhKgU6gSB0d0LCUdj4/NkQT/Bw8DrfxLIqytsfRLKCx85K6lk8GfCk6T -1OhPKRp8bgg6WDQiJfJMokJN5zrnC02ns1cVdQSPY8bFxB++tv3du6DKLYx0e46D -Q9ojYqWHh80CgYEA0Shh7nkTrFKUZZ3GClkK4eFNVH/uu9bIKKTJpYCqh2mjvvwJ -apKjAU7GepbW4sKvuWZxPyJyIpZKSz0ZHa/2CejvZkcycB5EDo2ujPnyxUF9nA3s -wP2RhuZb0B4QY+3MV6tPRUAG8Bm8ssGNdtUecMqclxVk4Cqfn7N/vZ/RWOUCgYAL -i2rv1xKOioHRVHtWay1iTKeQsf6frEafQnJpVE294afc0NWm9SpvBLqlc9Y9W6IY -bspFJt+MfKZFoaip/K28f+pwY9XshiqeHDfIreybFuhZHtRLXmxm3cUIZ4ILj0xQ -QA0IWGVOzMwHpZKWFViI4BDBDxQaO0xMoS/Hd0w0XQKBgF5uZXXrNLmCeU6oco1R -gjGJE4gRwaSVcVJbs/VLbBmHT1VhBGsiluBuTpbmzDfyHWHJprnthlSTgqHXSax1 -6GvHZ2NHBqmD2uxEGuwBffzhwWVxHpgSrRgvnnaeIph2Iv92/ATN5LCc5vF+SNGx -2kKWYTDSRu9q1xHpXcax+nmJ ------END PRIVATE KEY----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/badserver.pem b/contrib/libs/grpc/src/core/tsi/test_creds/badserver.pem deleted file mode 100644 index 217dd640eb..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/badserver.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDszCCApugAwIBAgIULEum14ranwlUZjuZchSWaHtj8Z4wDQYJKoZIhvcNAQEL -BQAwaTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEiMCAGA1UEAwwZYmFkc2VydmVyLnRl -c3QuZ29vZ2xlLmNvbTAeFw0yMDAzMTcxNzE5NTRaFw0zMDAzMTUxNzE5NTRaMGkx -CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl -cm5ldCBXaWRnaXRzIFB0eSBMdGQxIjAgBgNVBAMMGWJhZHNlcnZlci50ZXN0Lmdv -b2dsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRY2Z886nT -6KF4tjgJTX0l1M4j8bQp+jKfXz+hwUZbn/PnCXJlu/5denpyu4XrLxr6Ix4Il97S -rKfQiGaSZQ8hcq6WQdEDfuo/U7R/dk6lYG7q+yg7+xHm02DzVdPLp09kLhU+fWH3 -Wek09GCk9iC1/sVTIomBYpar61Ris04iA1QveR+LZKNkQ8rL2i191Djs8cdrn9yh -WdfJAi89lLl6S6d8cXru1LwtEe0ejctnKf6ANqMnmyWTbHV8h0Cc3fbAnx92HsWD -MJKe8mI0CClauxrlagMHyw10NuFb9/MBEkFPJfxcUyW6F45LmqGHVfcxx6/BU7XR -bWx8aQM/pt2LAgMBAAGjUzBRMB0GA1UdDgQWBBTYP9Av5QoPxsDRE33wQedENOke -wDAfBgNVHSMEGDAWgBTYP9Av5QoPxsDRE33wQedENOkewDAPBgNVHRMBAf8EBTAD -AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCXA/Ewb5laDDxJi4YJxnmqQsb4WSsm65Hj -MX21Ii2vzf4XZ+i8c9xBezCae85Bkhtb/oMC/V15DshjVkkJNmdQfAlYD1NASSrN -hTaiQ4AfXWjO7H8o2B/rneZtA21NDCwvFxTXeJzAVnBkpIePR//KmuHjtCMjsrtP -ovckcTRGmhWJJ9sRx4HCsJXygBvnCIIIYC585aU4+nE53UDNT2T+Bd4b1vPmwf9R -9XgbyN6AhQ+0F11zlnftwsJ23nbnXqX/fpG/YZuhnPwaUILRodc6HZQtf/8xpRcA -0dKMdnL2YtBjuL5QFJMLT0mdsmnXj3h/oK8894nYBZYSmlb3bzZK ------END CERTIFICATE----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/ca-openssl.cnf b/contrib/libs/grpc/src/core/tsi/test_creds/ca-openssl.cnf deleted file mode 100644 index e97b945e4b..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/ca-openssl.cnf +++ /dev/null @@ -1,17 +0,0 @@ -[req] -distinguished_name = req_distinguished_name -req_extensions = v3_req - -[req_distinguished_name] -countryName = Country Name (2 letter code) -countryName_default = AU -stateOrProvinceName = State or Province Name (full name) -stateOrProvinceName_default = Some-State -organizationName = Organization Name (eg, company) -organizationName_default = Internet Widgits Pty Ltd -commonName = Common Name (eg, YOUR name) -commonName_default = testca - -[v3_req] -basicConstraints = CA:true -keyUsage = critical, keyCertSign diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/ca.key b/contrib/libs/grpc/src/core/tsi/test_creds/ca.key deleted file mode 100644 index 03be0bfa6e..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwYvShd+UXQvOg -z4GH6pRT3KGrPDbDw45fma7+I0LJQ4GupoeLuYYfHvcYPTV2I3MLO+VxCp00gfo1 -BIvsNOkGNxrrqNhP27ve9l7YwOuvWdVu4u9+73znRx3GJQ4ie/nF/z6xMcbQL5r5 -UC8yGwuJGOyr6VcpEnKTnORtuwRPJuqnGgn4rsKhLLfJz+RAhjdOKnAS3CQo/iHP -KjoqIZ38M97GJ7icFQic3dtLUFR41nnN5ogLZ6DduR55btypPnlv5h6foLFjRMST -MEroAq39ZSJqUoyBPTBtPFFk7uRQIfdKrp7/Bd4V0n4e91Us+UCDlOcxo2lF1CKH -/ydEWmx3AgMBAAECggEAKrDosKQKKKUlvkg6+6CFIf8GiiFax+ru7KiPuCbkpT3X -h2P67pCKq8Gc4Jr/84YE9DUdBU0iW3ESE/7ztsnflIeF1n/ZSwrN39sVfbTD1n8R -r3LxsHFac8e8pxaU4zfKbmemztBTZFQBWFJV+fSdyCLmNX2WgPRcEuooR366PkWv -xZLAxeDGqpnsa62o1GdGmalxx8aljLN/QcbQi73mR9Osim1OtSd1cyDlZ/8x6OoV -Ae5GDN3Bj0hO9ZKzNWTbQpRw9SHKU6sWXtHlcDx4xi5kN/n9aptn7kixbY9y8uOM -5zjErVGWvxdP94IvlSkrkenwnIjlHBtdlAjVuCFioQKBgQDoJLyfHNWPBnjPGVnK -xcbIIwmf4C9UnZBbHRD3YxU/GBpsPgPh9EwhQTAXlGQGHeuslxCIh4cEfbOIrJ9b -/s3OqeL9CSUaz/N+1av1ZuwOI9CEvNPi51IK+rXNRmVJG8pG6RaKNx57pXaFtmqq -FUtC7twbPECvjspapn61nZYSiQKBgQDCg1tpGwZJJOCIkhYH4wFc4j4p0LxIcBJ2 -E3L9VnQ+APT/x8uitkZsuRY9tmWcHK8/zWTc1GpFdwGUJ9+Yzvprtej+P/buxM9J -Y6ZJZdCIHWDuh3eq+sXS4lwr5fi7ir5m97npG1bXPlOoYIJ7p172EyoNmurRIgiP -LWnzK0jG/wKBgQCRQtOouNFFcyZLaTCPutxdRddy7ESRrRq0eOax9pVH6tw12URy -snyk3naqepdwYG6li82zsSKig8nA/0uktDeyVwoLjhpiwbc7KZc1sxaI7o4/US1B -McBb0G/MqH0elz4myxnomP8BHhOhLflmvnZexrqCbFyJvk8PFFn7aUWMCQKBgDvX -9BCzOszYJqh94X9NrQapqJxu1u6mZFelhjRBHARTgQ0MqC8IS0R58UjNTBeqj5Re -mdCDHar/gSHW3qkBzPPEhMlsXol5TZjzqp5cT7sA5uicDwowmxpVgCwVVeBFQG0n -fDAmtCIGz/A2uQ5YIRQuMzr6VZJAGUgLndQtlfd7AoGBAMq1imggFKd1rt49XCnO -t97lpWOT+TlWYblHr01tOw+esawG5MFucqVI6tGpBSccTRQw6orWf4GK3KmkgQ6J -UgHKjwYsA0sf4U5vppkdkbAbM/WwUPOTQpGFRERyJqMqFGIc4wMtZOJBxXwf+9iD -l8tvan8w/6HugqnI7qqkTgLq ------END PRIVATE KEY----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/ca.pem b/contrib/libs/grpc/src/core/tsi/test_creds/ca.pem deleted file mode 100644 index 49d39cd8ed..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/ca.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDWjCCAkKgAwIBAgIUWrP0VvHcy+LP6UuYNtiL9gBhD5owDQYJKoZIhvcNAQEL -BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw -MDMxNzE4NTk1MVoXDTMwMDMxNTE4NTk1MVowVjELMAkGA1UEBhMCQVUxEzARBgNV -BAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0 -ZDEPMA0GA1UEAwwGdGVzdGNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAsGL0oXflF0LzoM+Bh+qUU9yhqzw2w8OOX5mu/iNCyUOBrqaHi7mGHx73GD01 -diNzCzvlcQqdNIH6NQSL7DTpBjca66jYT9u73vZe2MDrr1nVbuLvfu9850cdxiUO -Inv5xf8+sTHG0C+a+VAvMhsLiRjsq+lXKRJyk5zkbbsETybqpxoJ+K7CoSy3yc/k -QIY3TipwEtwkKP4hzyo6KiGd/DPexie4nBUInN3bS1BUeNZ5zeaIC2eg3bkeeW7c -qT55b+Yen6CxY0TEkzBK6AKt/WUialKMgT0wbTxRZO7kUCH3Sq6e/wXeFdJ+HvdV -LPlAg5TnMaNpRdQih/8nRFpsdwIDAQABoyAwHjAMBgNVHRMEBTADAQH/MA4GA1Ud -DwEB/wQEAwICBDANBgkqhkiG9w0BAQsFAAOCAQEAkTrKZjBrJXHps/HrjNCFPb5a -THuGPCSsepe1wkKdSp1h4HGRpLoCgcLysCJ5hZhRpHkRihhef+rFHEe60UePQO3S -CVTtdJB4CYWpcNyXOdqefrbJW5QNljxgi6Fhvs7JJkBqdXIkWXtFk2eRgOIP2Eo9 -/OHQHlYnwZFrk6sp4wPyR+A95S0toZBcyDVz7u+hOW0pGK3wviOe9lvRgj/H3Pwt -bewb0l+MhRig0/DVHamyVxrDRbqInU1/GTNCwcZkXKYFWSf92U+kIcTth24Q1gcw -eZiLl5FfrWokUNytFElXob0V0a5/kbhiLc3yWmvWqHTpqCALbVyF+rKJo2f5Kw== ------END CERTIFICATE----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/client.key b/contrib/libs/grpc/src/core/tsi/test_creds/client.key deleted file mode 100644 index 349b40033d..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/client.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCyqYRp+DXVp72N -FbQH8hdhTZLycZXOlJhmMsrJmrjn2p7pI/8mTZ/0FC+SGWBGZV+ELiHrmCX5zfaI -Lr9Iuw7Ghr3Vzoefi8r62rLupVPNi/qdqyjWk2dECHC9Z3+Ag3KzKTyerXWjKcvy -KVmM0ZxE0RXhDW/RoQbqZsU2GKg1B2rhUU8KN0gVmKn0rJHOxzRVSYeYLYp5Yn7K -rtPJcKyo9aVuEr7dGANzpyF6lg/nYBWc+9SGwkoLdFvKvABYJMyrbNhHUQfv0fza -Z0P86dfTENrDxzALrzGnqcx3KTrwJjkZ/aSr1tyD0/tXvukRFiPxWBJhjHQ70GqT -FQY19RbhAgMBAAECggEAIL8JUhL4awyvpWhQ8xPgTSlWwbEn8BE0TacJnCILuhNM -BRdf8LlRk/8PKQwVpVF3TFbYSMI+U6b4hMVssfv3HVQc/083dHq+3XOwUCVlUstR -SAzTE2E5EDMr1stdh0SQhV4Nilfos9s5Uk1Z6IGSztoz1GgOErIc/mGPy/aA/hbr -fRWHvTp35+MbCJSvZuOeevX2iLs0dNzqdk6DiOWIH/BVGirVPtO6ykrkuTj1FWiN -hyZ3MBChShlNH2poNX46ntOc7nEus0qteOgxBK8lummFEtlehCA7hd/8xuvYlP0k -7aN684LCRDajmAGpoZO57NSDYQhAFGZeUZ93SMFucQKBgQDe7GGkzZFEiv91u1q9 -lgMy1h5dZjIZKgQaOarPC6wCQMUdqCf6cSLsAPr4T8EDoWsnY7dSnrTZ6YCIFL1T -idg8M3BQXipICCJkFORS76pKKZ0wMn3/NgkSepsmNct91WHr6okvx4tOaoRCtdzU -g7jt4Mr3sfLCiZtqTQyySdMUEwKBgQDNK+ZFKL0XhkWZP+PGKjWG8LWpPiK3d78/ -wYBFXzSTGlkr6FvRmYtZeNwXWRYLB4UxZ9At4hbJVEdi/2dITOz/sehVDyCAjjs3 -gycsc3UJqiZbcw5XKhI5TWBuWxkKENdbMSayogVbp2aSYoRblH764//t0ACmbfTW -KUQRQPB/uwKBgQC5QjjjfPL8w4cJkGoYpFKELO2PMR7xSrmeEc6hwlFwjeNCgjy3 -JM6g0y++rIj7O2qRkY0IXFxvvF3UuWedxTCu1xC/uYHp2ti506LsScB7YZoAM/YB -4iYn9Tx6xLoYGP0H0iGwU2SyBlNkHT8oXU+SYP5MWtYkVbeS3/VtNWz1gQKBgQCA -6Nk4kN0mH7YxEKRzSOfyzeDF4oV7kuB2FYUbkTL+TirC3K58JiYY5Egc31trOKFm -Jlz1xz0b6DkmKWTiV3r9OPHKJ8P7IeJxAZWmZzCdDuwkv0i+WW+z0zsIe3JjEavN -3zb6O7R0HtziksWoqMeTqZeO+wa9iw6vVKQw1wWEqwKBgFHfahFs0DZ5cUTpGpBt -F/AQG7ukgipB6N6AkB9kDbgCs1FLgd199MQrEncug5hfpq8QerbyMatmA+GXoGMb -7vztKEH85yzp4n02FNL6H7xL4VVILvyZHdolmiORJ4qT2hZnl8pEQ2TYuF4RlHUd -nSwXX+2o0J/nF85fm4AwWKAc ------END PRIVATE KEY----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/client.pem b/contrib/libs/grpc/src/core/tsi/test_creds/client.pem deleted file mode 100644 index 8815875f32..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/client.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDNzCCAh8CFGyX00RCepOv/qCJ1oVdTtY92U83MA0GCSqGSIb3DQEBCwUAMFYx -CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl -cm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnRlc3RjYTAeFw0yMDAzMTgw -MTA2MTBaFw0zMDAzMTYwMTA2MTBaMFoxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApT -b21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEzAR -BgNVBAMMCnRlc3RjbGllbnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQCyqYRp+DXVp72NFbQH8hdhTZLycZXOlJhmMsrJmrjn2p7pI/8mTZ/0FC+SGWBG -ZV+ELiHrmCX5zfaILr9Iuw7Ghr3Vzoefi8r62rLupVPNi/qdqyjWk2dECHC9Z3+A -g3KzKTyerXWjKcvyKVmM0ZxE0RXhDW/RoQbqZsU2GKg1B2rhUU8KN0gVmKn0rJHO -xzRVSYeYLYp5Yn7KrtPJcKyo9aVuEr7dGANzpyF6lg/nYBWc+9SGwkoLdFvKvABY -JMyrbNhHUQfv0fzaZ0P86dfTENrDxzALrzGnqcx3KTrwJjkZ/aSr1tyD0/tXvukR -FiPxWBJhjHQ70GqTFQY19RbhAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFXCewK8 -cWT+zWxXyGFnouFSBzTi0BMBJRrhsiNoiQxkqityJHWFExiQZie+7CA+EabXCQUB -+JwMSWM29j3mSw10DTfmC3rhheQqGxy304BZyUpdpvI2dt3p/mcsE7O+p4sQrSep -gijiDssKAfxTAmUM93N6+Q8yJK5immxlbeYfijoBvmkzyB/B+qNRPsx0n7aFGnfv -oWfkW296iPhWLiwknpC3xB6oK3vRbK4Zj1OaGb0grK7VN8EyhBix2xVF61i4dzCK -kMIpl7CUpw1Mb2z8q3F2bHBS7iF7g1Ccn5VGcO+aJ+6PWydaeqJ6VEBF0Nwv9woe -mL5AluNRLaqjZvE= ------END CERTIFICATE----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/client1.key b/contrib/libs/grpc/src/core/tsi/test_creds/client1.key deleted file mode 100644 index c37df79f31..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/client1.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQD0d1XmFuS1iwBQ -wzGnGhA/ovsFp5jTF0v+aJptNKcwQzlMCkbpBtkVB2SFcsgWew0qtQH57E4iS8pe -gdW5JO6Jgl04aFuVDU2gKYRUB2pXQYObw9GZ6k8SyvDWfZIpTj+qCQ25zQ1/CzgD -b9FKPBPXaIuW8eiYZJwPoOlhBX+RxAfKt79/Ilj2V9JnWi5wH6kRKbfZYg/usKT/ -lfHtlxZ8TdORqVFncnMxoxPTEwLwbqYaUyW6x3kqoFjixdYDuEkOIVoHs/+SBp1H -fRKpfnyErQkd3YcjQm0JgjqCG4+hFNb2HfEUfCSeeWHhAD/S4r1s3sepCm71/huU -GmO7IV2VAgMBAAECggEARy/o55OLDgJoGRx9/Pbt/FntVvwy2GVUT8UOEvbeKIOq -z6W+eGTyGdmJQALomQNEFkeXR7u0FPCVAWg1YDCM9aXsl1xsLr8s95KfYgi2wqnl -NRqUkolUdVh7QTpXsYeDqnPwd0Zqw6/0o6uP+ln8PSHIZDAVVysU9sgYrZP4Te2B -0l5lmmBp8wRtKjZqhQPPuEhW3UETYRWK0QK3siVsnQJrH4k7Sys7AEnMP5NWewBC -R79DQL7eHPX19H/7vBY2cAI8e51yhcT2b+tK6oMn/Xg/sHelVs/uRmShSxwo0eya -Du9oXbV1h3DoIRP2rC1aXQ67sMJQvQvINV8jRgIHkQKBgQD9Mo2XrCWK9W+qFc67 -9MeKX8LG0pz7ORJnx7sORYfsIbfhD5/u22K9RuaHrPoLcjTNXKvQHR54fGJFevaL -h7X+MrXYxtgCIOQeebdHgkb//Px4VqUOoTOz3YfZ754M6S2x2Nf/eqvTSd1hjxKa -L4FHVe65/7ENmLiFTbmTMFNTtwKBgQD3LAq2b3q8CTEhF9CaFrSCHnyvKtQYtGzg -JE2ZfX5qAz6JlM/hOiVprRLEk/5g88519Q+odoPwzOFDSeWAhD7/tPA/OtLkqaSc -reB6Gytu//yVKyPJ0eIDFKbWMWeDEObSwZtEwUf78wcABm5SMuoKC3C2y/woOke3 -a3bb9LUREwKBgHU5YICmPMN3Gnm+mvY+P9v6tezjOba+F51gxWO4IVPb0Iwsdbla -bP6Awt5x4VpHR9cEXq99q8vQmpbcdSTocgP8amCwvvVNURAi/g3nbQO7lxAH3WdG -ju9pUyo9XAlSM8uxP1+S5dZuzkYKvWwRLmNej6YhkVFgMZ3V/GL+7rVFAoGAaQ0Q -6ITs9yo49UW35SWtRnhKqfBcALv+Yi1LxeauacRDOhpDWAhsikOC7IWx4eb9Yujq -5MCqRxfszbqEjmCmnet7CISpyYHIcsb71ynhBeZKpeOV7FsF4iVO205YHj56vCyJ -H2m+fHjICtyw2sLE8cv29dowq7BJds130PhqVH0CgYA3rlDMoCZiSKARwJr0/D6d -B3ez0ZpxKbIHHB7e+T5PFll607I+F+S6IpPfKab3CZQiG/5H/7WFXda1t+rkdayM -QKYvAk8Z8DdDDtdF6GygQq6kq5L54H8w+hcAhPA/AFvGM+59HBOkXlbF1ONmrH2D -btxOGV07JxZEj0IlBMYIaA== ------END PRIVATE KEY----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/client1.pem b/contrib/libs/grpc/src/core/tsi/test_creds/client1.pem deleted file mode 100644 index c616b310dd..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/client1.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDODCCAiACFDrXOoJ6yF2DsFledztcRyjY+3BcMA0GCSqGSIb3DQEBCwUAMFYx -CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl -cm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnRlc3RjYTAeFw0yMDEyMDEy -MzE2MTFaFw0zMDExMjkyMzE2MTFaMFsxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApT -b21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFDAS -BgNVBAMMC3Rlc3RjbGllbnQxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEA9HdV5hbktYsAUMMxpxoQP6L7BaeY0xdL/miabTSnMEM5TApG6QbZFQdkhXLI -FnsNKrUB+exOIkvKXoHVuSTuiYJdOGhblQ1NoCmEVAdqV0GDm8PRmepPEsrw1n2S -KU4/qgkNuc0Nfws4A2/RSjwT12iLlvHomGScD6DpYQV/kcQHyre/fyJY9lfSZ1ou -cB+pESm32WIP7rCk/5Xx7ZcWfE3TkalRZ3JzMaMT0xMC8G6mGlMlusd5KqBY4sXW -A7hJDiFaB7P/kgadR30SqX58hK0JHd2HI0JtCYI6ghuPoRTW9h3xFHwknnlh4QA/ -0uK9bN7HqQpu9f4blBpjuyFdlQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAbJTrl -e8OAQJMrB9utPrCemvV2xC3aK/jtKLOrJ/7n6Atf7Zd5cymfbK2XAGWUiUePvF06 -MlN5AJpN4ujQOB0y+UYS8y/58VGCC9UJnQLo5UATE8w5cAIq5j91vuW9roE/UU4x -jSZ5kjKOPjOpAjbKM5Dp4WVff9/veve+gA+nXA8Xv7Hn0vCLcjdRpFPEfvgp66qP -E+tpeRWOu6fggxtTlAK68HMkQqKpb6R+obMePzxiAAgGiy4o6RvsHLA0iuViqHuE -mu8cmPbEvWxwzTthkZEj2ekdLKecFN4ub4suZyAF85mz2SI7D0p4C8M46VIhWq6i -bBfU/DCPHpZpcVIl ------END CERTIFICATE----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/client2.key b/contrib/libs/grpc/src/core/tsi/test_creds/client2.key deleted file mode 100644 index 613c47ac9a..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/client2.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQClO55XKwBIEnTa -KeclFa6l3Bc3G4lMdDa+JdCi3x+5KYlBN9NJth5z7Pj6Nrv/bpm4g69qhVV2sIjJ -4XeEeObLY+0cadU58hdPXlhWHoMJst5uU+DkV0yjPwvLkmhsRj0RPicV+2qV6Scq -zQDqXMMx8jyhhExkZBeOz1xCGR4Abo1zdpNfusZJ3GsFGQwqxwdK/l4dIkyLqtxp -IS+vSsYeAMyuVZJHD61u7YiZasREyrFqkkSyDPGeCR3k6+4ajwfz1rVMITP5EZJ2 -pUdvdRgke7Okpwanf8og9LF5AaJz53yuUBVz40O/3whI7J4e+D3i5V5JGftLl0/V -xJDdHrU1AgMBAAECggEATQ701Wo0g2g4HtaT+fOWs7tlCEpLSeCY9yzjlFHClbQN -UuEaJLJOmXnW07pbCtEl16tyT5dHOEc0RBJmjt1jpU9A8ZNZ4eBJhrZVNDSeoBNP -MNzlcRhVoXxxn8rz8CsBp9z4lYPfPXKy1X8uAh6o2c5DAICWr+sOIYgLWrgkCcbF -QxP5cRs53nFwImnOJka7sxgUvQNW74Zto3WByCQ3QkFDQEOMEFPP2v5J0AiZTuIC -nFfB1/O2YByKOUjhA+7ZYX/3qSXRrC7VW4kaMl1fVABccUCWhPdc9u+xz+m2fWnQ -ZZXeTbgNbhykldz6J6JmKnDtIdj5WfdNTdLSDGgasQKBgQDTBwW/y7NT0r+IJEOF -hbxN2XtB+i2VDVoeS0TYpJFMZfufXkBc331jyQid/8yusPjYW31n5vHYopDydsde -NGAdCfjtBFawVGPYvbTgXSrB5n120merdHQ6TFmp7QhjHU5ds7N8ihh1OQfkBw/6 -UUaHVn3sBAKOLYbcCvGin7FuFwKBgQDIcjFmajYPHQ+yom8zn1bCvfgJ1aEXsP6m -PxHeP4JeBjaD1ukuq+LUGCgViDWCO8c/j1AcnrNihh2oP7brY+xEqpm6IfQI79KZ -kp++ybm4w6yvuYNnWR9yXJc0LTrTu4IOMuDpbPBFT9gGDLZYYc7yT8U55NGC3ry7 -tv0lZKQykwKBgQCjUf8IFj3etO+ZDP/Y+cznr1aulFHs1p2VbomE5bCyIQehqs9D -UZB4xuDNb2jZFoww3nXrERjBoeduT7Ey3nQ4ZTxrK31wEJAJ8aBoOJLb6GfXqzWi -w4kkiWynj5R7KPY6nNZfn30YVCAgQbsC7x4Xpj/khqH3qZKDAFFMnC001wKBgCTA -Sy5r6t16hpZKEfl1DYNHMWMcOB0P5qC0j6IgItb6bKRfkwFronsgsri/8I+gRjfx -Hs8gieNWk7l1dSRTfc5ZOTZXY1cAIazmpUNl2Rd3SQIvEVixjoJ5V3/Jiy+nAYF4 -8qPZxXPv37u8OPKbfEYROigTPBayoAgK1P82JKThAoGAJQ7aR+ItRUSOyD/ofZKB -wQeYSVnv+UQg6gTh4GWf91D4WYgBVCGWhPJ8zMRZfcy1/TplJC917MVnkLP7k91D -paxsSdRDVkSATGTX3bOTw2P9CbNFpRUIdz++7hmbhZjT/DBvtFYiRuaylGAuAdH7 -YzdO4ZLBuBW7jbDc7a2RHNg= ------END PRIVATE KEY----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/client2.pem b/contrib/libs/grpc/src/core/tsi/test_creds/client2.pem deleted file mode 100644 index 0565b1b136..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/client2.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDODCCAiACFBjjQkCIdrl6SU6uUtepyES0xVV2MA0GCSqGSIb3DQEBCwUAMFYx -CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl -cm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnRlc3RjYTAeFw0yMDEyMDIw -MTExNDNaFw0zMDExMzAwMTExNDNaMFsxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApT -b21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFDAS -BgNVBAMMC3Rlc3RjbGllbnQyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEApTueVysASBJ02innJRWupdwXNxuJTHQ2viXQot8fuSmJQTfTSbYec+z4+ja7 -/26ZuIOvaoVVdrCIyeF3hHjmy2PtHGnVOfIXT15YVh6DCbLeblPg5FdMoz8Ly5Jo -bEY9ET4nFftqleknKs0A6lzDMfI8oYRMZGQXjs9cQhkeAG6Nc3aTX7rGSdxrBRkM -KscHSv5eHSJMi6rcaSEvr0rGHgDMrlWSRw+tbu2ImWrERMqxapJEsgzxngkd5Ovu -Go8H89a1TCEz+RGSdqVHb3UYJHuzpKcGp3/KIPSxeQGic+d8rlAVc+NDv98ISOye -Hvg94uVeSRn7S5dP1cSQ3R61NQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQB4WZlD -CgvMA/LD3wJAG2v53IuG8rJ2R0QG3dKbN6hCKsqVfJpF51L55RB+ABn7FT3CAfqJ -w8IvisQ4vlr6dqxkGS7MPTou2H2LU6PARWPgqJnwRAB5gvjecHzDjKqhHlsQQXBw -PHFt54EcyWtX2xgQmP5acjCj8o03gC3+tWtaAQgM6CExgXB4PgeUGIgTH5c016aZ -YzxJgZS4UDfgA8+YVmzWNsGvgbITKu84hU2dqLCLoIqJPzwSikUVNS7Bo07o0hgH -NNSDLaMNpaMC51dDiHbtER8hPp9elhSWOZRPXgEGbvQCFOt/Wz79Mw2dnpbBXVdb -ANSsdO2Qu7snGMXr ------END CERTIFICATE----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf deleted file mode 100644 index 33ecc9d9b8..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf +++ /dev/null @@ -1,33 +0,0 @@ -[req] -distinguished_name = req_distinguished_name -req_extensions = v3_req - -[req_distinguished_name] -countryName = Country Name (2 letter code) -countryName_default = US -stateOrProvinceName = State or Province Name (full name) -stateOrProvinceName_default = CA -localityName = Locality Name (eg, city) -localityName_default = SF -organizationalUnitName = Organizational Unit Name (eg, section) -organizationalUnitName_default = Google -commonName = Common Name (CN) -commonName_default =xpigors -commonName_max = 64 - -[ v3_req ] -basicConstraints = CA:FALSE -keyUsage = nonRepudiation, digitalSignature, keyEncipherment -subjectAltName = @alt_names - -[alt_names] -DNS.1 = foo.test.domain.com -DNS.2 = bar.test.domain.com -URI.1 = https://foo.test.domain.com/test -URI.2 = https://bar.test.domain.com/test -URI.3 = spiffe://foo.com/bar/baz -email.1 = foo@test.domain.com -email.2 = bar@test.domain.com -IP.1 = 192.168.7.1 -IP.2 = 13::17 -RID.1 = 1.2.3.4 diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key deleted file mode 100644 index 2b9cce0bdb..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAg51YU8NkgC7w -Hx7Jf9Zj+wjHcLxedY6czsFjhl9wUlYRkQ+wdt3suH998TrbdVMc38tpI460pGk7 -gGBpMkbZgo1YNnwz/U1jAOR11EVGHN1QDy3H0BI2E5RYtl/vTWQLFo1khIaKK4eS -3ptrPd+1XB6L25E4ISOVgd3yn4b5eTMGRbEei+wrkZIyZAVgCIw8d6BHHwldWz3A -ljKRErMPzKtnyVL+ctp0Kx6ObppiBPPOWhNNTtMkmLgfeZQK3U7cPN5WI13Fso05 -FA3wVo/w6sXTtz4inIT14Y57E34V6sWZezrBbTtAI0yN3DqXSKTBgGjOQUbjqVxS -i/JzRbZpAgMBAAECggEAXJMt59qn3D1T1P5yFJ2X4A5Io3eP7bCEOt2l25EzddTy -NJJYRBh1Ea+LB2ooTn410G3B6DZEGpPxUr6iHhQiQ9hm1eOliG6ndxNnyU2hXlzl -A+m4rxxclYqGzL4ulenWUQqwRYUBGZJjKHpJrKFdYV4CBmk4hRBSh0OjElgqVO5g -nliMl3fC+GgUXtdMDGoPnC6MwD8q0RSJxbzpd8r+yREgX6KveEfPTfgSLAUieJrf -2qqEk0Prdrwzsu0iyDYCaWLOq0cUstnHCo3e5synV4VzAFnaqxMT7lCVuUHgFpHj -62rTwBCG/n3s+IVAp9CGBe37+SiJPRE8t5PDr65F3QKBgQDovkKLWzXxVJauTF/E -tFRA+HqNDzYC3yiN0MIBmcF7IntdwCHznMyqydkaSE6WYn+NKglbH3c4RD5Hmdxc -PUta8wgpmTg264568Svgna5jhwoqStrzh7qeBPXHmJvK4MkWALH4ukr3hIsWzsAh -881ebstQDke8uHzyNZBY/URebwKBgQDTwEP6hgcgDOaf9yzipeMhtsArIm7zXn+r -1RknpKUA8wM6fpEMpdUTgReu9tdJDgrcKac6imSZoNM6DBoOb/Hdj6FourHiTTvE -dXAOjAzkDz/c86HFuDNoz27usoMPu/3iJPwuLQSO0IlflccLuOirhnnY8yVxIuy2 -+9g+2iOkpwKBgE/Kin3EM2YdHdt7i4mgWRI9HaamhFnPr9OOsjRiRha0555odDtU -kkYrFScRiv+7nQcEVljLHNBJdSCO+yEUUnVHxJCeWstZTmuPqv9Cj7rHXRDKwO2k -prHt+WUISMDw9393lYw0MedRpW2YS/5X2xx413MGsklc5lkTS/12Nq45AoGAaVCf -vrL4Sj2AWqEhxtwAmlz9OLbYfdxLHVhQOYJOuqkiuu4GEEdOMXQsJk4IhwIf7p4c -2SXJoQr241DviKyum6Z6/c6U+Fu3VR+fiuym4Kqg9bCKjf7uOruojbllK+cw/0+r -yP+E287l9A9XPwJJXj30zi0oOxvGpb+eLqxpu9MCgYEAxIgVhzyfRvoAdNYk7FE7 -JDig38EGC4m9grh/9G0tMvWT/E+F1Hb5V9NDK/iWA25dD3hOASxza1Hqkt1dP5on -FMZrmP2T9Ov0wgfVuRIf8/c3YyiS1wJXb3wROVaJJDSvE5c2UszR5pfqvNE5C1YV -zpc3ITQSAX66LK6ImkHb9Jw= ------END PRIVATE KEY----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem deleted file mode 100644 index 727b8ff490..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEGzCCAwOgAwIBAgIUVwCmP2zKfeoWdaMbn32PjFgpdRswDQYJKoZIhvcNAQEL -BQAwSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEPMA0G -A1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMB4XDTIxMDQwOTE5MzgxOVoX -DTMxMDQwNzE5MzgxOVowSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYD -VQQHDAJTRjEPMA0GA1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwIOdWFPDZIAu8B8eyX/WY/sIx3C8 -XnWOnM7BY4ZfcFJWEZEPsHbd7Lh/ffE623VTHN/LaSOOtKRpO4BgaTJG2YKNWDZ8 -M/1NYwDkddRFRhzdUA8tx9ASNhOUWLZf701kCxaNZISGiiuHkt6baz3ftVwei9uR -OCEjlYHd8p+G+XkzBkWxHovsK5GSMmQFYAiMPHegRx8JXVs9wJYykRKzD8yrZ8lS -/nLadCsejm6aYgTzzloTTU7TJJi4H3mUCt1O3DzeViNdxbKNORQN8FaP8OrF07c+ -IpyE9eGOexN+FerFmXs6wW07QCNMjdw6l0ikwYBozkFG46lcUovyc0W2aQIDAQAB -o4H4MIH1MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgXgMIHaBgNVHREEgdIwgc+CE2Zv -by50ZXN0LmRvbWFpbi5jb22CE2Jhci50ZXN0LmRvbWFpbi5jb22GIGh0dHBzOi8v -Zm9vLnRlc3QuZG9tYWluLmNvbS90ZXN0hiBodHRwczovL2Jhci50ZXN0LmRvbWFp -bi5jb20vdGVzdIYYc3BpZmZlOi8vZm9vLmNvbS9iYXIvYmF6gRNmb29AdGVzdC5k -b21haW4uY29tgRNiYXJAdGVzdC5kb21haW4uY29thwTAqAcBhxAAEwAAAAAAAAAA -AAAAAAAXiAMqAwQwDQYJKoZIhvcNAQELBQADggEBAIHzi/MWANQDYqpNDGVA6HGg -vYPnwxjLXL/8apVf1ZMHzS/R6Eudu8ugppnnEL7Cjsd4oA0r/sJLjBvhaZtf0r4S -GguWdmai2RR1ghwkCLPF/HlCqiBKwUfWrjTxq8GOwwodhW7lk4hLPzhFRzh/I93g -uN5/ugPKcloWQ7X/0okMdkdPmk8uLpMckXNKj13Lupl/0BgDggghVXRTA2t0ujhx -TvRWfYi5H1eJtNcj824PaIDifPiSOpzeXZi+na2XzzVmCz5n/e2H4nlTMVcN6YGG -M3U3uJqjjjpKkCrrdNAJJpqqJpln4P6fVvO2ND1QmyE5YIKV3tZ8p38AJOheUcw= ------END CERTIFICATE----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/server0.key b/contrib/libs/grpc/src/core/tsi/test_creds/server0.key deleted file mode 100644 index 261097a87e..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/server0.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCei9aKutDNg2mr -COICW4hT6+LVJfI5J6DZ3yqb6MBzbc//VeUj1OCX/vt5vvPm1Qb5XNk1MOIFPEW6 -t2/0Mhj2VbQfjDe/PhZRhwu4PBtuoJBDeBsKkdnxD0I+4G0XRbeTtUsGMGBgWSAd -qHMD2HnEhgydRw0krYjZp4a/HMCnZZ1WFamw1PCvQK6AuWSSk4iHGaYklXUaKd3r -Rlkujr7//ihcvqweJ+OdaTwXD8z4P0YfFe/bkWWpuqIZz1Or/nxiNBtvWKlI8pR2 -K3wkoWsW+6bnFN8u81nstHDardR6zy3B7QXke02q4sddUERcwNFyPqpscetMpnhg -lhjrmnAXAgMBAAECggEAA6pB5GUbLJUMHUsQRnOtPBto2/qLleynmEHDb2U7BbAV -LdbjfCeQpZLcZ10VsFFeXudZkhQ2NV7GUeGpseBymUcz6cLJCx+5Tlsr1y90huMp -UpX1MhJbEmqC4oc3nmEbNEvtlxAJOlD1IBpjxkP71KIwqnYZBK8KSdXIlKRqg7QZ -VUgjA08TmWlZSxnOt1hpt2ZVjTOn7973YoTb4D7SZydMuVjTkwv9YjPFZOZ/wIP4 -JTZczY/bJjEF7QBYL/wtir/vNJlxxi+FunJdoO3blhf8li5QU0iPd/YsyBFBBWfF -vD7QslaB7wQ8zyWxWpPLiWeD83XGE+7CY2+8EpG3AQKBgQDMK6N7jDQCq9F7n+5B -R8YPDMdINpcVsN8bIeEVKSxYE86oADQg/0jPUct+4liUS1dv0DUmUP1U0zbvupX7 -NxE+gI8KFwCyq8nqZ1guW9oO00ZAGo4Rn0TIeoHWVgsE2tDqBFeC2wWYle1AaZLx -ZtFH6Ya4Q3a4xvjkXXabhbBDlwKBgQDGyzuNCGT1Xa1DXKLzyKspahdm9r7QXifo -jjZkcmzwItC535MBbQMq5+THD+WUbWrZ/rJ8KaSsoGmnjaWguSG0WLFpH3UiGn1W -FOSG2UGc0mWyz2p/j97EuhK12fabzn8rkuiohiFXjJDYrAIulcM++0ar3q2LyqXr -gleBEHLHgQKBgEAt44j9rIe+bO44etOIdUjb0nTvvBR0cd18i910AN169HY5Ainx -NXj+FELBcejDuiuKvnpZ8RhOALHg7C54w/HqxYv9aRnBCIqni7+e3e/VF/sknc4K -S7vdTp0KlRIkmpFFZiDbKmopjte1mBxMHrNFRDT99/7jhO98NcFzh9HnAoGAMf62 -sVdlHJg8lO5dRPY4pae6zvhLMNgdLU1mvIhSgWogGD70F6202DuNu8pxsIx8DOsT -NEq80XVeXPcwqmUk5thPdeKlcLg8wUNr3cYRzEDVtsyXOhGSsuMhBX8VmEWskebW -gFuLUxtU6kkIG3MqsVI8icjs2HVUmRAktZ7PXwECgYA9V/zZe2DpP36gp63wRk6S -FI7bDbLPQCKah23mwp3WeP5T+/HmFFRrl0OCaDLwudTolqgPa47CV7JYa9LmJAPj -QBxcnL4CxjlaaS3V9kxVWOXabMEtwSUurELJwFKTEC/AFN9dR/nv4AzXInZznotG -7qDX8EhfjbFVJw4riAmlEw== ------END PRIVATE KEY----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/server0.pem b/contrib/libs/grpc/src/core/tsi/test_creds/server0.pem deleted file mode 100644 index ab20787fa5..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/server0.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDQTCCAikCFGyX00RCepOv/qCJ1oVdTtY92U84MA0GCSqGSIb3DQEBCwUAMFYx -CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl -cm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnRlc3RjYTAeFw0yMDAzMTgw -MTA3MzhaFw0zMDAzMTYwMTA3MzhaMGQxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApT -b21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxHTAb -BgNVBAMMFCoudGVzdC5nb29nbGUuY29tLmF1MIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAnovWirrQzYNpqwjiAluIU+vi1SXyOSeg2d8qm+jAc23P/1Xl -I9Tgl/77eb7z5tUG+VzZNTDiBTxFurdv9DIY9lW0H4w3vz4WUYcLuDwbbqCQQ3gb -CpHZ8Q9CPuBtF0W3k7VLBjBgYFkgHahzA9h5xIYMnUcNJK2I2aeGvxzAp2WdVhWp -sNTwr0CugLlkkpOIhxmmJJV1Gind60ZZLo6+//4oXL6sHifjnWk8Fw/M+D9GHxXv -25FlqbqiGc9Tq/58YjQbb1ipSPKUdit8JKFrFvum5xTfLvNZ7LRw2q3Ues8twe0F -5HtNquLHXVBEXMDRcj6qbHHrTKZ4YJYY65pwFwIDAQABMA0GCSqGSIb3DQEBCwUA -A4IBAQCCGvZpM+t83xWPCsz5FyuCqA6LI+j0NMMmKpe1wJ8JcK2o9Qw4d0wPxWdy -0O7Ti2YlJS3gups00zsaFhQymIKUBi5Gc+1VC7qHUUrVtkoIRe6QSpcVlxPVczlD -If1egkjBCUZKVSWqYRKB6AMqjpp7/dF06j6zAaAH54jaLv9VmiBtsFyd017AsC9W -+OG2ke2dNtXySfVX4VusCcji86qb5sr6hNIQWMXk6dZoLDsZvwvVi7KnrqQOza8J -klcJXV8Hsnq/faHr/ZmsIA65N0+H8KuYfbO+s5nKPG9th6ZZAu4aY2VDei++TH+H -EAQhivPNUC1DgCmx0P7vKLhgka7S ------END CERTIFICATE----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/server1-openssl.cnf b/contrib/libs/grpc/src/core/tsi/test_creds/server1-openssl.cnf deleted file mode 100644 index 8a02108289..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/server1-openssl.cnf +++ /dev/null @@ -1,26 +0,0 @@ -[req] -distinguished_name = req_distinguished_name -req_extensions = v3_req - -[req_distinguished_name] -countryName = Country Name (2 letter code) -countryName_default = US -stateOrProvinceName = State or Province Name (full name) -stateOrProvinceName_default = Illinois -localityName = Locality Name (eg, city) -localityName_default = Chicago -organizationName = Organization Name (eg, company) -organizationName_default = Example, Co. -commonName = Common Name (eg, YOUR name) -commonName_max = 64 - -[v3_req] -basicConstraints = CA:FALSE -keyUsage = nonRepudiation, digitalSignature, keyEncipherment -subjectAltName = @alt_names - -[alt_names] -DNS.1 = *.test.google.fr -DNS.2 = waterzooi.test.google.be -DNS.3 = *.test.youtube.com -IP.1 = "192.168.1.3" diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/server1.key b/contrib/libs/grpc/src/core/tsi/test_creds/server1.key deleted file mode 100644 index 086462992c..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/server1.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDnE443EknxvxBq -6+hvn/t09hl8hx366EBYvZmVM/NC+7igXRAjiJiA/mIaCvL3MS0Iz5hBLxSGICU+ -WproA3GCIFITIwcf/ETyWj/5xpgZ4AKrLrjQmmX8mhwUajfF3UvwMJrCOVqPp67t -PtP+2kBXaqrXdvnvXR41FsIB8V7zIAuIZB6bHQhiGVlc1sgZYsE2EGG9WMmHtS86 -qkAOTjG2XyjmPTGAwhGDpYkYrpzp99IiDh4/Veai81hn0ssQkbry0XRD/Ig3jcHh -23WiriPNJ0JsbgXUSLKRPZObA9VgOLy2aXoN84IMaeK3yy+cwSYG/99w93fUZJte -MXwz4oYZAgMBAAECggEBAIVn2Ncai+4xbH0OLWckabwgyJ4IM9rDc0LIU368O1kU -koais8qP9dujAWgfoh3sGh/YGgKn96VnsZjKHlyMgF+r4TaDJn3k2rlAOWcurGlj -1qaVlsV4HiEzp7pxiDmHhWvp4672Bb6iBG+bsjCUOEk/n9o9KhZzIBluRhtxCmw5 -nw4Do7z00PTvN81260uPWSc04IrytvZUiAIx/5qxD72bij2xJ8t/I9GI8g4FtoVB -8pB6S/hJX1PZhh9VlU6Yk+TOfOVnbebG4W5138LkB835eqk3Zz0qsbc2euoi8Hxi -y1VGwQEmMQ63jXz4c6g+X55ifvUK9Jpn5E8pq+pMd7ECgYEA93lYq+Cr54K4ey5t -sWMa+ye5RqxjzgXj2Kqr55jb54VWG7wp2iGbg8FMlkQwzTJwebzDyCSatguEZLuB -gRGroRnsUOy9vBvhKPOch9bfKIl6qOgzMJB267fBVWx5ybnRbWN/I7RvMQf3k+9y -biCIVnxDLEEYyx7z85/5qxsXg/MCgYEA7wmWKtCTn032Hy9P8OL49T0X6Z8FlkDC -Rk42ygrc/MUbugq9RGUxcCxoImOG9JXUpEtUe31YDm2j+/nbvrjl6/bP2qWs0V7l -dTJl6dABP51pCw8+l4cWgBBX08Lkeen812AAFNrjmDCjX6rHjWHLJcpS18fnRRkP -V1d/AHWX7MMCgYEA6Gsw2guhp0Zf2GCcaNK5DlQab8OL4Hwrpttzo4kuTlwtqNKp -Q9H4al9qfF4Cr1TFya98+EVYf8yFRM3NLNjZpe3gwYf2EerlJj7VLcahw0KKzoN1 -QBENfwgPLRk5sDkx9VhSmcfl/diLroZdpAwtv3vo4nEoxeuGFbKTGx3Qkf0CgYEA -xyR+dcb05Ygm3w4klHQTowQ10s1H80iaUcZBgQuR1ghEtDbUPZHsoR5t1xCB02ys -DgAwLv1bChIvxvH/L6KM8ovZ2LekBX4AviWxoBxJnfz/EVau98B0b1auRN6eSC83 -FRuGldlSOW1z/nSh8ViizSYE5H5HX1qkXEippvFRE88CgYB3Bfu3YQY60ITWIShv -nNkdcbTT9eoP9suaRJjw92Ln+7ZpALYlQMKUZmJ/5uBmLs4RFwUTQruLOPL4yLTH -awADWUzs3IRr1fwn9E+zM8JVyKCnUEM3w4N5UZskGO2klashAd30hWO+knRv/y0r -uGIYs9Ek7YXlXIRVrzMwcsrt1w== ------END PRIVATE KEY----- diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/server1.pem b/contrib/libs/grpc/src/core/tsi/test_creds/server1.pem deleted file mode 100644 index 88244f856c..0000000000 --- a/contrib/libs/grpc/src/core/tsi/test_creds/server1.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDtDCCApygAwIBAgIUbJfTREJ6k6/+oInWhV1O1j3ZT0IwDQYJKoZIhvcNAQEL -BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw -MDMxODAzMTA0MloXDTMwMDMxNjAzMTA0MlowZTELMAkGA1UEBhMCVVMxETAPBgNV -BAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGljYWdvMRUwEwYDVQQKDAxFeGFtcGxl -LCBDby4xGjAYBgNVBAMMESoudGVzdC5nb29nbGUuY29tMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA5xOONxJJ8b8Qauvob5/7dPYZfIcd+uhAWL2ZlTPz -Qvu4oF0QI4iYgP5iGgry9zEtCM+YQS8UhiAlPlqa6ANxgiBSEyMHH/xE8lo/+caY -GeACqy640Jpl/JocFGo3xd1L8DCawjlaj6eu7T7T/tpAV2qq13b5710eNRbCAfFe -8yALiGQemx0IYhlZXNbIGWLBNhBhvVjJh7UvOqpADk4xtl8o5j0xgMIRg6WJGK6c -6ffSIg4eP1XmovNYZ9LLEJG68tF0Q/yIN43B4dt1oq4jzSdCbG4F1EiykT2TmwPV -YDi8tml6DfOCDGnit8svnMEmBv/fcPd31GSbXjF8M+KGGQIDAQABo2swaTAJBgNV -HRMEAjAAMAsGA1UdDwQEAwIF4DBPBgNVHREESDBGghAqLnRlc3QuZ29vZ2xlLmZy -ghh3YXRlcnpvb2kudGVzdC5nb29nbGUuYmWCEioudGVzdC55b3V0dWJlLmNvbYcE -wKgBAzANBgkqhkiG9w0BAQsFAAOCAQEAS8hDQA8PSgipgAml7Q3/djwQ644ghWQv -C2Kb+r30RCY1EyKNhnQnIIh/OUbBZvh0M0iYsy6xqXgfDhCB93AA6j0i5cS8fkhH -Jl4RK0tSkGQ3YNY4NzXwQP/vmUgfkw8VBAZ4Y4GKxppdATjffIW+srbAmdDruIRM -wPeikgOoRrXf0LA1fi4TqxARzeRwenQpayNfGHTvVF9aJkl8HoaMunTAdG5pIVcr -9GKi/gEMpXUJbbVv3U5frX1Wo4CFo+rZWJ/LyCMeb0jciNLxSdMwj/E/ZuExlyeZ -gc9ctPjSMvgSyXEKv6Vwobleeg88V2ZgzenziORoWj4KszG/lbQZvg== ------END CERTIFICATE----- diff --git a/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt deleted file mode 100644 index b042e4af0c..0000000000 --- a/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,50 +0,0 @@ -====================Apache-2.0==================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - - -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== - * Copyright 2015 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2016 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2018 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2019 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2020 gRPC authors. - - -====================COPYRIGHT==================== -// Copyright 2021 gRPC authors. diff --git a/contrib/libs/grpc/src/proto/grpc/channelz/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/channelz/.yandex_meta/licenses.list.txt deleted file mode 100644 index 8b7269ff4c..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/channelz/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,16 +0,0 @@ -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== -// Copyright 2018 The gRPC Authors diff --git a/contrib/libs/grpc/src/proto/grpc/core/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/core/.yandex_meta/licenses.list.txt deleted file mode 100644 index 28e08e9def..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/core/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,16 +0,0 @@ -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== - * Copyright 2017 gRPC authors. diff --git a/contrib/libs/grpc/src/proto/grpc/gcp/altscontext.proto b/contrib/libs/grpc/src/proto/grpc/gcp/altscontext.proto deleted file mode 100644 index cce6dd2afc..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/gcp/altscontext.proto +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2018 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// The canonical version of this proto can be found at -// https://github.com/grpc/grpc-proto/blob/master/grpc/gcp/altscontext.proto - -syntax = "proto3"; - -package grpc.gcp; - -import "src/proto/grpc/gcp/transport_security_common.proto"; - -option go_package = "google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp"; -option java_multiple_files = true; -option java_outer_classname = "AltsContextProto"; -option java_package = "io.grpc.alts.internal"; - -message AltsContext { - // The application protocol negotiated for this connection. - string application_protocol = 1; - - // The record protocol negotiated for this connection. - string record_protocol = 2; - - // The security level of the created secure channel. - SecurityLevel security_level = 3; - - // The peer service account. - string peer_service_account = 4; - - // The local service account. - string local_service_account = 5; - - // The RPC protocol versions supported by the peer. - RpcProtocolVersions peer_rpc_versions = 6; - - // Additional attributes of the peer. - map<string, string> peer_attributes = 7; -} diff --git a/contrib/libs/grpc/src/proto/grpc/gcp/handshaker.proto b/contrib/libs/grpc/src/proto/grpc/gcp/handshaker.proto deleted file mode 100644 index fe0e1e199a..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/gcp/handshaker.proto +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2018 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// The canonical version of this proto can be found at -// https://github.com/grpc/grpc-proto/blob/master/grpc/gcp/handshaker.proto - -syntax = "proto3"; - -package grpc.gcp; - -import "src/proto/grpc/gcp/transport_security_common.proto"; - -option go_package = "google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp"; -option java_multiple_files = true; -option java_outer_classname = "HandshakerProto"; -option java_package = "io.grpc.alts.internal"; - - -enum HandshakeProtocol { - // Default value. - HANDSHAKE_PROTOCOL_UNSPECIFIED = 0; - - // TLS handshake protocol. - TLS = 1; - - // Application Layer Transport Security handshake protocol. - ALTS = 2; -} - -enum NetworkProtocol { - NETWORK_PROTOCOL_UNSPECIFIED = 0; - TCP = 1; - UDP = 2; -} - -message Endpoint { - // IP address. It should contain an IPv4 or IPv6 string literal, e.g. - // "192.168.0.1" or "2001:db8::1". - string ip_address = 1; - - // Port number. - int32 port = 2; - - // Network protocol (e.g., TCP, UDP) associated with this endpoint. - NetworkProtocol protocol = 3; -} - -message Identity { - oneof identity_oneof { - // Service account of a connection endpoint. - string service_account = 1; - - // Hostname of a connection endpoint. - string hostname = 2; - } - - // Additional attributes of the identity. - map<string, string> attributes = 3; -} - -message StartClientHandshakeReq { - // Handshake security protocol requested by the client. - HandshakeProtocol handshake_security_protocol = 1; - - // The application protocols supported by the client, e.g., "h2" (for http2), - // "grpc". - repeated string application_protocols = 2; - - // The record protocols supported by the client, e.g., - // "ALTSRP_GCM_AES128". - repeated string record_protocols = 3; - - // (Optional) Describes which server identities are acceptable by the client. - // If target identities are provided and none of them matches the peer - // identity of the server, handshake will fail. - repeated Identity target_identities = 4; - - // (Optional) Application may specify a local identity. Otherwise, the - // handshaker chooses a default local identity. - Identity local_identity = 5; - - // (Optional) Local endpoint information of the connection to the server, - // such as local IP address, port number, and network protocol. - Endpoint local_endpoint = 6; - - // (Optional) Endpoint information of the remote server, such as IP address, - // port number, and network protocol. - Endpoint remote_endpoint = 7; - - // (Optional) If target name is provided, a secure naming check is performed - // to verify that the peer authenticated identity is indeed authorized to run - // the target name. - string target_name = 8; - - // (Optional) RPC protocol versions supported by the client. - RpcProtocolVersions rpc_versions = 9; - - // (Optional) Maximum frame size supported by the client. - uint32 max_frame_size = 10; -} - -message ServerHandshakeParameters { - // The record protocols supported by the server, e.g., - // "ALTSRP_GCM_AES128". - repeated string record_protocols = 1; - - // (Optional) A list of local identities supported by the server, if - // specified. Otherwise, the handshaker chooses a default local identity. - repeated Identity local_identities = 2; -} - -message StartServerHandshakeReq { - // The application protocols supported by the server, e.g., "h2" (for http2), - // "grpc". - repeated string application_protocols = 1; - - // Handshake parameters (record protocols and local identities supported by - // the server) mapped by the handshake protocol. Each handshake security - // protocol (e.g., TLS or ALTS) has its own set of record protocols and local - // identities. Since protobuf does not support enum as key to the map, the key - // to handshake_parameters is the integer value of HandshakeProtocol enum. - map<int32, ServerHandshakeParameters> handshake_parameters = 2; - - // Bytes in out_frames returned from the peer's HandshakerResp. It is possible - // that the peer's out_frames are split into multiple HandshakReq messages. - bytes in_bytes = 3; - - // (Optional) Local endpoint information of the connection to the client, - // such as local IP address, port number, and network protocol. - Endpoint local_endpoint = 4; - - // (Optional) Endpoint information of the remote client, such as IP address, - // port number, and network protocol. - Endpoint remote_endpoint = 5; - - // (Optional) RPC protocol versions supported by the server. - RpcProtocolVersions rpc_versions = 6; - - // (Optional) Maximum frame size supported by the server. - uint32 max_frame_size = 7; -} - -message NextHandshakeMessageReq { - // Bytes in out_frames returned from the peer's HandshakerResp. It is possible - // that the peer's out_frames are split into multiple NextHandshakerMessageReq - // messages. - bytes in_bytes = 1; -} - -message HandshakerReq { - oneof req_oneof { - // The start client handshake request message. - StartClientHandshakeReq client_start = 1; - - // The start server handshake request message. - StartServerHandshakeReq server_start = 2; - - // The next handshake request message. - NextHandshakeMessageReq next = 3; - } -} - -message HandshakerResult { - // The application protocol negotiated for this connection. - string application_protocol = 1; - - // The record protocol negotiated for this connection. - string record_protocol = 2; - - // Cryptographic key data. The key data may be more than the key length - // required for the record protocol, thus the client of the handshaker - // service needs to truncate the key data into the right key length. - bytes key_data = 3; - - // The authenticated identity of the peer. - Identity peer_identity = 4; - - // The local identity used in the handshake. - Identity local_identity = 5; - - // Indicate whether the handshaker service client should keep the channel - // between the handshaker service open, e.g., in order to handle - // post-handshake messages in the future. - bool keep_channel_open = 6; - - // The RPC protocol versions supported by the peer. - RpcProtocolVersions peer_rpc_versions = 7; - - // The maximum frame size of the peer. - uint32 max_frame_size = 8; -} - -message HandshakerStatus { - // The status code. This could be the gRPC status code. - uint32 code = 1; - - // The status details. - string details = 2; -} - -message HandshakerResp { - // Frames to be given to the peer for the NextHandshakeMessageReq. May be - // empty if no out_frames have to be sent to the peer or if in_bytes in the - // HandshakerReq are incomplete. All the non-empty out frames must be sent to - // the peer even if the handshaker status is not OK as these frames may - // contain the alert frames. - bytes out_frames = 1; - - // Number of bytes in the in_bytes consumed by the handshaker. It is possible - // that part of in_bytes in HandshakerReq was unrelated to the handshake - // process. - uint32 bytes_consumed = 2; - - // This is set iff the handshake was successful. out_frames may still be set - // to frames that needs to be forwarded to the peer. - HandshakerResult result = 3; - - // Status of the handshaker. - HandshakerStatus status = 4; -} - -service HandshakerService { - // Handshaker service accepts a stream of handshaker request, returning a - // stream of handshaker response. Client is expected to send exactly one - // message with either client_start or server_start followed by one or more - // messages with next. Each time client sends a request, the handshaker - // service expects to respond. Client does not have to wait for service's - // response before sending next request. - rpc DoHandshake(stream HandshakerReq) - returns (stream HandshakerResp) { - } -} diff --git a/contrib/libs/grpc/src/proto/grpc/gcp/transport_security_common.proto b/contrib/libs/grpc/src/proto/grpc/gcp/transport_security_common.proto deleted file mode 100644 index 8f01be79e3..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/gcp/transport_security_common.proto +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2018 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// The canonical version of this proto can be found at -// https://github.com/grpc/grpc-proto/blob/master/grpc/gcp/transport_security_common.proto - -syntax = "proto3"; - -package grpc.gcp; - -option go_package = "google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp"; -option java_multiple_files = true; -option java_outer_classname = "TransportSecurityCommonProto"; -option java_package = "io.grpc.alts.internal"; - -// The security level of the created channel. The list is sorted in increasing -// level of security. This order must always be maintained. -enum SecurityLevel { - SECURITY_NONE = 0; - INTEGRITY_ONLY = 1; - INTEGRITY_AND_PRIVACY = 2; -} - -// Max and min supported RPC protocol versions. -message RpcProtocolVersions { - // RPC version contains a major version and a minor version. - message Version { - uint32 major = 1; - uint32 minor = 2; - } - // Maximum supported RPC version. - Version max_rpc_version = 1; - // Minimum supported RPC version. - Version min_rpc_version = 2; -} diff --git a/contrib/libs/grpc/src/proto/grpc/health/v1/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/health/v1/.yandex_meta/licenses.list.txt deleted file mode 100644 index d841cd39fb..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/health/v1/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,16 +0,0 @@ -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== -// Copyright 2015 The gRPC Authors diff --git a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto b/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto deleted file mode 100644 index 00fc7096c9..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2015 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file defines the GRPCLB LoadBalancing protocol. -// -// The canonical version of this proto can be found at -// https://github.com/grpc/grpc-proto/blob/master/grpc/lb/v1/load_balancer.proto -syntax = "proto3"; - -package grpc.lb.v1; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1"; -option java_multiple_files = true; -option java_outer_classname = "LoadBalancerProto"; -option java_package = "io.grpc.lb.v1"; - -service LoadBalancer { - // Bidirectional rpc to get a list of servers. - rpc BalanceLoad(stream LoadBalanceRequest) returns (stream LoadBalanceResponse); -} - -message LoadBalanceRequest { - oneof load_balance_request_type { - // This message should be sent on the first request to the load balancer. - InitialLoadBalanceRequest initial_request = 1; - - // The client stats should be periodically reported to the load balancer - // based on the duration defined in the InitialLoadBalanceResponse. - ClientStats client_stats = 2; - } -} - -message InitialLoadBalanceRequest { - // The name of the load balanced service (e.g., service.googleapis.com). Its - // length should be less than 256 bytes. - // The name might include a port number. How to handle the port number is up - // to the balancer. - string name = 1; -} - -// Contains the number of calls finished for a particular load balance token. -message ClientStatsPerToken { - // See Server.load_balance_token. - string load_balance_token = 1; - - // The total number of RPCs that finished associated with the token. - int64 num_calls = 2; -} - -// Contains client level statistics that are useful to load balancing. Each -// count except the timestamp should be reset to zero after reporting the stats. -message ClientStats { - // The timestamp of generating the report. - google.protobuf.Timestamp timestamp = 1; - - // The total number of RPCs that started. - int64 num_calls_started = 2; - - // The total number of RPCs that finished. - int64 num_calls_finished = 3; - - // The total number of RPCs that failed to reach a server except dropped RPCs. - int64 num_calls_finished_with_client_failed_to_send = 6; - - // The total number of RPCs that finished and are known to have been received - // by a server. - int64 num_calls_finished_known_received = 7; - - // The list of dropped calls. - repeated ClientStatsPerToken calls_finished_with_drop = 8; - - reserved 4, 5; -} - -message LoadBalanceResponse { - oneof load_balance_response_type { - // This message should be sent on the first response to the client. - InitialLoadBalanceResponse initial_response = 1; - - // Contains the list of servers selected by the load balancer. The client - // should send requests to these servers in the specified order. - ServerList server_list = 2; - - // If this field is set, then the client should eagerly enter fallback - // mode (even if there are existing, healthy connections to backends). - FallbackResponse fallback_response = 3; - } -} - -message FallbackResponse {} - -message InitialLoadBalanceResponse { - reserved 1; // never-used load_balancer_delegate - - // This interval defines how often the client should send the client stats - // to the load balancer. Stats should only be reported when the duration is - // positive. - google.protobuf.Duration client_stats_report_interval = 2; -} - -message ServerList { - // Contains a list of servers selected by the load balancer. The list will - // be updated when server resolutions change or as needed to balance load - // across more servers. The client should consume the server list in order - // unless instructed otherwise via the client_config. - repeated Server servers = 1; - - // Was google.protobuf.Duration expiration_interval. - reserved 3; -} - -// Contains server information. When the drop field is not true, use the other -// fields. -message Server { - // A resolved address for the server, serialized in network-byte-order. It may - // either be an IPv4 or IPv6 address. - bytes ip_address = 1; - - // A resolved port number for the server. - int32 port = 2; - - // An opaque but printable token for load reporting. The client must include - // the token of the picked server into the initial metadata when it starts a - // call to that server. The token is used by the server to verify the request - // and to allow the server to report load to the gRPC LB system. The token is - // also used in client stats for reporting dropped calls. - // - // Its length can be variable but must be less than 50 bytes. - string load_balance_token = 3; - - // Indicates whether this particular request should be dropped by the client. - // If the request is dropped, there will be a corresponding entry in - // ClientStats.calls_finished_with_drop. - bool drop = 4; - - reserved 5; -} diff --git a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_reporter.proto b/contrib/libs/grpc/src/proto/grpc/lb/v1/load_reporter.proto deleted file mode 100644 index d57a37fed7..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_reporter.proto +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2018 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package grpc.lb.v1; - -import "google/protobuf/duration.proto"; - -// The LoadReporter service. -service LoadReporter { - // Report load from server to lb. - rpc ReportLoad(stream LoadReportRequest) - returns (stream LoadReportResponse) { - }; -} - -message LoadReportRequest { - // This message should be sent on the first request to the gRPC server. - InitialLoadReportRequest initial_request = 1; -} - -message InitialLoadReportRequest { - // The hostname this load reporter client is requesting load for. - string load_balanced_hostname = 1; - - // Additional information to disambiguate orphaned load: load that should have - // gone to this load reporter client, but was not able to be sent since the - // load reporter client has disconnected. load_key is sent in orphaned load - // reports; see Load.load_key. - bytes load_key = 2; - - // This interval defines how often the server should send load reports to - // the load balancer. - google.protobuf.Duration load_report_interval = 3; -} - -message LoadReportResponse { - // This message should be sent on the first response to the load balancer. - InitialLoadReportResponse initial_response = 1; - - // Reports server-wide statistics for load balancing. - // This should be reported with every response. - LoadBalancingFeedback load_balancing_feedback = 2; - - // A load report for each <tag, user_id> tuple. This could be considered to be - // a multimap indexed by <tag, user_id>. It is not strictly necessary to - // aggregate all entries into one entry per <tag, user_id> tuple, although it - // is preferred to do so. - repeated Load load = 3; -} - -message InitialLoadReportResponse { - // Initial response returns the Load balancer ID. This must be plain text - // (printable ASCII). - string load_balancer_id = 1; - - enum ImplementationIdentifier { - IMPL_UNSPECIFIED = 0; - CPP = 1; // Standard Google C++ implementation. - JAVA = 2; // Standard Google Java implementation. - GO = 3; // Standard Google Go implementation. - } - // Optional identifier of this implementation of the load reporting server. - ImplementationIdentifier implementation_id = 2; - - // Optional server_version should be a value that is modified (and - // monotonically increased) when changes are made to the server - // implementation. - int64 server_version = 3; -} - -message LoadBalancingFeedback { - // Reports the current utilization of the server (typical range [0.0 - 1.0]). - float server_utilization = 1; - - // The total rate of calls handled by this server (including errors). - float calls_per_second = 2; - - // The total rate of error responses sent by this server. - float errors_per_second = 3; -} - -message Load { - // The (plain text) tag used by the calls covered by this load report. The - // tag is that part of the load balancer token after removing the load - // balancer id. Empty is equivalent to non-existent tag. - string load_balance_tag = 1; - - // The user identity authenticated by the calls covered by this load - // report. Empty is equivalent to no known user_id. - string user_id = 3; - - // IP address of the client that sent these requests, serialized in - // network-byte-order. It may either be an IPv4 or IPv6 address. - bytes client_ip_address = 15; - - // The number of calls started (since the last report) with the given tag and - // user_id. - int64 num_calls_started = 4; - - // Indicates whether this load report is an in-progress load report in which - // num_calls_in_progress is the only valid entry. If in_progress_report is not - // set, num_calls_in_progress will be ignored. If in_progress_report is set, - // fields other than num_calls_in_progress and orphaned_load will be ignored. - // TODO(juanlishen): A Load is either an in_progress_report or not. We should - // make this explicit in hierarchy. From the log, I see in_progress_report_ - // has a random num_calls_in_progress_ when not set, which might lead to bug - // when the balancer process the load report. - oneof in_progress_report { - // The number of calls in progress (instantaneously) per load balancer id. - int64 num_calls_in_progress = 5; - } - - // The following values are counts or totals of call statistics that finished - // with the given tag and user_id. - int64 num_calls_finished_without_error = 6; // Calls with status OK. - int64 num_calls_finished_with_error = 7; // Calls with status non-OK. - // Calls that finished with a status that maps to HTTP 5XX (see - // googleapis/google/rpc/code.proto). Note that this is a subset of - // num_calls_finished_with_error. - int64 num_calls_finished_with_server_error = 16; - - // Totals are from calls that with _and_ without error. - int64 total_bytes_sent = 8; - int64 total_bytes_received = 9; - google.protobuf.Duration total_latency = 10; - - // Optional metrics reported for the call(s). Requires that metric_name is - // unique. - repeated CallMetricData metric_data = 11; - - // The following two fields are used for reporting orphaned load: load that - // could not be reported to the originating balancer either since the balancer - // is no longer connected or because the frontend sent an invalid token. These - // fields must not be set with normal (unorphaned) load reports. - oneof orphaned_load { - // Load_key is the load_key from the initial_request from the originating - // balancer. - bytes load_key = 12 [deprecated=true]; - - // If true then this load report is for calls that had an invalid token; the - // user is probably abusing the gRPC protocol. - // TODO(yankaiz): Rename load_key_unknown. - bool load_key_unknown = 13; - - // load_key and balancer_id are included in order to identify orphaned load - // from different origins. - OrphanedLoadIdentifier orphaned_load_identifier = 14; - } - - reserved 2; -} - -message CallMetricData { - // Name of the metric; may be empty. - string metric_name = 1; - - // Number of calls that finished and included this metric. - int64 num_calls_finished_with_metric = 2; - - // Sum of metric values across all calls that finished with this metric. - double total_metric_value = 3; -} - -message OrphanedLoadIdentifier { - // The load_key from the initial_request from the originating balancer. - bytes load_key = 1; - - // The unique ID generated by LoadReporter to identify balancers. Here it - // distinguishes orphaned load with a same load_key. - string load_balancer_id = 2; -} diff --git a/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls.proto b/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls.proto deleted file mode 100644 index 7d1735289d..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package grpc.lookup.v1; - -option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1"; -option java_multiple_files = true; -option java_package = "io.grpc.lookup.v1"; -option java_outer_classname = "RlsProto"; - -message RouteLookupRequest { - // Target type allows the client to specify what kind of target format it - // would like from RLS to allow it to find the regional server, e.g. "grpc". - string target_type = 3; - // Possible reasons for making a request. - enum Reason { - REASON_UNKNOWN = 0; // Unused - REASON_MISS = 1; // No data available in local cache - REASON_STALE = 2; // Data in local cache is stale - } - // Reason for making this request. - Reason reason = 5; - // For REASON_STALE, the header_data from the stale response, if any. - string stale_header_data = 6; - // Map of key values extracted via key builders for the gRPC or HTTP request. - map<string, string> key_map = 4; - - reserved 1, 2; - reserved "server", "path"; -} - -message RouteLookupResponse { - // Prioritized list (best one first) of addressable entities to use - // for routing, using syntax requested by the request target_type. - // The targets will be tried in order until a healthy one is found. - repeated string targets = 3; - // Optional header value to pass along to AFE in the X-Google-RLS-Data header. - // Cached with "target" and sent with all requests that match the request key. - // Allows the RLS to pass its work product to the eventual target. - string header_data = 2; - - reserved 1; - reserved "target"; -} - -service RouteLookupService { - // Lookup returns a target for a single key. - rpc RouteLookup(RouteLookupRequest) returns (RouteLookupResponse) {} -} diff --git a/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls_config.proto b/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls_config.proto deleted file mode 100644 index 9d2b6c54cf..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls_config.proto +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package grpc.lookup.v1; - -import "google/protobuf/duration.proto"; - -option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1"; -option java_multiple_files = true; -option java_package = "io.grpc.lookup.v1"; -option java_outer_classname = "RlsConfigProto"; - -// Extract a key based on a given name (e.g. header name or query parameter -// name). The name must match one of the names listed in the "name" field. If -// the "required_match" field is true, one of the specified names must be -// present for the keybuilder to match. -message NameMatcher { - // The name that will be used in the RLS key_map to refer to this value. - // If required_match is true, you may omit this field or set it to an empty - // string, in which case the matcher will require a match, but won't update - // the key_map. - string key = 1; - - // Ordered list of names (headers or query parameter names) that can supply - // this value; the first one with a non-empty value is used. - repeated string names = 2; - - // If true, make this extraction required; the key builder will not match - // if no value is found. - bool required_match = 3; -} - -// A GrpcKeyBuilder applies to a given gRPC service, name, and headers. -message GrpcKeyBuilder { - // To match, one of the given Name fields must match; the service and method - // fields are specified as fixed strings. The service name is required and - // includes the proto package name. The method name may be omitted, in - // which case any method on the given service is matched. - message Name { - string service = 1; - string method = 2; - } - repeated Name names = 1; - - // If you wish to include the host, service, or method names as keys in the - // generated RouteLookupRequest, specify key names to use in the extra_keys - // submessage. If a key name is empty, no key will be set for that value. - // If this submessage is specified, the normal host/path fields will be left - // unset in the RouteLookupRequest. We are deprecating host/path in the - // RouteLookupRequest, so services should migrate to the ExtraKeys approach. - message ExtraKeys { - string host = 1; - string service = 2; - string method = 3; - } - ExtraKeys extra_keys = 3; - - // Extract keys from all listed headers. - // For gRPC, it is an error to specify "required_match" on the NameMatcher - // protos. - repeated NameMatcher headers = 2; - - // You can optionally set one or more specific key/value pairs to be added to - // the key_map. This can be useful to identify which builder built the key, - // for example if you are suppressing the actual method, but need to - // separately cache and request all the matched methods. - map<string, string> constant_keys = 4; -} - -// An HttpKeyBuilder applies to a given HTTP URL and headers. -// -// Path and host patterns use the matching syntax from gRPC transcoding to -// extract named key/value pairs from the path and host components of the URL: -// https://github.com/googleapis/googleapis/blob/master/google/api/http.proto -// -// It is invalid to specify the same key name in multiple places in a pattern. -// -// For a service where the project id can be expressed either as a subdomain or -// in the path, separate HttpKeyBuilders must be used: -// host_pattern: 'example.com' path_pattern: '/{id}/{object}/**' -// host_pattern: '{id}.example.com' path_pattern: '/{object}/**' -// If the host is exactly 'example.com', the first path segment will be used as -// the id and the second segment as the object. If the host has a subdomain, the -// subdomain will be used as the id and the first segment as the object. If -// neither pattern matches, no keys will be extracted. -message HttpKeyBuilder { - // host_pattern is an ordered list of host template patterns for the desired - // value. If any host_pattern values are specified, then at least one must - // match, and the last one wins and sets any specified variables. A host - // consists of labels separated by dots. Each label is matched against the - // label in the pattern as follows: - // - "*": Matches any single label. - // - "**": Matches zero or more labels (first or last part of host only). - // - "{<name>=...}": One or more label capture, where "..." can be any - // template that does not include a capture. - // - "{<name>}": A single label capture. Identical to {<name>=*}. - // - // Examples: - // - "example.com": Only applies to the exact host example.com. - // - "*.example.com": Matches subdomains of example.com. - // - "**.example.com": matches example.com, and all levels of subdomains. - // - "{project}.example.com": Extracts the third level subdomain. - // - "{project=**}.example.com": Extracts the third level+ subdomains. - // - "{project=**}": Extracts the entire host. - repeated string host_patterns = 1; - - // path_pattern is an ordered list of path template patterns for the desired - // value. If any path_pattern values are specified, then at least one must - // match, and the last one wins and sets any specified variables. A path - // consists of segments separated by slashes. Each segment is matched against - // the segment in the pattern as follows: - // - "*": Matches any single segment. - // - "**": Matches zero or more segments (first or last part of path only). - // - "{<name>=...}": One or more segment capture, where "..." can be any - // template that does not include a capture. - // - "{<name>}": A single segment capture. Identical to {<name>=*}. - // A custom method may also be specified by appending ":" and the custom - // method name or "*" to indicate any custom method (including no custom - // method). For example, "/*/projects/{project_id}/**:*" extracts - // `{project_id}` for any version, resource and custom method that includes - // it. By default, any custom method will be matched. - // - // Examples: - // - "/v1/{name=messages/*}": extracts a name like "messages/12345". - // - "/v1/messages/{message_id}": extracts a message_id like "12345". - // - "/v1/users/{user_id}/messages/{message_id}": extracts two key values. - repeated string path_patterns = 2; - - // List of query parameter names to try to match. - // For example: ["parent", "name", "resource.name"] - // We extract all the specified query_parameters (case-sensitively). If any - // are marked as "required_match" and are not present, this keybuilder fails - // to match. If a given parameter appears multiple times (?foo=a&foo=b) we - // will report it as a comma-separated string (foo=a,b). - repeated NameMatcher query_parameters = 3; - - // List of headers to try to match. - // We extract all the specified header values (case-insensitively). If any - // are marked as "required_match" and are not present, this keybuilder fails - // to match. If a given header appears multiple times in the request we will - // report it as a comma-separated string, in standard HTTP fashion. - repeated NameMatcher headers = 4; - - // You can optionally set one or more specific key/value pairs to be added to - // the key_map. This can be useful to identify which builder built the key, - // for example if you are suppressing a lot of information from the URL, but - // need to separately cache and request URLs with that content. - map<string, string> constant_keys = 5; -} - -message RouteLookupConfig { - // Ordered specifications for constructing keys for HTTP requests. Last - // match wins. If no HttpKeyBuilder matches, an empty key_map will be sent to - // the lookup service; it should likely reply with a global default route - // and raise an alert. - repeated HttpKeyBuilder http_keybuilders = 1; - - // Unordered specifications for constructing keys for gRPC requests. All - // GrpcKeyBuilders on this list must have unique "name" fields so that the - // client is free to prebuild a hash map keyed by name. If no GrpcKeyBuilder - // matches, an empty key_map will be sent to the lookup service; it should - // likely reply with a global default route and raise an alert. - repeated GrpcKeyBuilder grpc_keybuilders = 2; - - // The name of the lookup service as a gRPC URI. Typically, this will be - // a subdomain of the target, such as "lookup.datastore.googleapis.com". - string lookup_service = 3; - - // Configure a timeout value for lookup service requests. - // Defaults to 10 seconds if not specified. - google.protobuf.Duration lookup_service_timeout = 4; - - // How long are responses valid for (like HTTP Cache-Control). - // If omitted or zero, the longest valid cache time is used. - // This value is clamped to 5 minutes to avoid unflushable bad responses. - google.protobuf.Duration max_age = 5; - - // After a response has been in the client cache for this amount of time - // and is re-requested, start an asynchronous RPC to re-validate it. - // This value should be less than max_age by at least the length of a - // typical RTT to the Route Lookup Service to fully mask the RTT latency. - // If omitted, keys are only re-requested after they have expired. - google.protobuf.Duration stale_age = 6; - - // Rough indicator of amount of memory to use for the client cache. Some of - // the data structure overhead is not accounted for, so actual memory consumed - // will be somewhat greater than this value. If this field is omitted or set - // to zero, a client default will be used. The value may be capped to a lower - // amount based on client configuration. - int64 cache_size_bytes = 7; - - // This is a list of all the possible targets that can be returned by the - // lookup service. If a target not on this list is returned, it will be - // treated the same as an unhealthy target. - repeated string valid_targets = 8; - - // This value provides a default target to use if needed. If set, it will be - // used if RLS returns an error, times out, or returns an invalid response. - // Note that requests can be routed only to a subdomain of the original - // target, e.g. "us_east_1.cloudbigtable.googleapis.com". - string default_target = 9; - - reserved 10; - reserved "request_processing_strategy"; -} - -// RouteLookupClusterSpecifier is used in xDS to represent a cluster specifier -// plugin for RLS. -message RouteLookupClusterSpecifier { - // The RLS config for this cluster specifier plugin instance. - RouteLookupConfig route_lookup_config = 1; -} diff --git a/contrib/libs/grpc/src/proto/grpc/reflection/v1/reflection.proto b/contrib/libs/grpc/src/proto/grpc/reflection/v1/reflection.proto deleted file mode 100644 index 1a2ceedc3d..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/reflection/v1/reflection.proto +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Service exported by server reflection. A more complete description of how -// server reflection works can be found at -// https://github.com/grpc/grpc/blob/master/doc/server-reflection.md -// -// The canonical version of this proto can be found at -// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto - -syntax = "proto3"; - -package grpc.reflection.v1; - -option go_package = "google.golang.org/grpc/reflection/grpc_reflection_v1"; -option java_multiple_files = true; -option java_package = "io.grpc.reflection.v1"; -option java_outer_classname = "ServerReflectionProto"; - -service ServerReflection { - // The reflection service is structured as a bidirectional stream, ensuring - // all related requests go to a single server. - rpc ServerReflectionInfo(stream ServerReflectionRequest) - returns (stream ServerReflectionResponse); -} - -// The message sent by the client when calling ServerReflectionInfo method. -message ServerReflectionRequest { - string host = 1; - // To use reflection service, the client should set one of the following - // fields in message_request. The server distinguishes requests by their - // defined field and then handles them using corresponding methods. - oneof message_request { - // Find a proto file by the file name. - string file_by_filename = 3; - - // Find the proto file that declares the given fully-qualified symbol name. - // This field should be a fully-qualified symbol name - // (e.g. <package>.<service>[.<method>] or <package>.<type>). - string file_containing_symbol = 4; - - // Find the proto file which defines an extension extending the given - // message type with the given field number. - ExtensionRequest file_containing_extension = 5; - - // Finds the tag numbers used by all known extensions of the given message - // type, and appends them to ExtensionNumberResponse in an undefined order. - // Its corresponding method is best-effort: it's not guaranteed that the - // reflection service will implement this method, and it's not guaranteed - // that this method will provide all extensions. Returns - // StatusCode::UNIMPLEMENTED if it's not implemented. - // This field should be a fully-qualified type name. The format is - // <package>.<type> - string all_extension_numbers_of_type = 6; - - // List the full names of registered services. The content will not be - // checked. - string list_services = 7; - } -} - -// The type name and extension number sent by the client when requesting -// file_containing_extension. -message ExtensionRequest { - // Fully-qualified type name. The format should be <package>.<type> - string containing_type = 1; - int32 extension_number = 2; -} - -// The message sent by the server to answer ServerReflectionInfo method. -message ServerReflectionResponse { - string valid_host = 1; - ServerReflectionRequest original_request = 2; - // The server sets one of the following fields according to the message_request - // in the request. - oneof message_response { - // This message is used to answer file_by_filename, file_containing_symbol, - // file_containing_extension requests with transitive dependencies. - // As the repeated label is not allowed in oneof fields, we use a - // FileDescriptorResponse message to encapsulate the repeated fields. - // The reflection service is allowed to avoid sending FileDescriptorProtos - // that were previously sent in response to earlier requests in the stream. - FileDescriptorResponse file_descriptor_response = 4; - - // This message is used to answer all_extension_numbers_of_type requests. - ExtensionNumberResponse all_extension_numbers_response = 5; - - // This message is used to answer list_services requests. - ListServiceResponse list_services_response = 6; - - // This message is used when an error occurs. - ErrorResponse error_response = 7; - } -} - -// Serialized FileDescriptorProto messages sent by the server answering -// a file_by_filename, file_containing_symbol, or file_containing_extension -// request. -message FileDescriptorResponse { - // Serialized FileDescriptorProto messages. We avoid taking a dependency on - // descriptor.proto, which uses proto2 only features, by making them opaque - // bytes instead. - repeated bytes file_descriptor_proto = 1; -} - -// A list of extension numbers sent by the server answering -// all_extension_numbers_of_type request. -message ExtensionNumberResponse { - // Full name of the base type, including the package name. The format - // is <package>.<type> - string base_type_name = 1; - repeated int32 extension_number = 2; -} - -// A list of ServiceResponse sent by the server answering list_services request. -message ListServiceResponse { - // The information of each service may be expanded in the future, so we use - // ServiceResponse message to encapsulate it. - repeated ServiceResponse service = 1; -} - -// The information of a single service used by ListServiceResponse to answer -// list_services request. -message ServiceResponse { - // Full name of a registered service, including its package name. The format - // is <package>.<service> - string name = 1; -} - -// The error code and error message sent by the server when an error occurs. -message ErrorResponse { - // This field uses the error codes defined in grpc::StatusCode. - int32 error_code = 1; - string error_message = 2; -} - diff --git a/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/.yandex_meta/licenses.list.txt deleted file mode 100644 index 3b9a2903ee..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,16 +0,0 @@ -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== - * Copyright 2016 gRPC authors. diff --git a/contrib/libs/grpc/src/proto/grpc/status/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/status/.yandex_meta/licenses.list.txt deleted file mode 100644 index 724b968ab0..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/status/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,16 +0,0 @@ -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== -// Copyright 2016 Google Inc. diff --git a/contrib/libs/grpc/src/proto/grpc/testing/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/testing/.yandex_meta/licenses.list.txt deleted file mode 100644 index e71f54ae94..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,32 +0,0 @@ -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== - * Copyright 2015 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2015-2016 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2016 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2017 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2018 gRPC authors. diff --git a/contrib/libs/grpc/src/proto/grpc/testing/duplicate/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/testing/duplicate/.yandex_meta/licenses.list.txt deleted file mode 100644 index 4a6b5dd2d6..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/duplicate/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,16 +0,0 @@ -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== - * Copyright 2015 gRPC authors. diff --git a/contrib/libs/grpc/src/proto/grpc/testing/proto2/empty2.proto b/contrib/libs/grpc/src/proto/grpc/testing/proto2/empty2.proto deleted file mode 100644 index 666862e6c2..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/proto2/empty2.proto +++ /dev/null @@ -1,22 +0,0 @@ - -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto2"; - -package grpc.testing.proto2; - -message EmptyWithExtensions { - extensions 100 to 999; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/proto2/empty2_extensions.proto b/contrib/libs/grpc/src/proto/grpc/testing/proto2/empty2_extensions.proto deleted file mode 100644 index fca59f68c9..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/proto2/empty2_extensions.proto +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto2"; - -import "src/proto/grpc/testing/proto2/empty2.proto"; - -package grpc.testing.proto2; - -// Fill emptiness with music. -extend grpc.testing.proto2.EmptyWithExtensions { - optional int64 Deadmau5 = 124; - optional float Madeon = 125; - optional string AboveAndBeyond = 126; - optional bool Tycho = 127; - optional fixed64 Pendulum = 128; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/testing/xds/.yandex_meta/licenses.list.txt deleted file mode 100644 index a8fd056f8c..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,24 +0,0 @@ -====================Apache-2.0==================== -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -====================COPYRIGHT==================== -// Copyright 2019 The gRPC Authors - - -====================COPYRIGHT==================== -// Copyright 2020 The gRPC Authors - - -====================COPYRIGHT==================== -// Copyright 2021 The gRPC Authors diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto deleted file mode 100644 index 47efbed8e0..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.core.v3; - -import "google/protobuf/wrappers.proto"; - -// [#protodoc-title: Network addresses] - -// [#next-free-field: 7] -message SocketAddress { - // The address for this socket. :ref:`Listeners <config_listeners>` will bind - // to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::`` - // to bind to any address. [#comment:TODO(zuercher) reinstate when implemented: - // It is possible to distinguish a Listener address via the prefix/suffix matching - // in :ref:`FilterChainMatch <envoy_api_msg_config.listener.v3.FilterChainMatch>`.] When used - // within an upstream :ref:`BindConfig <envoy_api_msg_config.core.v3.BindConfig>`, the address - // controls the source address of outbound connections. For :ref:`clusters - // <envoy_api_msg_config.cluster.v3.Cluster>`, the cluster type determines whether the - // address must be an IP (*STATIC* or *EDS* clusters) or a hostname resolved by DNS - // (*STRICT_DNS* or *LOGICAL_DNS* clusters). Address resolution can be customized - // via :ref:`resolver_name <envoy_api_field_config.core.v3.SocketAddress.resolver_name>`. - string address = 2; - - oneof port_specifier { - uint32 port_value = 3; - } - - // The name of the custom resolver. This must have been registered with Envoy. If - // this is empty, a context dependent default applies. If the address is a concrete - // IP address, no resolution will occur. If address is a hostname this - // should be set for resolution other than DNS. Specifying a custom resolver with - // *STRICT_DNS* or *LOGICAL_DNS* will generate an error at runtime. - string resolver_name = 5; -} - -// Addresses specify either a logical or physical address and port, which are -// used to tell Envoy where to bind/listen, connect to upstream and find -// management servers. -message Address { - oneof address { - SocketAddress socket_address = 1; - } -} - -// CidrRange specifies an IP Address and a prefix length to construct -// the subnet mask for a `CIDR <https://tools.ietf.org/html/rfc4632>`_ range. -message CidrRange { - // IPv4 or IPv6 address, e.g. ``192.0.0.0`` or ``2001:db8::``. - string address_prefix = 1; - - // Length of prefix, e.g. 0, 32. - google.protobuf.UInt32Value prefix_len = 2; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto deleted file mode 100644 index 4688aeedb2..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.service.discovery.v3; - -import "src/proto/grpc/testing/xds/v3/discovery.proto"; - -// [#protodoc-title: Aggregated Discovery Service (ADS)] - -// [#not-implemented-hide:] Discovery services for endpoints, clusters, routes, -// and listeners are retained in the package `envoy.api.v2` for backwards -// compatibility with existing management servers. New development in discovery -// services should proceed in the package `envoy.service.discovery.v2`. - -// See https://github.com/lyft/envoy-api#apis for a description of the role of -// ADS and how it is intended to be used by a management server. ADS requests -// have the same structure as their singleton xDS counterparts, but can -// multiplex many resource types on a single stream. The type_url in the -// DiscoveryRequest/DiscoveryResponse provides sufficient information to recover -// the multiplexed singleton APIs at the Envoy instance and management server. -service AggregatedDiscoveryService { - // This is a gRPC-only API. - rpc StreamAggregatedResources(stream DiscoveryRequest) returns (stream DiscoveryResponse) { - } -} - -// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing -// services: https://github.com/protocolbuffers/protobuf/issues/4221 -message AdsPhony { -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/aggregate_cluster.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/aggregate_cluster.proto deleted file mode 100644 index d14ad350ba..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/aggregate_cluster.proto +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.extensions.clusters.aggregate.v3; - -// Configuration for the aggregate cluster. See the :ref:`architecture overview -// <arch_overview_aggregate_cluster>` for more information. -// [#extension: envoy.clusters.aggregate] -message ClusterConfig { - // Load balancing clusters in aggregate cluster. Clusters are prioritized based on the order they - // appear in this list. - repeated string clusters = 1; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto deleted file mode 100644 index 33719f687c..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.core.v3; - -import "src/proto/grpc/testing/xds/v3/percent.proto"; - -import "google/protobuf/any.proto"; -import "google/protobuf/struct.proto"; - -// Identifies location of where either Envoy runs or where upstream hosts run. -message Locality { - // Region this :ref:`zone <envoy_api_field_config.core.v3.Locality.zone>` belongs to. - string region = 1; - - // Defines the local service zone where Envoy is running. Though optional, it - // should be set if discovery service routing is used and the discovery - // service exposes :ref:`zone data <envoy_api_field_config.endpoint.v3.LocalityLbEndpoints.locality>`, - // either in this message or via :option:`--service-zone`. The meaning of zone - // is context dependent, e.g. `Availability Zone (AZ) - // <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html>`_ - // on AWS, `Zone <https://cloud.google.com/compute/docs/regions-zones/>`_ on - // GCP, etc. - string zone = 2; - - // When used for locality of upstream hosts, this field further splits zone - // into smaller chunks of sub-zones so they can be load balanced - // independently. - string sub_zone = 3; -} - -// Identifies a specific Envoy instance. The node identifier is presented to the -// management server, which may use this identifier to distinguish per Envoy -// configuration for serving. -// [#next-free-field: 12] -message Node { - // An opaque node identifier for the Envoy node. This also provides the local - // service node name. It should be set if any of the following features are - // used: :ref:`statsd <arch_overview_statistics>`, :ref:`CDS - // <config_cluster_manager_cds>`, and :ref:`HTTP tracing - // <arch_overview_tracing>`, either in this message or via - // :option:`--service-node`. - string id = 1; - - // Defines the local service cluster name where Envoy is running. Though - // optional, it should be set if any of the following features are used: - // :ref:`statsd <arch_overview_statistics>`, :ref:`health check cluster - // verification - // <envoy_api_field_config.core.v3.HealthCheck.HttpHealthCheck.service_name_matcher>`, - // :ref:`runtime override directory <envoy_api_msg_config.bootstrap.v3.Runtime>`, - // :ref:`user agent addition - // <envoy_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.add_user_agent>`, - // :ref:`HTTP global rate limiting <config_http_filters_rate_limit>`, - // :ref:`CDS <config_cluster_manager_cds>`, and :ref:`HTTP tracing - // <arch_overview_tracing>`, either in this message or via - // :option:`--service-cluster`. - string cluster = 2; - - // Opaque metadata extending the node identifier. Envoy will pass this - // directly to the management server. - google.protobuf.Struct metadata = 3; - - // Locality specifying where the Envoy instance is running. - Locality locality = 4; - - // Free-form string that identifies the entity requesting config. - // E.g. "envoy" or "grpc" - string user_agent_name = 6; - - oneof user_agent_version_type { - // Free-form string that identifies the version of the entity requesting config. - // E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild" - string user_agent_version = 7; - } - - // Client feature support list. These are well known features described - // in the Envoy API repository for a given major version of an API. Client features - // use reverse DNS naming scheme, for example `com.acme.feature`. - // See :ref:`the list of features <client_features>` that xDS client may - // support. - repeated string client_features = 10; -} - -// Data source consisting of either a file or an inline value. -message DataSource {} - -// Runtime derived FractionalPercent with defaults for when the numerator or denominator is not -// specified via a runtime key. -// -// .. note:: -// -// Parsing of the runtime key's data is implemented such that it may be represented as a -// :ref:`FractionalPercent <envoy_api_msg_type.v3.FractionalPercent>` proto represented as JSON/YAML -// and may also be represented as an integer with the assumption that the value is an integral -// percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse -// as a `FractionalPercent` whose numerator is 42 and denominator is HUNDRED. -message RuntimeFractionalPercent { - // Default value if the runtime value's for the numerator/denominator keys are not available. - type.v3.FractionalPercent default_value = 1; -} - -// Configuration for transport socket in :ref:`listeners <config_listeners>` and -// :ref:`clusters <envoy_api_msg_config.cluster.v3.Cluster>`. If the configuration is -// empty, a default transport socket implementation and configuration will be -// chosen based on the platform and existence of tls_context. -message TransportSocket { - // The name of the transport socket to instantiate. The name must match a supported transport - // socket implementation. - string name = 1; - - // Implementation specific configuration which depends on the implementation being instantiated. - // See the supported transport socket implementations for further documentation. - oneof config_type { - google.protobuf.Any typed_config = 3; - } -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto deleted file mode 100644 index 1bc2d51b50..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.cluster.v3; - -import "src/proto/grpc/testing/xds/v3/base.proto"; -import "src/proto/grpc/testing/xds/v3/config_source.proto"; -import "src/proto/grpc/testing/xds/v3/endpoint.proto"; - -import "google/protobuf/any.proto"; -import "google/protobuf/wrappers.proto"; - -enum RoutingPriority { - DEFAULT = 0; - HIGH = 1; -} - -message CircuitBreakers { - message Thresholds { - RoutingPriority priority = 1; - google.protobuf.UInt32Value max_requests = 4; - } - repeated Thresholds thresholds = 1; -} - -// Extended cluster type. -message CustomClusterType { - // The type of the cluster to instantiate. The name must match a supported cluster type. - string name = 1; - - // Cluster specific configuration which depends on the cluster being instantiated. - // See the supported cluster for further documentation. - google.protobuf.Any typed_config = 2; -} - -// [#protodoc-title: Cluster configuration] - -// Configuration for a single upstream cluster. -// [#next-free-field: 48] -message Cluster { - // Refer to :ref:`service discovery type <arch_overview_service_discovery_types>` - // for an explanation on each type. - enum DiscoveryType { - // Refer to the :ref:`static discovery type<arch_overview_service_discovery_types_static>` - // for an explanation. - STATIC = 0; - - // Refer to the :ref:`strict DNS discovery - // type<arch_overview_service_discovery_types_strict_dns>` - // for an explanation. - STRICT_DNS = 1; - - // Refer to the :ref:`logical DNS discovery - // type<arch_overview_service_discovery_types_logical_dns>` - // for an explanation. - LOGICAL_DNS = 2; - - // Refer to the :ref:`service discovery type<arch_overview_service_discovery_types_eds>` - // for an explanation. - EDS = 3; - - // Refer to the :ref:`original destination discovery - // type<arch_overview_service_discovery_types_original_destination>` - // for an explanation. - ORIGINAL_DST = 4; - } - - // Refer to :ref:`load balancer type <arch_overview_load_balancing_types>` architecture - // overview section for information on each type. - enum LbPolicy { - reserved 4; - - reserved "ORIGINAL_DST_LB"; - - // Refer to the :ref:`round robin load balancing - // policy<arch_overview_load_balancing_types_round_robin>` - // for an explanation. - ROUND_ROBIN = 0; - - // Refer to the :ref:`least request load balancing - // policy<arch_overview_load_balancing_types_least_request>` - // for an explanation. - LEAST_REQUEST = 1; - - // Refer to the :ref:`ring hash load balancing - // policy<arch_overview_load_balancing_types_ring_hash>` - // for an explanation. - RING_HASH = 2; - - // Refer to the :ref:`random load balancing - // policy<arch_overview_load_balancing_types_random>` - // for an explanation. - RANDOM = 3; - - // Refer to the :ref:`Maglev load balancing policy<arch_overview_load_balancing_types_maglev>` - // for an explanation. - MAGLEV = 5; - - // This load balancer type must be specified if the configured cluster provides a cluster - // specific load balancer. Consult the configured cluster's documentation for whether to set - // this option or not. - CLUSTER_PROVIDED = 6; - - // [#not-implemented-hide:] Use the new :ref:`load_balancing_policy - // <envoy_api_field_config.cluster.v3.Cluster.load_balancing_policy>` field to determine the LB policy. - // [#next-major-version: In the v3 API, we should consider deprecating the lb_policy field - // and instead using the new load_balancing_policy field as the one and only mechanism for - // configuring this.] - LOAD_BALANCING_POLICY_CONFIG = 7; - } - - // Only valid when discovery type is EDS. - message EdsClusterConfig { - // Configuration for the source of EDS updates for this Cluster. - core.v3.ConfigSource eds_config = 1; - - // Optional alternative to cluster name to present to EDS. This does not - // have the same restrictions as cluster name, i.e. it may be arbitrary - // length. - string service_name = 2; - } - - // Supplies the name of the cluster which must be unique across all clusters. - // The cluster name is used when emitting - // :ref:`statistics <config_cluster_manager_cluster_stats>` if :ref:`alt_stat_name - // <envoy_api_field_config.cluster.v3.Cluster.alt_stat_name>` is not provided. - // Any ``:`` in the cluster name will be converted to ``_`` when emitting statistics. - string name = 1; - - oneof cluster_discovery_type { - // The :ref:`service discovery type <arch_overview_service_discovery_types>` - // to use for resolving the cluster. - DiscoveryType type = 2; - - // The custom cluster type. - CustomClusterType cluster_type = 38; - } - - // Configuration to use for EDS updates for the Cluster. - EdsClusterConfig eds_cluster_config = 3; - - // Specific configuration for the :ref:`RingHash<arch_overview_load_balancing_types_ring_hash>` - // load balancing policy. - message RingHashLbConfig { - // The hash function used to hash hosts onto the ketama ring. - enum HashFunction { - // Use `xxHash <https://github.com/Cyan4973/xxHash>`_, this is the default hash function. - XX_HASH = 0; - MURMUR_HASH_2 = 1; - } - - reserved 2; - - // Minimum hash ring size. The larger the ring is (that is, the more hashes there are for each - // provided host) the better the request distribution will reflect the desired weights. Defaults - // to 1024 entries, and limited to 8M entries. See also - // :ref:`maximum_ring_size<envoy_api_field_config.cluster.v3.Cluster.RingHashLbConfig.maximum_ring_size>`. - google.protobuf.UInt64Value minimum_ring_size = 1; - - // The hash function used to hash hosts onto the ketama ring. The value defaults to - // :ref:`XX_HASH<envoy_api_enum_value_config.cluster.v3.Cluster.RingHashLbConfig.HashFunction.XX_HASH>`. - HashFunction hash_function = 3; - - // Maximum hash ring size. Defaults to 8M entries, and limited to 8M entries, but can be lowered - // to further constrain resource use. See also - // :ref:`minimum_ring_size<envoy_api_field_config.cluster.v3.Cluster.RingHashLbConfig.minimum_ring_size>`. - google.protobuf.UInt64Value maximum_ring_size = 4; - } - - // The :ref:`load balancer type <arch_overview_load_balancing_types>` to use - // when picking a host in the cluster. - LbPolicy lb_policy = 6; - - // Setting this is required for specifying members of - // :ref:`STATIC<envoy_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STATIC>`, - // :ref:`STRICT_DNS<envoy_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>` - // or :ref:`LOGICAL_DNS<envoy_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` clusters. - // This field supersedes the *hosts* field in the v2 API. - // - // .. attention:: - // - // Setting this allows non-EDS cluster types to contain embedded EDS equivalent - // :ref:`endpoint assignments<envoy_api_msg_config.endpoint.v3.ClusterLoadAssignment>`. - // - endpoint.v3.ClusterLoadAssignment load_assignment = 33; - - CircuitBreakers circuit_breakers = 10; - - // Optional configuration for the load balancing algorithm selected by - // LbPolicy. Currently only - // :ref:`RING_HASH<envoy_api_enum_value_config.cluster.v3.Cluster.LbPolicy.RING_HASH>`, - // Specifying ring_hash_lb_config without setting the corresponding - // LbPolicy will generate an error at runtime. - oneof lb_config { - // Optional configuration for the Ring Hash load balancing policy. - RingHashLbConfig ring_hash_lb_config = 23; - } - - // Optional custom transport socket implementation to use for upstream connections. - // To setup TLS, set a transport socket with name `tls` and - // :ref:`UpstreamTlsContexts <envoy_api_msg_extensions.transport_sockets.tls.v3.UpstreamTlsContext>` in the `typed_config`. - // If no transport socket configuration is specified, new connections - // will be set up with plaintext. - core.v3.TransportSocket transport_socket = 24; - - // [#not-implemented-hide:] - // If present, tells the client where to send load reports via LRS. If not present, the - // client will fall back to a client-side default, which may be either (a) don't send any - // load reports or (b) send load reports for all clusters to a single default server - // (which may be configured in the bootstrap file). - // - // Note that if multiple clusters point to the same LRS server, the client may choose to - // create a separate stream for each cluster or it may choose to coalesce the data for - // multiple clusters onto a single stream. Either way, the client must make sure to send - // the data for any given cluster on no more than one stream. - // - // [#next-major-version: In the v3 API, we should consider restructuring this somehow, - // maybe by allowing LRS to go on the ADS stream, or maybe by moving some of the negotiation - // from the LRS stream here.] - core.v3.ConfigSource lrs_server = 42; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_dump.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_dump.proto deleted file mode 100644 index d69b3109aa..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_dump.proto +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright 2021 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.admin.v3; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; - -// Resource status from the view of a xDS client, which tells the synchronization -// status between the xDS client and the xDS server. -enum ClientResourceStatus { - // Resource status is not available/unknown. - UNKNOWN = 0; - - // Client requested this resource but hasn't received any update from management - // server. The client will not fail requests, but will queue them until update - // arrives or the client times out waiting for the resource. - REQUESTED = 1; - - // This resource has been requested by the client but has either not been - // delivered by the server or was previously delivered by the server and then - // subsequently removed from resources provided by the server. For more - // information, please refer to the :ref:`"Knowing When a Requested Resource - // Does Not Exist" <xds_protocol_resource_not_existed>` section. - DOES_NOT_EXIST = 2; - - // Client received this resource and replied with ACK. - ACKED = 3; - - // Client received this resource and replied with NACK. - NACKED = 4; -} - -message UpdateFailureState { - // What the component configuration would have been if the update had succeeded. - // This field may not be populated by xDS clients due to storage overhead. - google.protobuf.Any failed_configuration = 1; - - // Time of the latest failed update attempt. - google.protobuf.Timestamp last_update_attempt = 2; - - // Details about the last failed update attempt. - string details = 3; - - // This is the version of the rejected resource. - // [#not-implemented-hide:] - string version_info = 4; -} - -// Envoy's listener manager fills this message with all currently known listeners. Listener -// configuration information can be used to recreate an Envoy configuration by populating all -// listeners as static listeners or by returning them in a LDS response. -message ListenersConfigDump { - // Describes a statically loaded listener. - message StaticListener { - // The listener config. - google.protobuf.Any listener = 1; - - // The timestamp when the Listener was last successfully updated. - google.protobuf.Timestamp last_updated = 2; - } - - message DynamicListenerState { - // This is the per-resource version information. This version is currently taken from the - // :ref:`version_info <envoy_api_field_service.discovery.v3.DiscoveryResponse.version_info>` field at the time - // that the listener was loaded. In the future, discrete per-listener versions may be supported - // by the API. - string version_info = 1; - - // The listener config. - google.protobuf.Any listener = 2; - - // The timestamp when the Listener was last successfully updated. - google.protobuf.Timestamp last_updated = 3; - } - - // Describes a dynamically loaded listener via the LDS API. - // [#next-free-field: 7] - message DynamicListener { - // The name or unique id of this listener, pulled from the DynamicListenerState config. - string name = 1; - - // The listener state for any active listener by this name. - // These are listeners that are available to service data plane traffic. - DynamicListenerState active_state = 2; - - // The listener state for any warming listener by this name. - // These are listeners that are currently undergoing warming in preparation to service data - // plane traffic. Note that if attempting to recreate an Envoy configuration from a - // configuration dump, the warming listeners should generally be discarded. - DynamicListenerState warming_state = 3; - - // The listener state for any draining listener by this name. - // These are listeners that are currently undergoing draining in preparation to stop servicing - // data plane traffic. Note that if attempting to recreate an Envoy configuration from a - // configuration dump, the draining listeners should generally be discarded. - DynamicListenerState draining_state = 4; - - // Set if the last update failed, cleared after the next successful update. - // The *error_state* field contains the rejected version of this particular - // resource along with the reason and timestamp. For successfully updated or - // acknowledged resource, this field should be empty. - UpdateFailureState error_state = 5; - - // The client status of this resource. - // [#not-implemented-hide:] - ClientResourceStatus client_status = 6; - } - - // This is the :ref:`version_info <envoy_api_field_service.discovery.v3.DiscoveryResponse.version_info>` in the - // last processed LDS discovery response. If there are only static bootstrap listeners, this field - // will be "". - string version_info = 1; - - // The statically loaded listener configs. - repeated StaticListener static_listeners = 2; - - // State for any warming, active, or draining listeners. - repeated DynamicListener dynamic_listeners = 3; -} - -// Envoy's cluster manager fills this message with all currently known clusters. Cluster -// configuration information can be used to recreate an Envoy configuration by populating all -// clusters as static clusters or by returning them in a CDS response. -message ClustersConfigDump { - // Describes a statically loaded cluster. - message StaticCluster { - // The cluster config. - google.protobuf.Any cluster = 1; - - // The timestamp when the Cluster was last updated. - google.protobuf.Timestamp last_updated = 2; - } - - // Describes a dynamically loaded cluster via the CDS API. - // [#next-free-field: 6] - message DynamicCluster { - // This is the per-resource version information. This version is currently taken from the - // :ref:`version_info <envoy_api_field_service.discovery.v3.DiscoveryResponse.version_info>` field at the time - // that the cluster was loaded. In the future, discrete per-cluster versions may be supported by - // the API. - string version_info = 1; - - // The cluster config. - google.protobuf.Any cluster = 2; - - // The timestamp when the Cluster was last updated. - google.protobuf.Timestamp last_updated = 3; - - // Set if the last update failed, cleared after the next successful update. - // The *error_state* field contains the rejected version of this particular - // resource along with the reason and timestamp. For successfully updated or - // acknowledged resource, this field should be empty. - // [#not-implemented-hide:] - UpdateFailureState error_state = 4; - - // The client status of this resource. - // [#not-implemented-hide:] - ClientResourceStatus client_status = 5; - } - - // This is the :ref:`version_info <envoy_api_field_service.discovery.v3.DiscoveryResponse.version_info>` in the - // last processed CDS discovery response. If there are only static bootstrap clusters, this field - // will be "". - string version_info = 1; - - // The statically loaded cluster configs. - repeated StaticCluster static_clusters = 2; - - // The dynamically loaded active clusters. These are clusters that are available to service - // data plane traffic. - repeated DynamicCluster dynamic_active_clusters = 3; - - // The dynamically loaded warming clusters. These are clusters that are currently undergoing - // warming in preparation to service data plane traffic. Note that if attempting to recreate an - // Envoy configuration from a configuration dump, the warming clusters should generally be - // discarded. - repeated DynamicCluster dynamic_warming_clusters = 4; -} - -// Envoy's RDS implementation fills this message with all currently loaded routes, as described by -// their RouteConfiguration objects. Static routes that are either defined in the bootstrap configuration -// or defined inline while configuring listeners are separated from those configured dynamically via RDS. -// Route configuration information can be used to recreate an Envoy configuration by populating all routes -// as static routes or by returning them in RDS responses. -message RoutesConfigDump { - message StaticRouteConfig { - // The route config. - google.protobuf.Any route_config = 1; - - // The timestamp when the Route was last updated. - google.protobuf.Timestamp last_updated = 2; - } - - // [#next-free-field: 6] - message DynamicRouteConfig { - // This is the per-resource version information. This version is currently taken from the - // :ref:`version_info <envoy_api_field_service.discovery.v3.DiscoveryResponse.version_info>` field at the time that - // the route configuration was loaded. - string version_info = 1; - - // The route config. - google.protobuf.Any route_config = 2; - - // The timestamp when the Route was last updated. - google.protobuf.Timestamp last_updated = 3; - - // Set if the last update failed, cleared after the next successful update. - // The *error_state* field contains the rejected version of this particular - // resource along with the reason and timestamp. For successfully updated or - // acknowledged resource, this field should be empty. - // [#not-implemented-hide:] - UpdateFailureState error_state = 4; - - // The client status of this resource. - // [#not-implemented-hide:] - ClientResourceStatus client_status = 5; - } - - // The statically loaded route configs. - repeated StaticRouteConfig static_route_configs = 2; - - // The dynamically loaded route configs. - repeated DynamicRouteConfig dynamic_route_configs = 3; -} - -// Envoy's admin fill this message with all currently known endpoints. Endpoint -// configuration information can be used to recreate an Envoy configuration by populating all -// endpoints as static endpoints or by returning them in an EDS response. -message EndpointsConfigDump { - message StaticEndpointConfig { - // The endpoint config. - google.protobuf.Any endpoint_config = 1; - - // [#not-implemented-hide:] The timestamp when the Endpoint was last updated. - google.protobuf.Timestamp last_updated = 2; - } - - // [#next-free-field: 6] - message DynamicEndpointConfig { - // [#not-implemented-hide:] This is the per-resource version information. This version is currently taken from the - // :ref:`version_info <envoy_api_field_service.discovery.v3.DiscoveryResponse.version_info>` field at the time that - // the endpoint configuration was loaded. - string version_info = 1; - - // The endpoint config. - google.protobuf.Any endpoint_config = 2; - - // [#not-implemented-hide:] The timestamp when the Endpoint was last updated. - google.protobuf.Timestamp last_updated = 3; - - // Set if the last update failed, cleared after the next successful update. - // The *error_state* field contains the rejected version of this particular - // resource along with the reason and timestamp. For successfully updated or - // acknowledged resource, this field should be empty. - // [#not-implemented-hide:] - UpdateFailureState error_state = 4; - - // The client status of this resource. - // [#not-implemented-hide:] - ClientResourceStatus client_status = 5; - } - - // The statically loaded endpoint configs. - repeated StaticEndpointConfig static_endpoint_configs = 2; - - // The dynamically loaded endpoint configs. - repeated DynamicEndpointConfig dynamic_endpoint_configs = 3; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_source.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_source.proto deleted file mode 100644 index 487b79c00a..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_source.proto +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.core.v3; - -// [#protodoc-title: Configuration sources] - -// Aggregated Discovery Service (ADS) options. This is currently empty, but when -// set in :ref:`ConfigSource <envoy_api_msg_config.core.v3.ConfigSource>` can be used to -// specify that ADS is to be used. -message AggregatedConfigSource { -} - -// [#not-implemented-hide:] -// Self-referencing config source options. This is currently empty, but when -// set in :ref:`ConfigSource <envoy_api_msg_config.core.v3.ConfigSource>` can be used to -// specify that other data can be obtained from the same server. -message SelfConfigSource { -} - -// Configuration for :ref:`listeners <config_listeners>`, :ref:`clusters -// <config_cluster_manager>`, :ref:`routes -// <envoy_api_msg_config.route.v3.RouteConfiguration>`, :ref:`endpoints -// <arch_overview_service_discovery>` etc. may either be sourced from the -// filesystem or from an xDS API source. Filesystem configs are watched with -// inotify for updates. -// [#next-free-field: 7] -message ConfigSource { - oneof config_source_specifier { - // Path on the filesystem to source and watch for configuration updates. - // When sourcing configuration for :ref:`secret <envoy_api_msg_extensions.transport_sockets.tls.v3.Secret>`, - // the certificate and key files are also watched for updates. - // - // .. note:: - // - // The path to the source must exist at config load time. - // - // .. note:: - // - // Envoy will only watch the file path for *moves.* This is because in general only moves - // are atomic. The same method of swapping files as is demonstrated in the - // :ref:`runtime documentation <config_runtime_symbolic_link_swap>` can be used here also. - string path = 1; - - // When set, ADS will be used to fetch resources. The ADS API configuration - // source in the bootstrap configuration is used. - AggregatedConfigSource ads = 3; - - // [#not-implemented-hide:] - // When set, the client will access the resources from the same server it got the - // ConfigSource from, although not necessarily from the same stream. This is similar to the - // :ref:`ads<envoy_api_field.ConfigSource.ads>` field, except that the client may use a - // different stream to the same server. As a result, this field can be used for things - // like LRS that cannot be sent on an ADS stream. It can also be used to link from (e.g.) - // LDS to RDS on the same server without requiring the management server to know its name - // or required credentials. - // [#next-major-version: In xDS v3, consider replacing the ads field with this one, since - // this field can implicitly mean to use the same stream in the case where the ConfigSource - // is provided via ADS and the specified data can also be obtained via ADS.] - SelfConfigSource self = 5; - } -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/csds.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/csds.proto deleted file mode 100644 index 79b8bc8b64..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/csds.proto +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2021 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.service.status.v3; - -import "src/proto/grpc/testing/xds/v3/config_dump.proto"; -import "src/proto/grpc/testing/xds/v3/base.proto"; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; - - -// CSDS is Client Status Discovery Service. It can be used to get the status of -// an xDS-compliant client from the management server's point of view. It can -// also be used to get the current xDS states directly from the client. -service ClientStatusDiscoveryService { - rpc StreamClientStatus(stream ClientStatusRequest) returns (stream ClientStatusResponse) {} - rpc FetchClientStatus(ClientStatusRequest) returns (ClientStatusResponse) {} -} - -// Status of a config from a management server view. -enum ConfigStatus { - // Status info is not available/unknown. - UNKNOWN = 0; - - // Management server has sent the config to client and received ACK. - SYNCED = 1; - - // Config is not sent. - NOT_SENT = 2; - - // Management server has sent the config to client but hasn’t received - // ACK/NACK. - STALE = 3; - - // Management server has sent the config to client but received NACK. The - // attached config dump will be the latest config (the rejected one), since - // it is the persisted version in the management server. - ERROR = 4; -} - -// Request for client status of clients identified by a list of NodeMatchers. -message ClientStatusRequest { - // The node making the csds request. - config.core.v3.Node node = 2; -} - -// Detailed config (per xDS) with status. -// [#next-free-field: 8] -message PerXdsConfig { - // Config status generated by management servers. Will not be present if the - // CSDS server is an xDS client. - ConfigStatus status = 1; - - oneof per_xds_config { - admin.v3.ListenersConfigDump listener_config = 2; - - admin.v3.ClustersConfigDump cluster_config = 3; - - admin.v3.RoutesConfigDump route_config = 4; - - admin.v3.EndpointsConfigDump endpoint_config = 6; - } -} - -// All xds configs for a particular client. -message ClientConfig { - // GenericXdsConfig is used to specify the config status and the dump - // of any xDS resource identified by their type URL. It is the generalized - // version of the now deprecated ListenersConfigDump, ClustersConfigDump etc - // [#next-free-field: 10] - message GenericXdsConfig { - // Type_url represents the fully qualified name of xDS resource type - // like envoy.v3.Cluster, envoy.v3.ClusterLoadAssignment etc. - string type_url = 1; - - // Name of the xDS resource - string name = 2; - - // This is the :ref:`version_info <envoy_v3_api_field_service.discovery.v3.DiscoveryResponse.version_info>` - // in the last processed xDS discovery response. If there are only - // static bootstrap listeners, this field will be "" - string version_info = 3; - - // The xDS resource config. Actual content depends on the type - google.protobuf.Any xds_config = 4; - - // Timestamp when the xDS resource was last updated - google.protobuf.Timestamp last_updated = 5; - - // Per xDS resource config status. It is generated by management servers. - // It will not be present if the CSDS server is an xDS client. - ConfigStatus config_status = 6; - - // Per xDS resource status from the view of a xDS client - admin.v3.ClientResourceStatus client_status = 7; - - // Set if the last update failed, cleared after the next successful - // update. The *error_state* field contains the rejected version of - // this particular resource along with the reason and timestamp. For - // successfully updated or acknowledged resource, this field should - // be empty. - admin.v3.UpdateFailureState error_state = 8; - - // Is static resource is true if it is specified in the config supplied - // through the file at the startup. - bool is_static_resource = 9; - } - - // Node for a particular client. - config.core.v3.Node node = 1; - - // This field is deprecated in favor of generic_xds_configs which is - // much simpler and uniform in structure. - repeated PerXdsConfig xds_config = 2 [deprecated = true]; - - // Represents generic xDS config and the exact config structure depends on - // the type URL (like Cluster if it is CDS) - repeated GenericXdsConfig generic_xds_configs = 3; -} - -message ClientStatusResponse { - // Client configs for the clients specified in the ClientStatusRequest. - repeated ClientConfig config = 1; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/discovery.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/discovery.proto deleted file mode 100644 index 2a697d9648..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/discovery.proto +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.service.discovery.v3; - -import "src/proto/grpc/testing/xds/v3/base.proto"; - -import "google/protobuf/any.proto"; - -message Status { - // The status code, which should be an enum value of [google.rpc.Code][]. - int32 code = 1; - - // A developer-facing error message, which should be in English. Any - // user-facing error message should be localized and sent in the - // [google.rpc.Status.details][] field, or localized by the client. - string message = 2; - - // A list of messages that carry the error details. There is a common set of - // message types for APIs to use. - repeated google.protobuf.Any details = 3; -} - -// [#protodoc-title: Common discovery API components] - -// A DiscoveryRequest requests a set of versioned resources of the same type for -// a given Envoy node on some API. -// [#next-free-field: 7] -message DiscoveryRequest { - // The version_info provided in the request messages will be the version_info - // received with the most recent successfully processed response or empty on - // the first request. It is expected that no new request is sent after a - // response is received until the Envoy instance is ready to ACK/NACK the new - // configuration. ACK/NACK takes place by returning the new API config version - // as applied or the previous API config version respectively. Each type_url - // (see below) has an independent version associated with it. - string version_info = 1; - - // The node making the request. - config.core.v3.Node node = 2; - - // List of resources to subscribe to, e.g. list of cluster names or a route - // configuration name. If this is empty, all resources for the API are - // returned. LDS/CDS may have empty resource_names, which will cause all - // resources for the Envoy instance to be returned. The LDS and CDS responses - // will then imply a number of resources that need to be fetched via EDS/RDS, - // which will be explicitly enumerated in resource_names. - repeated string resource_names = 3; - - // Type of the resource that is being requested, e.g. - // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit - // in requests made via singleton xDS APIs such as CDS, LDS, etc. but is - // required for ADS. - string type_url = 4; - - // nonce corresponding to DiscoveryResponse being ACK/NACKed. See above - // discussion on version_info and the DiscoveryResponse nonce comment. This - // may be empty only if 1) this is a non-persistent-stream xDS such as HTTP, - // or 2) the client has not yet accepted an update in this xDS stream (unlike - // delta, where it is populated only for new explicit ACKs). - string response_nonce = 5; - - // This is populated when the previous :ref:`DiscoveryResponse <envoy_api_msg_service.discovery.v3.DiscoveryResponse>` - // failed to update configuration. The *message* field in *error_details* provides the Envoy - // internal exception related to the failure. It is only intended for consumption during manual - // debugging, the string provided is not guaranteed to be stable across Envoy versions. - Status error_detail = 6; -} - -// [#next-free-field: 7] -message DiscoveryResponse { - // The version of the response data. - string version_info = 1; - - // The response resources. These resources are typed and depend on the API being called. - repeated google.protobuf.Any resources = 2; - - // [#not-implemented-hide:] - // Canary is used to support two Envoy command line flags: - // - // * --terminate-on-canary-transition-failure. When set, Envoy is able to - // terminate if it detects that configuration is stuck at canary. Consider - // this example sequence of updates: - // - Management server applies a canary config successfully. - // - Management server rolls back to a production config. - // - Envoy rejects the new production config. - // Since there is no sensible way to continue receiving configuration - // updates, Envoy will then terminate and apply production config from a - // clean slate. - // * --dry-run-canary. When set, a canary response will never be applied, only - // validated via a dry run. - bool canary = 3; - - // Type URL for resources. Identifies the xDS API when muxing over ADS. - // Must be consistent with the type_url in the 'resources' repeated Any (if non-empty). - string type_url = 4; - - // For gRPC based subscriptions, the nonce provides a way to explicitly ack a - // specific DiscoveryResponse in a following DiscoveryRequest. Additional - // messages may have been sent by Envoy to the management server for the - // previous version on the stream prior to this DiscoveryResponse, that were - // unprocessed at response send time. The nonce allows the management server - // to ignore any further DiscoveryRequests for the previous version until a - // DiscoveryRequest bearing the nonce. The nonce is optional and is not - // required for non-stream based xDS implementations. - string nonce = 5; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto deleted file mode 100644 index 7cbea7f443..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.endpoint.v3; - -import "src/proto/grpc/testing/xds/v3/address.proto"; -import "src/proto/grpc/testing/xds/v3/base.proto"; -import "src/proto/grpc/testing/xds/v3/percent.proto"; - -import "google/protobuf/wrappers.proto"; - -// [#protodoc-title: Endpoints] - -// Endpoint health status. -enum HealthStatus { - // The health status is not known. This is interpreted by Envoy as *HEALTHY*. - UNKNOWN = 0; - - // Healthy. - HEALTHY = 1; - - // Unhealthy. - UNHEALTHY = 2; - - // Connection draining in progress. E.g., - // `<https://aws.amazon.com/blogs/aws/elb-connection-draining-remove-instances-from-service-with-care/>`_ - // or - // `<https://cloud.google.com/compute/docs/load-balancing/enabling-connection-draining>`_. - // This is interpreted by Envoy as *UNHEALTHY*. - DRAINING = 3; - - // Health check timed out. This is part of HDS and is interpreted by Envoy as - // *UNHEALTHY*. - TIMEOUT = 4; - - // Degraded. - DEGRADED = 5; -} - -// Upstream host identifier. -message Endpoint { - // The upstream host address. - // - // .. attention:: - // - // The form of host address depends on the given cluster type. For STATIC or EDS, - // it is expected to be a direct IP address (or something resolvable by the - // specified :ref:`resolver <envoy_api_field_config.core.v3.SocketAddress.resolver_name>` - // in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, - // and will be resolved via DNS. - core.v3.Address address = 1; -} - -// An Endpoint that Envoy can route traffic to. -// [#next-free-field: 6] -message LbEndpoint { - // Upstream host identifier or a named reference. - oneof host_identifier { - Endpoint endpoint = 1; - } - - // Optional health status when known and supplied by EDS server. - HealthStatus health_status = 2; - - // The optional load balancing weight of the upstream host; at least 1. - // Envoy uses the load balancing weight in some of the built in load - // balancers. The load balancing weight for an endpoint is divided by the sum - // of the weights of all endpoints in the endpoint's locality to produce a - // percentage of traffic for the endpoint. This percentage is then further - // weighted by the endpoint's locality's load balancing weight from - // LocalityLbEndpoints. If unspecified, each host is presumed to have equal - // weight in a locality. The sum of the weights of all endpoints in the - // endpoint's locality must not exceed uint32_t maximal value (4294967295). - google.protobuf.UInt32Value load_balancing_weight = 4; -} - -// A group of endpoints belonging to a Locality. -// One can have multiple LocalityLbEndpoints for a locality, but this is -// generally only done if the different groups need to have different load -// balancing weights or different priorities. -// [#next-free-field: 7] -message LocalityLbEndpoints { - // Identifies location of where the upstream hosts run. - core.v3.Locality locality = 1; - - // The group of endpoints belonging to the locality specified. - repeated LbEndpoint lb_endpoints = 2; - - // Optional: Per priority/region/zone/sub_zone weight; at least 1. The load - // balancing weight for a locality is divided by the sum of the weights of all - // localities at the same priority level to produce the effective percentage - // of traffic for the locality. The sum of the weights of all localities at - // the same priority level must not exceed uint32_t maximal value (4294967295). - // - // Locality weights are only considered when :ref:`locality weighted load - // balancing <arch_overview_load_balancing_locality_weighted_lb>` is - // configured. These weights are ignored otherwise. If no weights are - // specified when locality weighted load balancing is enabled, the locality is - // assigned no load. - google.protobuf.UInt32Value load_balancing_weight = 3; - - // Optional: the priority for this LocalityLbEndpoints. If unspecified this will - // default to the highest priority (0). - // - // Under usual circumstances, Envoy will only select endpoints for the highest - // priority (0). In the event all endpoints for a particular priority are - // unavailable/unhealthy, Envoy will fail over to selecting endpoints for the - // next highest priority group. - // - // Priorities should range from 0 (highest) to N (lowest) without skipping. - uint32 priority = 5; -} - -// [#protodoc-title: Endpoint configuration] -// Endpoint discovery :ref:`architecture overview <arch_overview_service_discovery_types_eds>` - -// Each route from RDS will map to a single cluster or traffic split across -// clusters using weights expressed in the RDS WeightedCluster. -// -// With EDS, each cluster is treated independently from a LB perspective, with -// LB taking place between the Localities within a cluster and at a finer -// granularity between the hosts within a locality. The percentage of traffic -// for each endpoint is determined by both its load_balancing_weight, and the -// load_balancing_weight of its locality. First, a locality will be selected, -// then an endpoint within that locality will be chose based on its weight. -// [#next-free-field: 6] -message ClusterLoadAssignment { - // Load balancing policy settings. - // [#next-free-field: 6] - message Policy { - message DropOverload { - // Identifier for the policy specifying the drop. - string category = 1; - - // Percentage of traffic that should be dropped for the category. - type.v3.FractionalPercent drop_percentage = 2; - } - - // Action to trim the overall incoming traffic to protect the upstream - // hosts. This action allows protection in case the hosts are unable to - // recover from an outage, or unable to autoscale or unable to handle - // incoming traffic volume for any reason. - // - // At the client each category is applied one after the other to generate - // the 'actual' drop percentage on all outgoing traffic. For example: - // - // .. code-block:: json - // - // { "drop_overloads": [ - // { "category": "throttle", "drop_percentage": 60 } - // { "category": "lb", "drop_percentage": 50 } - // ]} - // - // The actual drop percentages applied to the traffic at the clients will be - // "throttle"_drop = 60% - // "lb"_drop = 20% // 50% of the remaining 'actual' load, which is 40%. - // actual_outgoing_load = 20% // remaining after applying all categories. - repeated DropOverload drop_overloads = 2; - } - - // Name of the cluster. This will be the :ref:`service_name - // <envoy_api_field_config.cluster.v3.Cluster.EdsClusterConfig.service_name>` value if specified - // in the cluster :ref:`EdsClusterConfig - // <envoy_api_msg_config.cluster.v3.Cluster.EdsClusterConfig>`. - string cluster_name = 1; - - // List of endpoints to load balance to. - repeated LocalityLbEndpoints endpoints = 2; - - // Load balancing policy settings. - Policy policy = 4; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/extension.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/extension.proto deleted file mode 100644 index 10f4b00208..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/extension.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.core.v3; - -import "google/protobuf/any.proto"; - -// [#protodoc-title: Extension configuration] - -// Message type for extension configuration. -// [#next-major-version: revisit all existing typed_config that doesn't use this wrapper.]. -message TypedExtensionConfig { - // The name of an extension. This is not used to select the extension, instead - // it serves the role of an opaque identifier. - string name = 1; - - // The typed config for the extension. The type URL will be used to identify - // the extension. In the case that the type URL is *udpa.type.v1.TypedStruct*, - // the inner type URL of *TypedStruct* will be utilized. See the - // :ref:`extension configuration overview - // <config_overview_extension_configuration>` for further details. - google.protobuf.Any typed_config = 2; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/fault.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/fault.proto deleted file mode 100644 index 05ec641d0e..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/fault.proto +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.extensions.filters.http.fault.v3; - -import "src/proto/grpc/testing/xds/v3/fault_common.proto"; -import "src/proto/grpc/testing/xds/v3/route.proto"; -import "src/proto/grpc/testing/xds/v3/percent.proto"; - -import "google/protobuf/wrappers.proto"; - -// [#protodoc-title: Fault Injection] -// Fault Injection :ref:`configuration overview <config_http_filters_fault_injection>`. -// [#extension: envoy.filters.http.fault] - -// [#next-free-field: 6] -message FaultAbort { - // Fault aborts are controlled via an HTTP header (if applicable). See the - // :ref:`HTTP fault filter <config_http_filters_fault_injection_http_header>` documentation for - // more information. - message HeaderAbort { - } - - reserved 1; - - oneof error_type { - // HTTP status code to use to abort the HTTP request. - uint32 http_status = 2; - - // gRPC status code to use to abort the gRPC request. - uint32 grpc_status = 5; - - // Fault aborts are controlled via an HTTP header (if applicable). - HeaderAbort header_abort = 4; - } - - // The percentage of requests/operations/connections that will be aborted with the error code - // provided. - type.v3.FractionalPercent percentage = 3; -} - -// [#next-free-field: 15] -message HTTPFault { - // If specified, the filter will inject delays based on the values in the - // object. - common.fault.v3.FaultDelay delay = 1; - - // If specified, the filter will abort requests based on the values in - // the object. At least *abort* or *delay* must be specified. - FaultAbort abort = 2; - - // Specifies a set of headers that the filter should match on. The fault - // injection filter can be applied selectively to requests that match a set of - // headers specified in the fault filter config. The chances of actual fault - // injection further depend on the value of the :ref:`percentage - // <envoy_api_field_extensions.filters.http.fault.v3.FaultAbort.percentage>` field. - // The filter will check the request's headers against all the specified - // headers in the filter config. A match will happen if all the headers in the - // config are present in the request with the same values (or based on - // presence if the *value* field is not in the config). - repeated config.route.v3.HeaderMatcher headers = 4; - - // The maximum number of faults that can be active at a single time via the configured fault - // filter. Note that because this setting can be overridden at the route level, it's possible - // for the number of active faults to be greater than this value (if injected via a different - // route). If not specified, defaults to unlimited. This setting can be overridden via - // `runtime <config_http_filters_fault_injection_runtime>` and any faults that are not injected - // due to overflow will be indicated via the `faults_overflow - // <config_http_filters_fault_injection_stats>` stat. - // - // .. attention:: - // Like other :ref:`circuit breakers <arch_overview_circuit_break>` in Envoy, this is a fuzzy - // limit. It's possible for the number of active faults to rise slightly above the configured - // amount due to the implementation details. - google.protobuf.UInt32Value max_active_faults = 6; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/fault_common.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/fault_common.proto deleted file mode 100644 index 2c2aedc789..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/fault_common.proto +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.extensions.filters.common.fault.v3; - -import "src/proto/grpc/testing/xds/v3/percent.proto"; - -import "google/protobuf/duration.proto"; - -// Delay specification is used to inject latency into the -// HTTP/gRPC/Mongo/Redis operation or delay proxying of TCP connections. -message FaultDelay { - // Fault delays are controlled via an HTTP header (if applicable). See the - // :ref:`HTTP fault filter <config_http_filters_fault_injection_http_header>` - // documentation for more information. - message HeaderDelay {} - - oneof fault_delay_secifier { - // Add a fixed delay before forwarding the operation upstream. See - // https://developers.google.com/protocol-buffers/docs/proto3#json for - // the JSON/YAML Duration mapping. For HTTP/Mongo/Redis, the specified - // delay will be injected before a new request/operation. For TCP - // connections, the proxying of the connection upstream will be delayed - // for the specified period. This is required if type is FIXED. - google.protobuf.Duration fixed_delay = 3; - - // Fault delays are controlled via an HTTP header (if applicable). - HeaderDelay header_delay = 5; - } - - // The percentage of operations/connections/requests on which the delay will - // be injected. - type.v3.FractionalPercent percentage = 4; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto deleted file mode 100644 index 74477073c7..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.extensions.filters.network.http_connection_manager.v3; - -import "google/protobuf/any.proto"; - -import "src/proto/grpc/testing/xds/v3/config_source.proto"; -import "src/proto/grpc/testing/xds/v3/protocol.proto"; -import "src/proto/grpc/testing/xds/v3/route.proto"; - -// [#protodoc-title: HTTP connection manager] -// HTTP connection manager :ref:`configuration overview <config_http_conn_man>`. -// [#extension: envoy.filters.network.http_connection_manager] - -message HttpConnectionManager { - oneof route_specifier { - // The connection manager’s route table will be dynamically loaded via the RDS API. - Rds rds = 3; - - // The route table for the connection manager is static and is specified in this property. - config.route.v3.RouteConfiguration route_config = 4; - - // A route table will be dynamically assigned to each request based on request attributes - // (e.g., the value of a header). The "routing scopes" (i.e., route tables) and "scope keys" are - // specified in this message. - ScopedRoutes scoped_routes = 31; - } - - // A list of individual HTTP filters that make up the filter chain for - // requests made to the connection manager. :ref:`Order matters <arch_overview_http_filters_ordering>` - // as the filters are processed sequentially as request events happen. - repeated HttpFilter http_filters = 5; - - // Additional settings for HTTP requests handled by the connection manager. These will be - // applicable to both HTTP1 and HTTP2 requests. - config.core.v3.HttpProtocolOptions common_http_protocol_options = 35; -} - -message Rds { - // Configuration source specifier for RDS. - config.core.v3.ConfigSource config_source = 1; - - // The name of the route configuration. This name will be passed to the RDS - // API. This allows an Envoy configuration with multiple HTTP listeners (and - // associated HTTP connection manager filters) to use different route - // configurations. - string route_config_name = 2; -} - -message ScopedRoutes { -} - -message HttpFilter { - // The name of the filter configuration. The name is used as a fallback to - // select an extension if the type of the configuration proto is not - // sufficient. It also serves as a resource name in ExtensionConfigDS. - string name = 1; - - oneof config_type { - // Filter specific configuration which depends on the filter being instantiated. See the supported - // filters for further documentation. - google.protobuf.Any typed_config = 4; - } - - bool is_optional = 6; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/listener.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/listener.proto deleted file mode 100644 index df9ee71e72..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/listener.proto +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.listener.v3; - -import "src/proto/grpc/testing/xds/v3/address.proto"; -import "src/proto/grpc/testing/xds/v3/base.proto"; - -import "google/protobuf/any.proto"; -import "google/protobuf/wrappers.proto"; - -// [#protodoc-title: Listener configuration] -// Listener :ref:`configuration overview <config_listeners>` - -// Describes a type of API listener, which is used in non-proxy clients. The type of API -// exposed to the non-proxy application depends on the type of API listener. -message ApiListener { - // The type in this field determines the type of API listener. At present, the following - // types are supported: - // envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager (HTTP) - // [#next-major-version: In the v3 API, replace this Any field with a oneof containing the - // specific config message for each type of API listener. We could not do this in v2 because - // it would have caused circular dependencies for go protos: lds.proto depends on this file, - // and http_connection_manager.proto depends on rds.proto, which is in the same directory as - // lds.proto, so lds.proto cannot depend on this file.] - google.protobuf.Any api_listener = 1; -} - -message Filter { - reserved 3; - - // The name of the filter to instantiate. The name must match a - // :ref:`supported filter <config_network_filters>`. - string name = 1; - - // [#extension-category: envoy.filters.network] - oneof config_type { - // Filter specific configuration which depends on the filter being - // instantiated. See the supported filters for further documentation. - google.protobuf.Any typed_config = 4; - } -} - -message FilterChainMatch { - enum ConnectionSourceType { - // Any connection source matches. - ANY = 0; - - // Match a connection originating from the same host. - SAME_IP_OR_LOOPBACK = 1; - - // Match a connection originating from a different host. - EXTERNAL = 2; - } - - reserved 1; - - // Optional destination port to consider when use_original_dst is set on the - // listener in determining a filter chain match. - google.protobuf.UInt32Value destination_port = 8; - - // If non-empty, an IP address and prefix length to match addresses when the - // listener is bound to 0.0.0.0/:: or when use_original_dst is specified. - repeated core.v3.CidrRange prefix_ranges = 3; - - // Specifies the connection source IP match type. Can be any, local or external network. - ConnectionSourceType source_type = 12; - - // The criteria is satisfied if the source IP address of the downstream - // connection is contained in at least one of the specified subnets. If the - // parameter is not specified or the list is empty, the source IP address is - // ignored. - repeated core.v3.CidrRange source_prefix_ranges = 6; - - // The criteria is satisfied if the source port of the downstream connection - // is contained in at least one of the specified ports. If the parameter is - // not specified, the source port is ignored. - repeated uint32 source_ports = 7; - - // If non-empty, a list of server names (e.g. SNI for TLS protocol) to consider when determining - // a filter chain match. Those values will be compared against the server names of a new - // connection, when detected by one of the listener filters. - // - // The server name will be matched against all wildcard domains, i.e. ``www.example.com`` - // will be first matched against ``www.example.com``, then ``*.example.com``, then ``*.com``. - // - // Note that partial wildcards are not supported, and values like ``*w.example.com`` are invalid. - // - // .. attention:: - // - // See the :ref:`FAQ entry <faq_how_to_setup_sni>` on how to configure SNI for more - // information. - repeated string server_names = 11; - - // If non-empty, a transport protocol to consider when determining a filter chain match. - // This value will be compared against the transport protocol of a new connection, when - // it's detected by one of the listener filters. - // - // Suggested values include: - // - // * ``raw_buffer`` - default, used when no transport protocol is detected, - // * ``tls`` - set by :ref:`envoy.filters.listener.tls_inspector <config_listener_filters_tls_inspector>` - // when TLS protocol is detected. - string transport_protocol = 9; - - // If non-empty, a list of application protocols (e.g. ALPN for TLS protocol) to consider when - // determining a filter chain match. Those values will be compared against the application - // protocols of a new connection, when detected by one of the listener filters. - // - // Suggested values include: - // - // * ``http/1.1`` - set by :ref:`envoy.filters.listener.tls_inspector - // <config_listener_filters_tls_inspector>`, - // * ``h2`` - set by :ref:`envoy.filters.listener.tls_inspector <config_listener_filters_tls_inspector>` - // - // .. attention:: - // - // Currently, only :ref:`TLS Inspector <config_listener_filters_tls_inspector>` provides - // application protocol detection based on the requested - // `ALPN <https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation>`_ values. - // - // However, the use of ALPN is pretty much limited to the HTTP/2 traffic on the Internet, - // and matching on values other than ``h2`` is going to lead to a lot of false negatives, - // unless all connecting clients are known to use ALPN. - repeated string application_protocols = 10; -} - -// A filter chain wraps a set of match criteria, an option TLS context, a set of filters, and -// various other parameters. -// [#next-free-field: 10] -message FilterChain { - // The criteria to use when matching a connection to this filter chain. - FilterChainMatch filter_chain_match = 1; - - // A list of individual network filters that make up the filter chain for - // connections established with the listener. Order matters as the filters are - // processed sequentially as connection events happen. Note: If the filter - // list is empty, the connection will close by default. - repeated Filter filters = 3; - - // Optional custom transport socket implementation to use for downstream connections. - // To setup TLS, set a transport socket with name `tls` and - // :ref:`DownstreamTlsContext <envoy_api_msg_extensions.transport_sockets.tls.v3.DownstreamTlsContext>` in the `typed_config`. - // If no transport socket configuration is specified, new connections - // will be set up with plaintext. - core.v3.TransportSocket transport_socket = 6; -} - -// [#next-free-field: 23] -message Listener { - // The unique name by which this listener is known. If no name is provided, - // Envoy will allocate an internal UUID for the listener. If the listener is to be dynamically - // updated or removed via :ref:`LDS <config_listeners_lds>` a unique name must be provided. - string name = 1; - - // The address that the listener should listen on. In general, the address must be unique, though - // that is governed by the bind rules of the OS. E.g., multiple listeners can listen on port 0 on - // Linux as the actual port will be allocated by the OS. - core.v3.Address address = 2; - - // A list of filter chains to consider for this listener. The - // :ref:`FilterChain <envoy_api_msg_config.listener.v3.FilterChain>` with the most specific - // :ref:`FilterChainMatch <envoy_api_msg_config.listener.v3.FilterChainMatch>` criteria is used on a - // connection. - // - // Example using SNI for filter chain selection can be found in the - // :ref:`FAQ entry <faq_how_to_setup_sni>`. - repeated FilterChain filter_chains = 3; - - // If a connection is redirected using *iptables*, the port on which the proxy - // receives it might be different from the original destination address. When this flag is set to - // true, the listener hands off redirected connections to the listener associated with the - // original destination address. If there is no listener associated with the original destination - // address, the connection is handled by the listener that receives it. Defaults to false. - google.protobuf.BoolValue use_original_dst = 4; - - // The default filter chain if none of the filter chain matches. If no default filter chain is supplied, - // the connection will be closed. The filter chain match is ignored in this field. - FilterChain default_filter_chain = 25; - - // Used to represent an API listener, which is used in non-proxy clients. The type of API - // exposed to the non-proxy application depends on the type of API listener. - // When this field is set, no other field except for :ref:`name<envoy_api_field_config.listener.v3.Listener.name>` - // should be set. - // - // .. note:: - // - // Currently only one ApiListener can be installed; and it can only be done via bootstrap config, - // not LDS. - // - // [#next-major-version: In the v3 API, instead of this messy approach where the socket - // listener fields are directly in the top-level Listener message and the API listener types - // are in the ApiListener message, the socket listener messages should be in their own message, - // and the top-level Listener should essentially be a oneof that selects between the - // socket listener and the various types of API listener. That way, a given Listener message - // can structurally only contain the fields of the relevant type.] - ApiListener api_listener = 19; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/load_report.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/load_report.proto deleted file mode 100644 index b8ee86fb48..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/load_report.proto +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.endpoint.v3; - -import "src/proto/grpc/testing/xds/v3/address.proto"; -import "src/proto/grpc/testing/xds/v3/base.proto"; - -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; - -// These are stats Envoy reports to GLB every so often. Report frequency is -// defined by -// :ref:`LoadStatsResponse.load_reporting_interval<envoy_api_field_service.load_stats.v3.LoadStatsResponse.load_reporting_interval>`. -// Stats per upstream region/zone and optionally per subzone. -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -// [#next-free-field: 9] -message UpstreamLocalityStats { - // Name of zone, region and optionally endpoint group these metrics were - // collected from. Zone and region names could be empty if unknown. - core.v3.Locality locality = 1; - - // The total number of requests successfully completed by the endpoints in the - // locality. - uint64 total_successful_requests = 2; - - // The total number of unfinished requests - uint64 total_requests_in_progress = 3; - - // The total number of requests that failed due to errors at the endpoint, - // aggregated over all endpoints in the locality. - uint64 total_error_requests = 4; - - // The total number of requests that were issued by this Envoy since - // the last report. This information is aggregated over all the - // upstream endpoints in the locality. - uint64 total_issued_requests = 8; - - // Stats for multi-dimensional load balancing. - repeated EndpointLoadMetricStats load_metric_stats = 5; - - // Endpoint granularity stats information for this locality. This information - // is populated if the Server requests it by setting - // :ref:`LoadStatsResponse.report_endpoint_granularity<envoy_api_field_service.load_stats.v3.LoadStatsResponse.report_endpoint_granularity>`. - repeated UpstreamEndpointStats upstream_endpoint_stats = 7; - - // [#not-implemented-hide:] The priority of the endpoint group these metrics - // were collected from. - uint32 priority = 6; -} - -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -// [#next-free-field: 8] -message UpstreamEndpointStats { - // Upstream host address. - core.v3.Address address = 1; - - // Opaque and implementation dependent metadata of the - // endpoint. Envoy will pass this directly to the management server. - google.protobuf.Struct metadata = 6; - - // The total number of requests successfully completed by the endpoints in the - // locality. These include non-5xx responses for HTTP, where errors - // originate at the client and the endpoint responded successfully. For gRPC, - // the grpc-status values are those not covered by total_error_requests below. - uint64 total_successful_requests = 2; - - // The total number of unfinished requests for this endpoint. - uint64 total_requests_in_progress = 3; - - // The total number of requests that failed due to errors at the endpoint. - // For HTTP these are responses with 5xx status codes and for gRPC the - // grpc-status values: - // - // - DeadlineExceeded - // - Unimplemented - // - Internal - // - Unavailable - // - Unknown - // - DataLoss - uint64 total_error_requests = 4; - - // The total number of requests that were issued to this endpoint - // since the last report. A single TCP connection, HTTP or gRPC - // request or stream is counted as one request. - uint64 total_issued_requests = 7; - - // Stats for multi-dimensional load balancing. - repeated EndpointLoadMetricStats load_metric_stats = 5; -} - -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message EndpointLoadMetricStats { - // Name of the metric; may be empty. - string metric_name = 1; - - // Number of calls that finished and included this metric. - uint64 num_requests_finished_with_metric = 2; - - // Sum of metric values across all calls that finished with this metric for - // load_reporting_interval. - double total_metric_value = 3; -} - -// Per cluster load stats. Envoy reports these stats a management server in a -// :ref:`LoadStatsRequest<envoy_api_msg_service.load_stats.v3.LoadStatsRequest>` -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -// Next ID: 7 -// [#next-free-field: 7] -message ClusterStats { - message DroppedRequests { - // Identifier for the policy specifying the drop. - string category = 1; - - // Total number of deliberately dropped requests for the category. - uint64 dropped_count = 2; - } - - // The name of the cluster. - string cluster_name = 1; - - // The eds_cluster_config service_name of the cluster. - // It's possible that two clusters send the same service_name to EDS, - // in that case, the management server is supposed to do aggregation on the load reports. - string cluster_service_name = 6; - - // Need at least one. - repeated UpstreamLocalityStats upstream_locality_stats = 2; - - // Cluster-level stats such as total_successful_requests may be computed by - // summing upstream_locality_stats. In addition, below there are additional - // cluster-wide stats. - // - // The total number of dropped requests. This covers requests - // deliberately dropped by the drop_overload policy and circuit breaking. - uint64 total_dropped_requests = 3; - - // Information about deliberately dropped requests for each category specified - // in the DropOverload policy. - repeated DroppedRequests dropped_requests = 5; - - // Period over which the actual load report occurred. This will be guaranteed to include every - // request reported. Due to system load and delays between the *LoadStatsRequest* sent from Envoy - // and the *LoadStatsResponse* message sent from the management server, this may be longer than - // the requested load reporting interval in the *LoadStatsResponse*. - google.protobuf.Duration load_report_interval = 4; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/lrs.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/lrs.proto deleted file mode 100644 index e118b7f957..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/lrs.proto +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.service.load_stats.v3; - -import "src/proto/grpc/testing/xds/v3/base.proto"; -import "src/proto/grpc/testing/xds/v3/load_report.proto"; - -import "google/protobuf/duration.proto"; - -// [#protodoc-title: Load reporting service] - -service LoadReportingService { - // Advanced API to allow for multi-dimensional load balancing by remote - // server. For receiving LB assignments, the steps are: - // 1, The management server is configured with per cluster/zone/load metric - // capacity configuration. The capacity configuration definition is - // outside of the scope of this document. - // 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters - // to balance. - // - // Independently, Envoy will initiate a StreamLoadStats bidi stream with a - // management server: - // 1. Once a connection establishes, the management server publishes a - // LoadStatsResponse for all clusters it is interested in learning load - // stats about. - // 2. For each cluster, Envoy load balances incoming traffic to upstream hosts - // based on per-zone weights and/or per-instance weights (if specified) - // based on intra-zone LbPolicy. This information comes from the above - // {Stream,Fetch}Endpoints. - // 3. When upstream hosts reply, they optionally add header <define header - // name> with ASCII representation of EndpointLoadMetricStats. - // 4. Envoy aggregates load reports over the period of time given to it in - // LoadStatsResponse.load_reporting_interval. This includes aggregation - // stats Envoy maintains by itself (total_requests, rpc_errors etc.) as - // well as load metrics from upstream hosts. - // 5. When the timer of load_reporting_interval expires, Envoy sends new - // LoadStatsRequest filled with load reports for each cluster. - // 6. The management server uses the load reports from all reported Envoys - // from around the world, computes global assignment and prepares traffic - // assignment destined for each zone Envoys are located in. Goto 2. - rpc StreamLoadStats(stream LoadStatsRequest) returns (stream LoadStatsResponse) { - } -} - -// A load report Envoy sends to the management server. -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message LoadStatsRequest { - // Node identifier for Envoy instance. - config.core.v3.Node node = 1; - - // A list of load stats to report. - repeated config.endpoint.v3.ClusterStats cluster_stats = 2; -} - -// The management server sends envoy a LoadStatsResponse with all clusters it -// is interested in learning load stats about. -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message LoadStatsResponse { - // Clusters to report stats for. - // Not populated if *send_all_clusters* is true. - repeated string clusters = 1; - - // If true, the client should send all clusters it knows about. - // Only clients that advertise the "envoy.lrs.supports_send_all_clusters" capability in their - // :ref:`client_features<envoy_api_field_config.core.v3.Node.client_features>` field will honor this field. - bool send_all_clusters = 4; - - // The minimum interval of time to collect stats over. This is only a minimum for two reasons: - // 1. There may be some delay from when the timer fires until stats sampling occurs. - // 2. For clusters that were already feature in the previous *LoadStatsResponse*, any traffic - // that is observed in between the corresponding previous *LoadStatsRequest* and this - // *LoadStatsResponse* will also be accumulated and billed to the cluster. This avoids a period - // of inobservability that might otherwise exists between the messages. New clusters are not - // subject to this consideration. - google.protobuf.Duration load_reporting_interval = 2; - - // Set to *true* if the management server supports endpoint granularity - // report. - bool report_endpoint_granularity = 3; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto deleted file mode 100644 index 033e64ba49..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package xds.data.orca.v3; - -// See section `ORCA load report format` of the design document in -// :ref:`https://github.com/envoyproxy/envoy/issues/6614`. - -message OrcaLoadReport { - // CPU utilization expressed as a fraction of available CPU resources. This - // should be derived from the latest sample or measurement. - double cpu_utilization = 1; - - // Memory utilization expressed as a fraction of available memory - // resources. This should be derived from the latest sample or measurement. - double mem_utilization = 2; - - // Total RPS being served by an endpoint. This should cover all services that an endpoint is - // responsible for. - uint64 rps = 3; - - // Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of - // storage) associated with the request. - map<string, double> request_cost = 4; - - // Resource utilization values. Each value is expressed as a fraction of total resources - // available, derived from the latest sample or measurement. - map<string, double> utilization = 5; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/percent.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/percent.proto deleted file mode 100644 index dacc97496e..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/percent.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.type.v3; - -// A fractional percentage is used in cases in which for performance reasons performing floating -// point to integer conversions during randomness calculations is undesirable. The message includes -// both a numerator and denominator that together determine the final fractional value. -// -// * **Example**: 1/100 = 1%. -// * **Example**: 3/10000 = 0.03%. -message FractionalPercent { - // Fraction percentages support several fixed denominator values. - enum DenominatorType { - // 100. - // - // **Example**: 1/100 = 1%. - HUNDRED = 0; - - // 10,000. - // - // **Example**: 1/10000 = 0.01%. - TEN_THOUSAND = 1; - - // 1,000,000. - // - // **Example**: 1/1000000 = 0.0001%. - MILLION = 2; - } - - // Specifies the numerator. Defaults to 0. - uint32 numerator = 1; - - // Specifies the denominator. If the denominator specified is less than the numerator, the final - // fractional percentage is capped at 1 (100%). - DenominatorType denominator = 2; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/protocol.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/protocol.proto deleted file mode 100644 index 886cc11ddf..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/protocol.proto +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.core.v3; - -import "google/protobuf/duration.proto"; - -// [#next-free-field: 5] -message HttpProtocolOptions { - // The maximum duration of a connection. - google.protobuf.Duration max_stream_duration = 4; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/range.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/range.proto deleted file mode 100644 index 5fe5530ee6..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/range.proto +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.type.v3; - -// [#protodoc-title: Range] - -// Specifies the int64 start and end of the range using half-open interval semantics [start, -// end). -message Int64Range { - // start of the range (inclusive) - int64 start = 1; - - // end of the range (exclusive) - int64 end = 2; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto deleted file mode 100644 index 9039ed4644..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.type.matcher.v3; - -// [#protodoc-title: Regex matcher] - -// A regex matcher designed for safety when used with untrusted input. -message RegexMatcher { - // Google's `RE2 <https://github.com/google/re2>`_ regex engine. The regex string must adhere to - // the documented `syntax <https://github.com/google/re2/wiki/Syntax>`_. The engine is designed - // to complete execution in linear time as well as limit the amount of memory used. - message GoogleRE2 { - } - - oneof engine_type { - // Google's RE2 regex engine. - GoogleRE2 google_re2 = 1; - } - - // The regex match string. The string must be supported by the configured engine. - string regex = 2; -} - -message RegexMatchAndSubstitute { - RegexMatcher pattern = 1; - string substitution = 2; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto deleted file mode 100644 index 7109fe21db..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto +++ /dev/null @@ -1,465 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.route.v3; - -import "src/proto/grpc/testing/xds/v3/base.proto"; -import "src/proto/grpc/testing/xds/v3/regex.proto"; -import "src/proto/grpc/testing/xds/v3/percent.proto"; -import "src/proto/grpc/testing/xds/v3/range.proto"; - -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; - -// [#protodoc-title: HTTP route components] -// * Routing :ref:`architecture overview <arch_overview_http_routing>` -// * HTTP :ref:`router filter <config_http_filters_router>` - -message RetryPolicy { - string retry_on = 1; - google.protobuf.UInt32Value num_retries = 2; - - message RetryBackOff { - google.protobuf.Duration base_interval = 1; - google.protobuf.Duration max_interval = 2; - } - - RetryBackOff retry_back_off = 8; -} - -// The top level element in the routing configuration is a virtual host. Each virtual host has -// a logical name as well as a set of domains that get routed to it based on the incoming request's -// host header. This allows a single listener to service multiple top level domain path trees. Once -// a virtual host is selected based on the domain, the routes are processed in order to see which -// upstream cluster to route to or whether to perform a redirect. -// [#next-free-field: 21] -message VirtualHost { - // The logical name of the virtual host. This is used when emitting certain - // statistics but is not relevant for routing. - string name = 1; - - // A list of domains (host/authority header) that will be matched to this - // virtual host. Wildcard hosts are supported in the suffix or prefix form. - // - // Domain search order: - // 1. Exact domain names: ``www.foo.com``. - // 2. Suffix domain wildcards: ``*.foo.com`` or ``*-bar.foo.com``. - // 3. Prefix domain wildcards: ``foo.*`` or ``foo-*``. - // 4. Special wildcard ``*`` matching any domain. - // - // .. note:: - // - // The wildcard will not match the empty string. - // e.g. ``*-bar.foo.com`` will match ``baz-bar.foo.com`` but not ``-bar.foo.com``. - // The longest wildcards match first. - // Only a single virtual host in the entire route configuration can match on ``*``. A domain - // must be unique across all virtual hosts or the config will fail to load. - // - // Domains cannot contain control characters. This is validated by the well_known_regex HTTP_HEADER_VALUE. - repeated string domains = 2; - - // The list of routes that will be matched, in order, for incoming requests. - // The first route that matches will be used. - repeated Route routes = 3; - - // The per_filter_config field can be used to provide virtual host-specific - // configurations for filters. The key should match the filter name, such as - // *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter - // specific; see the :ref:`HTTP filter documentation <config_http_filters>` - // for if and how it is utilized. - map<string, google.protobuf.Any> typed_per_filter_config = 15; - - RetryPolicy retry_policy = 16; -} - -// A route is both a specification of how to match a request as well as an indication of what to do -// next (e.g., redirect, forward, rewrite, etc.). -// -// .. attention:: -// -// Envoy supports routing on HTTP method via :ref:`header matching -// <envoy_api_msg_config.route.v3.HeaderMatcher>`. -// [#next-free-field: 18] -message Route { - // Name for the route. - string name = 14; - - // Route matching parameters. - RouteMatch match = 1; - - message NonForwardingAction { - } - - oneof action { - // Route request to some upstream cluster. - RouteAction route = 2; - - // Return a redirect. - RedirectAction redirect = 3; - - // An action used when the route will generate a response directly, - // without forwarding to an upstream host. This will be used in non-proxy - // xDS clients like the gRPC server. It could also be used in the future - // in Envoy for a filter that directly generates responses for requests. - NonForwardingAction non_forwarding_action = 18; - } - - // The typed_per_filter_config field can be used to provide route-specific - // configurations for filters. The key should match the filter name, such as - // *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter - // specific; see the :ref:`HTTP filter documentation <config_http_filters>` for - // if and how it is utilized. - map<string, google.protobuf.Any> typed_per_filter_config = 13; -} - -// Compared to the :ref:`cluster <envoy_api_field_config.route.v3.RouteAction.cluster>` field that specifies a -// single upstream cluster as the target of a request, the :ref:`weighted_clusters -// <envoy_api_field_config.route.v3.RouteAction.weighted_clusters>` option allows for specification of -// multiple upstream clusters along with weights that indicate the percentage of -// traffic to be forwarded to each cluster. The router selects an upstream cluster based on the -// weights. -message WeightedCluster { - // [#next-free-field: 11] - message ClusterWeight { - // Name of the upstream cluster. The cluster must exist in the - // :ref:`cluster manager configuration <config_cluster_manager>`. - string name = 1; - - // An integer between 0 and :ref:`total_weight - // <envoy_api_field_config.route.v3.WeightedCluster.total_weight>`. When a request matches the route, - // the choice of an upstream cluster is determined by its weight. The sum of weights across all - // entries in the clusters array must add up to the total_weight, which defaults to 100. - google.protobuf.UInt32Value weight = 2; - - // The per_filter_config field can be used to provide weighted cluster-specific - // configurations for filters. The key should match the filter name, such as - // *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter - // specific; see the :ref:`HTTP filter documentation <config_http_filters>` - // for if and how it is utilized. - map<string, google.protobuf.Any> typed_per_filter_config = 10; - } - - // Specifies one or more upstream clusters associated with the route. - repeated ClusterWeight clusters = 1; - - // Specifies the total weight across all clusters. The sum of all cluster weights must equal this - // value, which must be greater than 0. Defaults to 100. - google.protobuf.UInt32Value total_weight = 3; -} - -// [#next-free-field: 13] -message RouteMatch { - oneof path_specifier { - // If specified, the route is a prefix rule meaning that the prefix must - // match the beginning of the *:path* header. - string prefix = 1; - - // If specified, the route is an exact path rule meaning that the path must - // exactly match the *:path* header once the query string is removed. - string path = 2; - - // If specified, the route is a regular expression rule meaning that the - // regex must match the *:path* header once the query string is removed. The entire path - // (without the query string) must match the regex. The rule will not match if only a - // subsequence of the *:path* header matches the regex. - // - // [#next-major-version: In the v3 API we should redo how path specification works such - // that we utilize StringMatcher, and additionally have consistent options around whether we - // strip query strings, do a case sensitive match, etc. In the interim it will be too disruptive - // to deprecate the existing options. We should even consider whether we want to do away with - // path_specifier entirely and just rely on a set of header matchers which can already match - // on :path, etc. The issue with that is it is unclear how to generically deal with query string - // stripping. This needs more thought.] - type.matcher.v3.RegexMatcher safe_regex = 10; - } - - // Indicates that prefix/path matching should be case insensitive. The default - // is true. - google.protobuf.BoolValue case_sensitive = 4; - - // Indicates that the route should additionally match on a runtime key. Every time the route - // is considered for a match, it must also fall under the percentage of matches indicated by - // this field. For some fraction N/D, a random number in the range [0,D) is selected. If the - // number is <= the value of the numerator N, or if the key is not present, the default - // value, the router continues to evaluate the remaining match criteria. A runtime_fraction - // route configuration can be used to roll out route changes in a gradual manner without full - // code/config deploys. Refer to the :ref:`traffic shifting - // <config_http_conn_man_route_table_traffic_splitting_shift>` docs for additional documentation. - // - // .. note:: - // - // Parsing this field is implemented such that the runtime key's data may be represented - // as a FractionalPercent proto represented as JSON/YAML and may also be represented as an - // integer with the assumption that the value is an integral percentage out of 100. For - // instance, a runtime key lookup returning the value "42" would parse as a FractionalPercent - // whose numerator is 42 and denominator is HUNDRED. This preserves legacy semantics. - core.v3.RuntimeFractionalPercent runtime_fraction = 9; - - // Specifies a set of headers that the route should match on. The router will - // check the request’s headers against all the specified headers in the route - // config. A match will happen if all the headers in the route are present in - // the request with the same values (or based on presence if the value field - // is not in the config). - repeated HeaderMatcher headers = 6; - - // Specifies a set of URL query parameters on which the route should - // match. The router will check the query string from the *path* header - // against all the specified query parameters. If the number of specified - // query parameters is nonzero, they all must match the *path* header's - // query string for a match to occur. - repeated QueryParameterMatcher query_parameters = 7; -} - -message MaxStreamDuration { - // Specifies the maximum duration allowed for streams on the route. If not specified, the value - // from the :ref:`max_stream_duration - // <envoy_api_field_config.core.v3.HttpProtocolOptions.max_stream_duration>` field in - // :ref:`HttpConnectionManager.common_http_protocol_options - // <envoy_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.common_http_protocol_options>` - // is used. If this field is set explicitly to zero, any - // HttpConnectionManager max_stream_duration timeout will be disabled for - // this route. - google.protobuf.Duration max_stream_duration = 1; - - // If present, and the request contains a `grpc-timeout header - // <https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md>`_, use that value as the - // *max_stream_duration*, but limit the applied timeout to the maximum value specified here. - // If set to 0, the `grpc-timeout` header is used without modification. - google.protobuf.Duration grpc_timeout_header_max = 2; -} - -// [#next-free-field: 37] -message RouteAction { - oneof cluster_specifier { - // Indicates the upstream cluster to which the request should be routed - // to. - string cluster = 1; - - // Envoy will determine the cluster to route to by reading the value of the - // HTTP header named by cluster_header from the request headers. If the - // header is not found or the referenced cluster does not exist, Envoy will - // return a 404 response. - // - // .. attention:: - // - // Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 - // *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead. - string cluster_header = 2; - - // Multiple upstream clusters can be specified for a given route. The - // request is routed to one of the upstream clusters based on weights - // assigned to each cluster. See - // :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>` - // for additional documentation. - WeightedCluster weighted_clusters = 3; - } - - message HashPolicy { - message Header { - // The name of the request header that will be used to obtain the hash - // key. If the request header is not present, no hash will be produced. - string header_name = 1; - - // If specified, the request header value will be rewritten and used - // to produce the hash key. - type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 2; - } - - message Cookie { - string name = 1; - } - - message ConnectionProperties { - bool source_ip = 1; - } - - message QueryParameter { - string name = 1; - } - - message FilterState { - // The name of the Object in the per-request filterState, which is an - // Envoy::Http::Hashable object. If there is no data associated with the key, - // or the stored object is not Envoy::Http::Hashable, no hash will be produced. - string key = 1; - } - - oneof policy_specifier { - // Header hash policy. - Header header = 1; - - // Cookie hash policy. - Cookie cookie = 2; - - // Connection properties hash policy. - ConnectionProperties connection_properties = 3; - - // Query parameter hash policy. - QueryParameter query_parameter = 5; - - // Filter state hash policy. - FilterState filter_state = 6; - } - - // The flag that short-circuits the hash computing. This field provides a - // 'fallback' style of configuration: "if a terminal policy doesn't work, - // fallback to rest of the policy list", it saves time when the terminal - // policy works. - // - // If true, and there is already a hash computed, ignore rest of the - // list of hash polices. - // For example, if the following hash methods are configured: - // - // ========= ======== - // specifier terminal - // ========= ======== - // Header A true - // Header B false - // Header C false - // ========= ======== - // - // The generateHash process ends if policy "header A" generates a hash, as - // it's a terminal policy. - bool terminal = 4; - } - - repeated HashPolicy hash_policy = 15; - - RetryPolicy retry_policy = 9; - - // Specifies the maximum stream duration for this route. - MaxStreamDuration max_stream_duration = 36; -} - -// .. attention:: -// -// Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 *Host* -// header. Thus, if attempting to match on *Host*, match on *:authority* instead. -// -// .. attention:: -// -// To route on HTTP method, use the special HTTP/2 *:method* header. This works for both -// HTTP/1 and HTTP/2 as Envoy normalizes headers. E.g., -// -// .. code-block:: json -// -// { -// "name": ":method", -// "exact_match": "POST" -// } -// -// .. attention:: -// In the absence of any header match specifier, match will default to :ref:`present_match -// <envoy_api_field_config.route.v3.HeaderMatcher.present_match>`. i.e, a request that has the :ref:`name -// <envoy_api_field_config.route.v3.HeaderMatcher.name>` header will match, regardless of the header's -// value. -// -// [#next-major-version: HeaderMatcher should be refactored to use StringMatcher.] -// [#next-free-field: 12] -message HeaderMatcher { - // Specifies the name of the header in the request. - string name = 1; - - // Specifies how the header match will be performed to route the request. - oneof header_match_specifier { - // If specified, header match will be performed based on the value of the header. - string exact_match = 4; - - // If specified, this regex string is a regular expression rule which implies the entire request - // header value must match the regex. The rule will not match if only a subsequence of the - // request header value matches the regex. - type.matcher.v3.RegexMatcher safe_regex_match = 11; - - // If specified, header match will be performed based on range. - // The rule will match if the request header value is within this range. - // The entire request header value must represent an integer in base 10 notation: consisting of - // an optional plus or minus sign followed by a sequence of digits. The rule will not match if - // the header value does not represent an integer. Match will fail for empty values, floating - // point numbers or if only a subsequence of the header value is an integer. - // - // Examples: - // - // * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9, - // "-1somestring" - type.v3.Int64Range range_match = 6; - - // If specified, header match will be performed based on whether the header is in the - // request. - bool present_match = 7; - - // If specified, header match will be performed based on the prefix of the header value. - // Note: empty prefix is not allowed, please use present_match instead. - // - // Examples: - // - // * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*. - string prefix_match = 9; - - // If specified, header match will be performed based on the suffix of the header value. - // Note: empty suffix is not allowed, please use present_match instead. - // - // Examples: - // - // * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*. - string suffix_match = 10; - } - - // If specified, the match result will be inverted before checking. Defaults to false. - // - // Examples: - // - // * The regex ``\d{3}`` does not match the value *1234*, so it will match when inverted. - // * The range [-10,0) will match the value -1, so it will not match when inverted. - bool invert_match = 8; -} - -// Query parameter matching treats the query string of a request's :path header -// as an ampersand-separated list of keys and/or key=value elements. -// [#next-free-field: 7] -message QueryParameterMatcher { -} - -// [#protodoc-title: HTTP route configuration] -// * Routing :ref:`architecture overview <arch_overview_http_routing>` -// * HTTP :ref:`router filter <config_http_filters_router>` - -// [#next-free-field: 11] -message RouteConfiguration { - // The name of the route configuration. For example, it might match - // :ref:`route_config_name - // <envoy_api_field_extensions.filters.network.http_connection_manager.v3.Rds.route_config_name>` in - // :ref:`envoy_api_msg_extensions.filters.network.http_connection_manager.v3.Rds`. - string name = 1; - - // An array of virtual hosts that make up the route table. - repeated VirtualHost virtual_hosts = 2; -} - -message RedirectAction { -} - -message FilterConfig { - // The filter config. - google.protobuf.Any config = 1; - - // If true, the filter is optional, meaning that if the client does - // not support the specified filter, it may ignore the map entry rather - // than rejecting the config. - bool is_optional = 2; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/router.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/router.proto deleted file mode 100644 index 00b11b3712..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/router.proto +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.extensions.filters.http.router.v3; - -// [#protodoc-title: Router] -// Router :ref:`configuration overview <config_http_filters_router>`. -// [#extension: envoy.filters.http.router] - -// We don't actually use any of the fields in this message, but we need -// the message itself to signify which filter to use. -message Router { -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/string.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/string.proto deleted file mode 100644 index d7e773089d..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/string.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.type.matcher.v3; - -import "src/proto/grpc/testing/xds/v3/regex.proto"; - -message StringMatcher { - oneof match_pattern { - // The input string must match exactly the string specified here. - // - // Examples: - // - // * *abc* only matches the value *abc*. - string exact = 1; - - // The input string must have the prefix specified here. - // Note: empty prefix is not allowed, please use regex instead. - // - // Examples: - // - // * *abc* matches the value *abc.xyz* - string prefix = 2; - - // The input string must have the suffix specified here. - // Note: empty prefix is not allowed, please use regex instead. - // - // Examples: - // - // * *abc* matches the value *xyz.abc* - string suffix = 3; - - // The input string must match the regular expression specified here. - RegexMatcher safe_regex = 5; - - // The input string must have the substring specified here. - // Note: empty contains match is not allowed, please use regex instead. - // - // Examples: - // - // * *abc* matches the value *xyz.abc.def* - string contains = 7; - } - - // If true, indicates the exact/prefix/suffix matching should be case insensitive. This has no - // effect for the safe_regex match. - // For example, the matcher *data* will match both input string *Data* and *data* if set to true. - bool ignore_case = 6; -} diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/tls.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/tls.proto deleted file mode 100644 index b2fc4532d8..0000000000 --- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/tls.proto +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2020 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.extensions.transport_sockets.tls.v3; - -import "src/proto/grpc/testing/xds/v3/base.proto"; -import "src/proto/grpc/testing/xds/v3/extension.proto"; -import "src/proto/grpc/testing/xds/v3/string.proto"; - -import "google/protobuf/wrappers.proto"; - -// Indicates a certificate to be obtained from a named CertificateProvider plugin instance. -// The plugin instances are defined in the client's bootstrap file. -// The plugin allows certificates to be fetched/refreshed over the network asynchronously with -// respect to the TLS handshake. -// [#not-implemented-hide:] -message CertificateProviderPluginInstance { - // Provider instance name. If not present, defaults to "default". - // - // Instance names should generally be defined not in terms of the underlying provider - // implementation (e.g., "file_watcher") but rather in terms of the function of the - // certificates (e.g., "foo_deployment_identity"). - string instance_name = 1; - - // Opaque name used to specify certificate instances or types. For example, "ROOTCA" to specify - // a root-certificate (validation context) or "example.com" to specify a certificate for a - // particular domain. Not all provider instances will actually use this field, so the value - // defaults to the empty string. - string certificate_name = 2; -} - -message CertificateValidationContext { - // Certificate provider instance for fetching TLS certificates. - // - // Only one of *trusted_ca* and *ca_certificate_provider_instance* may be specified. - // [#not-implemented-hide:] - CertificateProviderPluginInstance ca_certificate_provider_instance = 13; - - // An optional list of base64-encoded SHA-256 hashes. If specified, Envoy will verify that the - // SHA-256 of the DER-encoded Subject Public Key Information (SPKI) of the presented certificate - // matches one of the specified values. - // - // A base64-encoded SHA-256 of the Subject Public Key Information (SPKI) of the certificate - // can be generated with the following command: - // - // .. code-block:: bash - // - // $ openssl x509 -in path/to/client.crt -noout -pubkey - // | openssl pkey -pubin -outform DER - // | openssl dgst -sha256 -binary - // | openssl enc -base64 - // NvqYIYSbgK2vCJpQhObf77vv+bQWtc5ek5RIOwPiC9A= - // - // This is the format used in HTTP Public Key Pinning. - // - // When both: - // :ref:`verify_certificate_hash - // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_hash>` and - // :ref:`verify_certificate_spki - // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_spki>` are specified, - // a hash matching value from either of the lists will result in the certificate being accepted. - // - // .. attention:: - // - // This option is preferred over :ref:`verify_certificate_hash - // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_hash>`, - // because SPKI is tied to a private key, so it doesn't change when the certificate - // is renewed using the same private key. - repeated string verify_certificate_spki = 3; - - // An optional list of hex-encoded SHA-256 hashes. If specified, Envoy will verify that - // the SHA-256 of the DER-encoded presented certificate matches one of the specified values. - // - // A hex-encoded SHA-256 of the certificate can be generated with the following command: - // - // .. code-block:: bash - // - // $ openssl x509 -in path/to/client.crt -outform DER | openssl dgst -sha256 | cut -d" " -f2 - // df6ff72fe9116521268f6f2dd4966f51df479883fe7037b39f75916ac3049d1a - // - // A long hex-encoded and colon-separated SHA-256 (a.k.a. "fingerprint") of the certificate - // can be generated with the following command: - // - // .. code-block:: bash - // - // $ openssl x509 -in path/to/client.crt -noout -fingerprint -sha256 | cut -d"=" -f2 - // DF:6F:F7:2F:E9:11:65:21:26:8F:6F:2D:D4:96:6F:51:DF:47:98:83:FE:70:37:B3:9F:75:91:6A:C3:04:9D:1A - // - // Both of those formats are acceptable. - // - // When both: - // :ref:`verify_certificate_hash - // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_hash>` and - // :ref:`verify_certificate_spki - // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_spki>` are specified, - // a hash matching value from either of the lists will result in the certificate being accepted. - repeated string verify_certificate_hash = 2; - - // An optional list of Subject Alternative name matchers. If specified, Envoy will verify that the - // Subject Alternative Name of the presented certificate matches one of the specified matchers. - // - // When a certificate has wildcard DNS SAN entries, to match a specific client, it should be - // configured with exact match type in the :ref:`string matcher <envoy_v3_api_msg_type.matcher.v3.StringMatcher>`. - // For example if the certificate has "\*.example.com" as DNS SAN entry, to allow only "api.example.com", - // it should be configured as shown below. - // - // .. code-block:: yaml - // - // match_subject_alt_names: - // exact: "api.example.com" - // - // .. attention:: - // - // Subject Alternative Names are easily spoofable and verifying only them is insecure, - // therefore this option must be used together with :ref:`trusted_ca - // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.trusted_ca>`. - repeated type.matcher.v3.StringMatcher match_subject_alt_names = 9; - - // [#not-implemented-hide:] Must present signed certificate time-stamp. - google.protobuf.BoolValue require_signed_certificate_timestamp = 6; - - // An optional `certificate revocation list - // <https://en.wikipedia.org/wiki/Certificate_revocation_list>`_ - // (in PEM format). If specified, Envoy will verify that the presented peer - // certificate has not been revoked by this CRL. If this DataSource contains - // multiple CRLs, all of them will be used. Note that if a CRL is provided - // for any certificate authority in a trust chain, a CRL must be provided - // for all certificate authorities in that chain. Failure to do so will - // result in verification failure for both revoked and unrevoked certificates - // from that chain. - config.core.v3.DataSource crl = 7; - - // The configuration of an extension specific certificate validator. - // If specified, all validation is done by the specified validator, - // and the behavior of all other validation settings is defined by the specified validator (and may be entirely ignored, unused, and unvalidated). - // Refer to the documentation for the specified validator. If you do not want a custom validation algorithm, do not set this field. - // [#extension-category: envoy.tls.cert_validator] - config.core.v3.TypedExtensionConfig custom_validator_config = 12; -} - -message UpstreamTlsContext { - // Common TLS context settings. - // - // .. attention:: - // - // Server certificate verification is not enabled by default. Configure - // :ref:`trusted_ca<envoy_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.trusted_ca>` to enable - // verification. - CommonTlsContext common_tls_context = 1; -} - -message DownstreamTlsContext { - enum OcspStaplePolicy { - // OCSP responses are optional. If an OCSP response is absent - // or expired, the associated certificate will be used for - // connections without an OCSP staple. - LENIENT_STAPLING = 0; - - // OCSP responses are optional. If an OCSP response is absent, - // the associated certificate will be used without an - // OCSP staple. If a response is provided but is expired, - // the associated certificate will not be used for - // subsequent connections. If no suitable certificate is found, - // the connection is rejected. - STRICT_STAPLING = 1; - - // OCSP responses are required. Configuration will fail if - // a certificate is provided without an OCSP response. If a - // response expires, the associated certificate will not be - // used connections. If no suitable certificate is found, the - // connection is rejected. - MUST_STAPLE = 2; - } - - // Common TLS context settings. - CommonTlsContext common_tls_context = 1; - - // If specified, Envoy will reject connections without a valid client - // certificate. - google.protobuf.BoolValue require_client_certificate = 2; - - // If specified, Envoy will reject connections without a valid and matching SNI. - // [#not-implemented-hide:] - google.protobuf.BoolValue require_sni = 3; - - // Config for whether to use certificates if they do not have - // an accompanying OCSP response or if the response expires at runtime. - // Defaults to LENIENT_STAPLING - OcspStaplePolicy ocsp_staple_policy = 8; -} - - -// TLS context shared by both client and server TLS contexts. -// [#next-free-field: 14] -message CommonTlsContext { - // Similar to CertificateProvider above, but allows the provider instances to be configured on - // the client side instead of being sent from the control plane. - message CertificateProviderInstance { - // Provider instance name. This name must be defined in the client's configuration (e.g., a - // bootstrap file) to correspond to a provider instance (i.e., the same data in the typed_config - // field that would be sent in the CertificateProvider message if the config was sent by the - // control plane). If not present, defaults to "default". - // - // Instance names should generally be defined not in terms of the underlying provider - // implementation (e.g., "file_watcher") but rather in terms of the function of the - // certificates (e.g., "foo_deployment_identity"). - string instance_name = 1; - - // Opaque name used to specify certificate instances or types. For example, "ROOTCA" to specify - // a root-certificate (validation context) or "example.com" to specify a certificate for a - // particular domain. Not all provider instances will actually use this field, so the value - // defaults to the empty string. - string certificate_name = 2; - } - - message CombinedCertificateValidationContext { - // How to validate peer certificates. - CertificateValidationContext default_validation_context = 1; - - // Certificate provider instance for fetching validation context. - // Only one of validation_context_sds_secret_config, validation_context_certificate_provider, - // or validation_context_certificate_provider_instance may be used. - CertificateProviderInstance validation_context_certificate_provider_instance = 4; - } - - message TlsParameters {} - - // TLS protocol versions, cipher suites etc. - TlsParameters tls_params = 1; - - message TlsCertificate {} - - // :ref:`Multiple TLS certificates <arch_overview_ssl_cert_select>` can be associated with the - // same context to allow both RSA and ECDSA certificates. - // - // Only a single TLS certificate is supported in client contexts. In server contexts, the first - // RSA certificate is used for clients that only support RSA and the first ECDSA certificate is - // used for clients that support ECDSA. - // - // Only one of *tls_certificates*, *tls_certificate_sds_secret_configs*, - // and *tls_certificate_provider_instance* may be used. - // [#next-major-version: These mutually exclusive fields should ideally be in a oneof, but it's - // not legal to put a repeated field in a oneof. In the next major version, we should rework - // this to avoid this problem.] - repeated TlsCertificate tls_certificates = 2; - - message SdsSecretConfig {} - - // Configs for fetching TLS certificates via SDS API. Note SDS API allows certificates to be - // fetched/refreshed over the network asynchronously with respect to the TLS handshake. - // - // The same number and types of certificates as :ref:`tls_certificates <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CommonTlsContext.tls_certificates>` - // are valid in the the certificates fetched through this setting. - // - // Only one of *tls_certificates*, *tls_certificate_sds_secret_configs*, - // and *tls_certificate_provider_instance* may be used. - // [#next-major-version: These mutually exclusive fields should ideally be in a oneof, but it's - // not legal to put a repeated field in a oneof. In the next major version, we should rework - // this to avoid this problem.] - repeated SdsSecretConfig tls_certificate_sds_secret_configs = 6; - - // Certificate provider instance for fetching TLS certs. - // - // Only one of *tls_certificates*, *tls_certificate_sds_secret_configs*, - // and *tls_certificate_provider_instance* may be used. - // [#not-implemented-hide:] - CertificateProviderPluginInstance tls_certificate_provider_instance = 14; - - // Certificate provider instance for fetching TLS certificates. - CertificateProviderInstance tls_certificate_certificate_provider_instance = 11; - - oneof validation_context_type { - // How to validate peer certificates. - CertificateValidationContext validation_context = 3; - - // Config for fetching validation context via SDS API. Note SDS API allows certificates to be - // fetched/refreshed over the network asynchronously with respect to the TLS handshake. - SdsSecretConfig validation_context_sds_secret_config = 7; - - // Combined certificate validation context holds a default CertificateValidationContext - // and SDS config. When SDS server returns dynamic CertificateValidationContext, both dynamic - // and default CertificateValidationContext are merged into a new CertificateValidationContext - // for validation. This merge is done by Message::MergeFrom(), so dynamic - // CertificateValidationContext overwrites singular fields in default - // CertificateValidationContext, and concatenates repeated fields to default - // CertificateValidationContext, and logical OR is applied to boolean fields. - CombinedCertificateValidationContext combined_validation_context = 8; - } - - // Custom TLS handshaker. If empty, defaults to native TLS handshaking - // behavior. - config.core.v3.TypedExtensionConfig custom_handshaker = 13; -} diff --git a/contrib/libs/grpc/src/proto/math/math.proto b/contrib/libs/grpc/src/proto/math/math.proto deleted file mode 100644 index e60ba0d7cd..0000000000 --- a/contrib/libs/grpc/src/proto/math/math.proto +++ /dev/null @@ -1,65 +0,0 @@ - -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package math; - -message DivArgs { - int64 dividend = 1; - int64 divisor = 2; -} - -message DivReply { - int64 quotient = 1; - int64 remainder = 2; -} - -message FibArgs { - int64 limit = 1; -} - -message Num { - int64 num = 1; -} - -message FibReply { - int64 count = 1; -} - -service Math { - // Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient - // and remainder. - rpc Div (DivArgs) returns (DivReply) { - } - - // DivMany accepts an arbitrary number of division args from the client stream - // and sends back the results in the reply stream. The stream continues until - // the client closes its end; the server does the same after sending all the - // replies. The stream ends immediately if either end aborts. - rpc DivMany (stream DivArgs) returns (stream DivReply) { - } - - // Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib - // generates up to limit numbers; otherwise it continues until the call is - // canceled. Unlike Fib above, Fib has no final FibReply. - rpc Fib (FibArgs) returns (stream Num) { - } - - // Sum sums a stream of numbers, returning the final result once the stream - // is closed. - rpc Sum (stream Num) returns (Num) { - } -} diff --git a/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt deleted file mode 100644 index 94d1b32617..0000000000 --- a/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,64 +0,0 @@ -====================Apache-2.0==================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -====================COPYRIGHT==================== - * Copyright 2015 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2015-2016 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2016 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2017 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2018 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2019 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2020 gRPC authors. - - -====================COPYRIGHT==================== -# Copyright 2019 The gRPC authors. - - -====================COPYRIGHT==================== -# Copyright 2020 The gRPC authors. - - -====================COPYRIGHT==================== -// Copyright 2018 The gRPC Authors - - -====================COPYRIGHT==================== -// Copyright 2019 The gRPC Authors - - -====================COPYRIGHT==================== -// Copyright 2020 The gRPC Authors - - -====================COPYRIGHT==================== -// Copyright 2021 The gRPC Authors diff --git a/contrib/libs/grpc/src/python/grpcio/_parallel_compile_patch.py b/contrib/libs/grpc/src/python/grpcio/_parallel_compile_patch.py deleted file mode 100644 index e4d50c3831..0000000000 --- a/contrib/libs/grpc/src/python/grpcio/_parallel_compile_patch.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2018 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Patches the compile() to allow enable parallel compilation of C/C++. - -build_ext has lots of C/C++ files and normally them one by one. -Enabling parallel build helps a lot. -""" - -import distutils.ccompiler -import os - -try: - BUILD_EXT_COMPILER_JOBS = int( - os.environ['GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS']) -except KeyError: - import multiprocessing - BUILD_EXT_COMPILER_JOBS = multiprocessing.cpu_count() -except ValueError: - BUILD_EXT_COMPILER_JOBS = 1 - - -# monkey-patch for parallel compilation -def _parallel_compile(self, - sources, - output_dir=None, - macros=None, - include_dirs=None, - debug=0, - extra_preargs=None, - extra_postargs=None, - depends=None): - # setup the same way as distutils.ccompiler.CCompiler - # https://github.com/python/cpython/blob/31368a4f0e531c19affe2a1becd25fc316bc7501/Lib/distutils/ccompiler.py#L564 - macros, objects, extra_postargs, pp_opts, build = self._setup_compile( - str(output_dir), macros, include_dirs, sources, depends, extra_postargs) - cc_args = self._get_cc_args(pp_opts, debug, extra_preargs) - - def _compile_single_file(obj): - try: - src, ext = build[obj] - except KeyError: - return - self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) - - # run compilation of individual files in parallel - import multiprocessing.pool - multiprocessing.pool.ThreadPool(BUILD_EXT_COMPILER_JOBS).map( - _compile_single_file, objects) - return objects - - -def monkeypatch_compile_maybe(): - """Monkeypatching is dumb, but the build speed gain is worth it.""" - if BUILD_EXT_COMPILER_JOBS > 1: - distutils.ccompiler.CCompiler.compile = _parallel_compile diff --git a/contrib/libs/grpc/src/python/grpcio/_spawn_patch.py b/contrib/libs/grpc/src/python/grpcio/_spawn_patch.py deleted file mode 100644 index 377cc7a9f3..0000000000 --- a/contrib/libs/grpc/src/python/grpcio/_spawn_patch.py +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2016 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Patches the spawn() command for windows compilers. - -Windows has an 8191 character command line limit, but some compilers -support an @command_file directive where command_file is a file -containing the full command line. -""" - -from distutils import ccompiler -import os -import os.path -import shutil -import sys -import tempfile - -MAX_COMMAND_LENGTH = 8191 - -_classic_spawn = ccompiler.CCompiler.spawn - - -def _commandfile_spawn(self, command): - command_length = sum([len(arg) for arg in command]) - if os.name == 'nt' and command_length > MAX_COMMAND_LENGTH: - # Even if this command doesn't support the @command_file, it will - # fail as is so we try blindly - print('Command line length exceeded, using command file') - print(' '.join(command)) - temporary_directory = tempfile.mkdtemp() - command_filename = os.path.abspath( - os.path.join(temporary_directory, 'command')) - with open(command_filename, 'w') as command_file: - escaped_args = [ - '"' + arg.replace('\\', '\\\\') + '"' for arg in command[1:] - ] - command_file.write(' '.join(escaped_args)) - modified_command = command[:1] + ['@{}'.format(command_filename)] - try: - _classic_spawn(self, modified_command) - finally: - shutil.rmtree(temporary_directory) - else: - _classic_spawn(self, command) - - -def monkeypatch_spawn(): - """Monkeypatching is dumb, but it's either that or we become maintainers of - something much, much bigger.""" - ccompiler.CCompiler.spawn = _commandfile_spawn diff --git a/contrib/libs/grpc/src/python/grpcio/commands.py b/contrib/libs/grpc/src/python/grpcio/commands.py deleted file mode 100644 index d1a756e185..0000000000 --- a/contrib/libs/grpc/src/python/grpcio/commands.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Provides distutils command classes for the GRPC Python setup process.""" - -# NOTE(https://github.com/grpc/grpc/issues/24028): allow setuptools to monkey -# patch distutils -import setuptools # isort:skip - -import glob -import os -import os.path -import shutil -import subprocess -import sys -import sysconfig -import traceback - -from setuptools.command import build_ext -from setuptools.command import build_py -import support - -PYTHON_STEM = os.path.dirname(os.path.abspath(__file__)) -GRPC_STEM = os.path.abspath(PYTHON_STEM + '../../../../') -PROTO_STEM = os.path.join(GRPC_STEM, 'src', 'proto') -PROTO_GEN_STEM = os.path.join(GRPC_STEM, 'src', 'python', 'gens') -CYTHON_STEM = os.path.join(PYTHON_STEM, 'grpc', '_cython') - - -class CommandError(Exception): - """Simple exception class for GRPC custom commands.""" - - -# TODO(atash): Remove this once PyPI has better Linux bdist support. See -# https://bitbucket.org/pypa/pypi/issues/120/binary-wheels-for-linux-are-not-supported -def _get_grpc_custom_bdist(decorated_basename, target_bdist_basename): - """Returns a string path to a bdist file for Linux to install. - - If we can retrieve a pre-compiled bdist from online, uses it. Else, emits a - warning and builds from source. - """ - # TODO(atash): somehow the name that's returned from `wheel` is different - # between different versions of 'wheel' (but from a compatibility standpoint, - # the names are compatible); we should have some way of determining name - # compatibility in the same way `wheel` does to avoid having to rename all of - # the custom wheels that we build/upload to GCS. - - # Break import style to ensure that setup.py has had a chance to install the - # relevant package. - from six.moves.urllib import request - decorated_path = decorated_basename + GRPC_CUSTOM_BDIST_EXT - try: - url = BINARIES_REPOSITORY + '/{target}'.format(target=decorated_path) - bdist_data = request.urlopen(url).read() - except IOError as error: - raise CommandError('{}\n\nCould not find the bdist {}: {}'.format( - traceback.format_exc(), decorated_path, error.message)) - # Our chosen local bdist path. - bdist_path = target_bdist_basename + GRPC_CUSTOM_BDIST_EXT - try: - with open(bdist_path, 'w') as bdist_file: - bdist_file.write(bdist_data) - except IOError as error: - raise CommandError('{}\n\nCould not write grpcio bdist: {}'.format( - traceback.format_exc(), error.message)) - return bdist_path - - -class SphinxDocumentation(setuptools.Command): - """Command to generate documentation via sphinx.""" - - description = 'generate sphinx documentation' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - # We import here to ensure that setup.py has had a chance to install the - # relevant package eggs first. - import sphinx.cmd.build - source_dir = os.path.join(GRPC_STEM, 'doc', 'python', 'sphinx') - target_dir = os.path.join(GRPC_STEM, 'doc', 'build') - exit_code = sphinx.cmd.build.build_main( - ['-b', 'html', '-W', '--keep-going', source_dir, target_dir]) - if exit_code != 0: - raise CommandError( - "Documentation generation has warnings or errors") - - -class BuildProjectMetadata(setuptools.Command): - """Command to generate project metadata in a module.""" - - description = 'build grpcio project metadata files' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - with open(os.path.join(PYTHON_STEM, 'grpc/_grpcio_metadata.py'), - 'w') as module_file: - module_file.write('__version__ = """{}"""'.format( - self.distribution.get_version())) - - -class BuildPy(build_py.build_py): - """Custom project build command.""" - - def run(self): - self.run_command('build_project_metadata') - build_py.build_py.run(self) - - -def _poison_extensions(extensions, message): - """Includes a file that will always fail to compile in all extensions.""" - poison_filename = os.path.join(PYTHON_STEM, 'poison.c') - with open(poison_filename, 'w') as poison: - poison.write('#error {}'.format(message)) - for extension in extensions: - extension.sources = [poison_filename] - - -def check_and_update_cythonization(extensions): - """Replace .pyx files with their generated counterparts and return whether or - not cythonization still needs to occur.""" - for extension in extensions: - generated_pyx_sources = [] - other_sources = [] - for source in extension.sources: - base, file_ext = os.path.splitext(source) - if file_ext == '.pyx': - generated_pyx_source = next((base + gen_ext for gen_ext in ( - '.c', - '.cpp', - ) if os.path.isfile(base + gen_ext)), None) - if generated_pyx_source: - generated_pyx_sources.append(generated_pyx_source) - else: - sys.stderr.write('Cython-generated files are missing...\n') - return False - else: - other_sources.append(source) - extension.sources = generated_pyx_sources + other_sources - sys.stderr.write('Found cython-generated files...\n') - return True - - -def try_cythonize(extensions, linetracing=False, mandatory=True): - """Attempt to cythonize the extensions. - - Args: - extensions: A list of `distutils.extension.Extension`. - linetracing: A bool indicating whether or not to enable linetracing. - mandatory: Whether or not having Cython-generated files is mandatory. If it - is, extensions will be poisoned when they can't be fully generated. - """ - try: - # Break import style to ensure we have access to Cython post-setup_requires - import Cython.Build - except ImportError: - if mandatory: - sys.stderr.write( - "This package needs to generate C files with Cython but it cannot. " - "Poisoning extension sources to disallow extension commands...") - _poison_extensions( - extensions, - "Extensions have been poisoned due to missing Cython-generated code." - ) - return extensions - cython_compiler_directives = {} - if linetracing: - additional_define_macros = [('CYTHON_TRACE_NOGIL', '1')] - cython_compiler_directives['linetrace'] = True - return Cython.Build.cythonize( - extensions, - include_path=[ - include_dir for extension in extensions - for include_dir in extension.include_dirs - ] + [CYTHON_STEM], - compiler_directives=cython_compiler_directives) - - -class BuildExt(build_ext.build_ext): - """Custom build_ext command to enable compiler-specific flags.""" - - C_OPTIONS = { - 'unix': ('-pthread',), - 'msvc': (), - } - LINK_OPTIONS = {} - - def get_ext_filename(self, ext_name): - # since python3.5, python extensions' shared libraries use a suffix that corresponds to the value - # of sysconfig.get_config_var('EXT_SUFFIX') and contains info about the architecture the library targets. - # E.g. on x64 linux the suffix is ".cpython-XYZ-x86_64-linux-gnu.so" - # When crosscompiling python wheels, we need to be able to override this suffix - # so that the resulting file name matches the target architecture and we end up with a well-formed - # wheel. - filename = build_ext.build_ext.get_ext_filename(self, ext_name) - orig_ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') - new_ext_suffix = os.getenv('GRPC_PYTHON_OVERRIDE_EXT_SUFFIX') - if new_ext_suffix and filename.endswith(orig_ext_suffix): - filename = filename[:-len(orig_ext_suffix)] + new_ext_suffix - return filename - - def build_extensions(self): - - def compiler_ok_with_extra_std(): - """Test if default compiler is okay with specifying c++ version - when invoked in C mode. GCC is okay with this, while clang is not. - """ - try: - # TODO(lidiz) Remove the generated a.out for success tests. - cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'], - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - _, cc_err = cc_test.communicate(input=b'int main(){return 0;}') - return not 'invalid argument' in str(cc_err) - except: - sys.stderr.write('Non-fatal exception:' + - traceback.format_exc() + '\n') - return False - - # This special conditioning is here due to difference of compiler - # behavior in gcc and clang. The clang doesn't take --stdc++11 - # flags but gcc does. Since the setuptools of Python only support - # all C or all C++ compilation, the mix of C and C++ will crash. - # *By default*, macOS and FreBSD use clang and Linux use gcc - # - # If we are not using a permissive compiler that's OK with being - # passed wrong std flags, swap out compile function by adding a filter - # for it. - if not compiler_ok_with_extra_std(): - old_compile = self.compiler._compile - - def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts): - if src.endswith('.c'): - extra_postargs = [ - arg for arg in extra_postargs if not '-std=c++' in arg - ] - elif src.endswith('.cc') or src.endswith('.cpp'): - extra_postargs = [ - arg for arg in extra_postargs if not '-std=gnu99' in arg - ] - return old_compile(obj, src, ext, cc_args, extra_postargs, - pp_opts) - - self.compiler._compile = new_compile - - compiler = self.compiler.compiler_type - if compiler in BuildExt.C_OPTIONS: - for extension in self.extensions: - extension.extra_compile_args += list( - BuildExt.C_OPTIONS[compiler]) - if compiler in BuildExt.LINK_OPTIONS: - for extension in self.extensions: - extension.extra_link_args += list( - BuildExt.LINK_OPTIONS[compiler]) - if not check_and_update_cythonization(self.extensions): - self.extensions = try_cythonize(self.extensions) - try: - build_ext.build_ext.build_extensions(self) - except Exception as error: - formatted_exception = traceback.format_exc() - support.diagnose_build_ext_error(self, error, formatted_exception) - raise CommandError( - "Failed `build_ext` step:\n{}".format(formatted_exception)) - - -class Gather(setuptools.Command): - """Command to gather project dependencies.""" - - description = 'gather dependencies for grpcio' - user_options = [ - ('test', 't', 'flag indicating to gather test dependencies'), - ('install', 'i', 'flag indicating to gather install dependencies') - ] - - def initialize_options(self): - self.test = False - self.install = False - - def finalize_options(self): - # distutils requires this override. - pass - - def run(self): - if self.install and self.distribution.install_requires: - self.distribution.fetch_build_eggs( - self.distribution.install_requires) - if self.test and self.distribution.tests_require: - self.distribution.fetch_build_eggs(self.distribution.tests_require) - - -class Clean(setuptools.Command): - """Command to clean build artifacts.""" - - description = 'Clean build artifacts.' - user_options = [ - ('all', 'a', 'a phony flag to allow our script to continue'), - ] - - _FILE_PATTERNS = ( - 'python_build', - 'src/python/grpcio/__pycache__/', - 'src/python/grpcio/grpc/_cython/cygrpc.cpp', - 'src/python/grpcio/grpc/_cython/*.so', - 'src/python/grpcio/grpcio.egg-info/', - ) - _CURRENT_DIRECTORY = os.path.normpath( - os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../..")) - - def initialize_options(self): - self.all = False - - def finalize_options(self): - pass - - def run(self): - for path_spec in self._FILE_PATTERNS: - this_glob = os.path.normpath( - os.path.join(Clean._CURRENT_DIRECTORY, path_spec)) - abs_paths = glob.glob(this_glob) - for path in abs_paths: - if not str(path).startswith(Clean._CURRENT_DIRECTORY): - raise ValueError( - "Cowardly refusing to delete {}.".format(path)) - print("Removing {}".format(os.path.relpath(path))) - if os.path.isfile(path): - os.remove(str(path)) - else: - shutil.rmtree(str(path)) diff --git a/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py b/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py deleted file mode 100644 index 338b05b1ca..0000000000 --- a/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py +++ /dev/null @@ -1,1292 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_core_dependencies.py.template`!!! - -CORE_SOURCE_FILES = [ - 'src/core/ext/filters/census/grpc_context.cc', - 'src/core/ext/filters/client_channel/backend_metric.cc', - 'src/core/ext/filters/client_channel/backup_poller.cc', - 'src/core/ext/filters/client_channel/channel_connectivity.cc', - 'src/core/ext/filters/client_channel/client_channel.cc', - 'src/core/ext/filters/client_channel/client_channel_channelz.cc', - 'src/core/ext/filters/client_channel/client_channel_factory.cc', - 'src/core/ext/filters/client_channel/client_channel_plugin.cc', - 'src/core/ext/filters/client_channel/config_selector.cc', - 'src/core/ext/filters/client_channel/dynamic_filters.cc', - 'src/core/ext/filters/client_channel/global_subchannel_pool.cc', - 'src/core/ext/filters/client_channel/health/health_check_client.cc', - 'src/core/ext/filters/client_channel/http_connect_handshaker.cc', - 'src/core/ext/filters/client_channel/http_proxy.cc', - 'src/core/ext/filters/client_channel/lb_policy.cc', - 'src/core/ext/filters/client_channel/lb_policy/address_filtering.cc', - 'src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', - 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', - 'src/core/ext/filters/client_channel/lb_policy/priority/priority.cc', - 'src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc', - 'src/core/ext/filters/client_channel/lb_policy/rls/rls.cc', - 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', - 'src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc', - 'src/core/ext/filters/client_channel/lb_policy/xds/cds.cc', - 'src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc', - 'src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc', - 'src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc', - 'src/core/ext/filters/client_channel/lb_policy_registry.cc', - 'src/core/ext/filters/client_channel/local_subchannel_pool.cc', - 'src/core/ext/filters/client_channel/proxy_mapper_registry.cc', - 'src/core/ext/filters/client_channel/resolver.cc', - 'src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc', - 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', - 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc', - 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc', - 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc', - 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc', - 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc', - 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc', - 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc', - 'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc', - 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', - 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', - 'src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc', - 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', - 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', - 'src/core/ext/filters/client_channel/resolver_registry.cc', - 'src/core/ext/filters/client_channel/resolver_result_parsing.cc', - 'src/core/ext/filters/client_channel/retry_filter.cc', - 'src/core/ext/filters/client_channel/retry_service_config.cc', - 'src/core/ext/filters/client_channel/retry_throttle.cc', - 'src/core/ext/filters/client_channel/server_address.cc', - 'src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc', - 'src/core/ext/filters/client_channel/subchannel.cc', - 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', - 'src/core/ext/filters/client_idle/client_idle_filter.cc', - 'src/core/ext/filters/client_idle/idle_filter_state.cc', - 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/fault_injection/fault_injection_filter.cc', - 'src/core/ext/filters/fault_injection/service_config_parser.cc', - 'src/core/ext/filters/http/client/http_client_filter.cc', - 'src/core/ext/filters/http/client_authority_filter.cc', - 'src/core/ext/filters/http/http_filters_plugin.cc', - 'src/core/ext/filters/http/message_compress/message_compress_filter.cc', - 'src/core/ext/filters/http/message_compress/message_decompress_filter.cc', - 'src/core/ext/filters/http/server/http_server_filter.cc', - 'src/core/ext/filters/max_age/max_age_filter.cc', - 'src/core/ext/filters/message_size/message_size_filter.cc', - 'src/core/ext/filters/server_config_selector/server_config_selector.cc', - 'src/core/ext/filters/server_config_selector/server_config_selector_filter.cc', - 'src/core/ext/service_config/service_config.cc', - 'src/core/ext/service_config/service_config_parser.cc', - 'src/core/ext/transport/chttp2/alpn/alpn.cc', - 'src/core/ext/transport/chttp2/client/chttp2_connector.cc', - 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', - 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', - 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc', - 'src/core/ext/transport/chttp2/server/chttp2_server.cc', - 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc', - 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc', - 'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc', - 'src/core/ext/transport/chttp2/transport/bin_decoder.cc', - 'src/core/ext/transport/chttp2/transport/bin_encoder.cc', - 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc', - 'src/core/ext/transport/chttp2/transport/chttp2_transport.cc', - 'src/core/ext/transport/chttp2/transport/context_list.cc', - 'src/core/ext/transport/chttp2/transport/flow_control.cc', - 'src/core/ext/transport/chttp2/transport/frame_data.cc', - 'src/core/ext/transport/chttp2/transport/frame_goaway.cc', - 'src/core/ext/transport/chttp2/transport/frame_ping.cc', - 'src/core/ext/transport/chttp2/transport/frame_rst_stream.cc', - 'src/core/ext/transport/chttp2/transport/frame_settings.cc', - 'src/core/ext/transport/chttp2/transport/frame_window_update.cc', - 'src/core/ext/transport/chttp2/transport/hpack_encoder.cc', - 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc', - 'src/core/ext/transport/chttp2/transport/hpack_parser.cc', - 'src/core/ext/transport/chttp2/transport/hpack_parser_table.cc', - 'src/core/ext/transport/chttp2/transport/hpack_utils.cc', - 'src/core/ext/transport/chttp2/transport/http2_settings.cc', - 'src/core/ext/transport/chttp2/transport/huffsyms.cc', - 'src/core/ext/transport/chttp2/transport/parsing.cc', - 'src/core/ext/transport/chttp2/transport/stream_lists.cc', - 'src/core/ext/transport/chttp2/transport/stream_map.cc', - 'src/core/ext/transport/chttp2/transport/varint.cc', - 'src/core/ext/transport/chttp2/transport/writing.cc', - 'src/core/ext/transport/inproc/inproc_plugin.cc', - 'src/core/ext/transport/inproc/inproc_transport.cc', - 'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c', - 'src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c', - 'src/core/ext/upb-generated/envoy/annotations/resource.upb.c', - 'src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c', - 'src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c', - 'src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c', - 'src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c', - 'src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c', - 'src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c', - 'src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c', - 'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c', - 'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c', - 'src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c', - 'src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c', - 'src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c', - 'src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c', - 'src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c', - 'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c', - 'src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c', - 'src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c', - 'src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c', - 'src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c', - 'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c', - 'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c', - 'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c', - 'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c', - 'src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c', - 'src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c', - 'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c', - 'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c', - 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c', - 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c', - 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c', - 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c', - 'src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c', - 'src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c', - 'src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c', - 'src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c', - 'src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c', - 'src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c', - 'src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c', - 'src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c', - 'src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c', - 'src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c', - 'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c', - 'src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c', - 'src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c', - 'src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c', - 'src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c', - 'src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c', - 'src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c', - 'src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c', - 'src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c', - 'src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c', - 'src/core/ext/upb-generated/envoy/type/v3/http.upb.c', - 'src/core/ext/upb-generated/envoy/type/v3/percent.upb.c', - 'src/core/ext/upb-generated/envoy/type/v3/range.upb.c', - 'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c', - 'src/core/ext/upb-generated/google/api/annotations.upb.c', - 'src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c', - 'src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c', - 'src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c', - 'src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c', - 'src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c', - 'src/core/ext/upb-generated/google/api/http.upb.c', - 'src/core/ext/upb-generated/google/protobuf/any.upb.c', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', - 'src/core/ext/upb-generated/google/rpc/status.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', - 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c', - 'src/core/ext/upb-generated/udpa/annotations/migrate.upb.c', - 'src/core/ext/upb-generated/udpa/annotations/security.upb.c', - 'src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c', - 'src/core/ext/upb-generated/udpa/annotations/status.upb.c', - 'src/core/ext/upb-generated/udpa/annotations/versioning.upb.c', - 'src/core/ext/upb-generated/validate/validate.upb.c', - 'src/core/ext/upb-generated/xds/annotations/v3/status.upb.c', - 'src/core/ext/upb-generated/xds/core/v3/authority.upb.c', - 'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c', - 'src/core/ext/upb-generated/xds/core/v3/context_params.upb.c', - 'src/core/ext/upb-generated/xds/core/v3/resource.upb.c', - 'src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c', - 'src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c', - 'src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c', - 'src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c', - 'src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c', - 'src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/api/http.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c', - 'src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c', - 'src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c', - 'src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c', - 'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c', - 'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c', - 'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c', - 'src/core/ext/upbdefs-generated/validate/validate.upbdefs.c', - 'src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c', - 'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c', - 'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c', - 'src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c', - 'src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c', - 'src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c', - 'src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c', - 'src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c', - 'src/core/ext/xds/certificate_provider_registry.cc', - 'src/core/ext/xds/certificate_provider_store.cc', - 'src/core/ext/xds/file_watcher_certificate_provider_factory.cc', - 'src/core/ext/xds/xds_api.cc', - 'src/core/ext/xds/xds_bootstrap.cc', - 'src/core/ext/xds/xds_certificate_provider.cc', - 'src/core/ext/xds/xds_channel_stack_modifier.cc', - 'src/core/ext/xds/xds_client.cc', - 'src/core/ext/xds/xds_client_stats.cc', - 'src/core/ext/xds/xds_http_fault_filter.cc', - 'src/core/ext/xds/xds_http_filters.cc', - 'src/core/ext/xds/xds_routing.cc', - 'src/core/ext/xds/xds_server_config_fetcher.cc', - 'src/core/lib/address_utils/parse_address.cc', - 'src/core/lib/address_utils/sockaddr_utils.cc', - 'src/core/lib/backoff/backoff.cc', - 'src/core/lib/channel/channel_args.cc', - 'src/core/lib/channel/channel_args_preconditioning.cc', - 'src/core/lib/channel/channel_stack.cc', - 'src/core/lib/channel/channel_stack_builder.cc', - 'src/core/lib/channel/channel_trace.cc', - 'src/core/lib/channel/channelz.cc', - 'src/core/lib/channel/channelz_registry.cc', - 'src/core/lib/channel/connected_channel.cc', - 'src/core/lib/channel/handshaker.cc', - 'src/core/lib/channel/handshaker_registry.cc', - 'src/core/lib/channel/status_util.cc', - 'src/core/lib/compression/compression.cc', - 'src/core/lib/compression/compression_args.cc', - 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/message_compress.cc', - 'src/core/lib/compression/stream_compression.cc', - 'src/core/lib/compression/stream_compression_gzip.cc', - 'src/core/lib/compression/stream_compression_identity.cc', - 'src/core/lib/config/core_configuration.cc', - 'src/core/lib/debug/stats.cc', - 'src/core/lib/debug/stats_data.cc', - 'src/core/lib/debug/trace.cc', - 'src/core/lib/event_engine/channel_args_endpoint_config.cc', - 'src/core/lib/event_engine/event_engine.cc', - 'src/core/lib/event_engine/event_engine_factory.cc', - 'src/core/lib/event_engine/memory_allocator.cc', - 'src/core/lib/event_engine/sockaddr.cc', - 'src/core/lib/gpr/alloc.cc', - 'src/core/lib/gpr/atm.cc', - 'src/core/lib/gpr/cpu_iphone.cc', - 'src/core/lib/gpr/cpu_linux.cc', - 'src/core/lib/gpr/cpu_posix.cc', - 'src/core/lib/gpr/cpu_windows.cc', - 'src/core/lib/gpr/env_linux.cc', - 'src/core/lib/gpr/env_posix.cc', - 'src/core/lib/gpr/env_windows.cc', - 'src/core/lib/gpr/log.cc', - 'src/core/lib/gpr/log_android.cc', - 'src/core/lib/gpr/log_linux.cc', - 'src/core/lib/gpr/log_posix.cc', - 'src/core/lib/gpr/log_windows.cc', - 'src/core/lib/gpr/murmur_hash.cc', - 'src/core/lib/gpr/string.cc', - 'src/core/lib/gpr/string_posix.cc', - 'src/core/lib/gpr/string_util_windows.cc', - 'src/core/lib/gpr/string_windows.cc', - 'src/core/lib/gpr/sync.cc', - 'src/core/lib/gpr/sync_abseil.cc', - 'src/core/lib/gpr/sync_posix.cc', - 'src/core/lib/gpr/sync_windows.cc', - 'src/core/lib/gpr/time.cc', - 'src/core/lib/gpr/time_posix.cc', - 'src/core/lib/gpr/time_precise.cc', - 'src/core/lib/gpr/time_windows.cc', - 'src/core/lib/gpr/tmpfile_msys.cc', - 'src/core/lib/gpr/tmpfile_posix.cc', - 'src/core/lib/gpr/tmpfile_windows.cc', - 'src/core/lib/gpr/wrap_memcpy.cc', - 'src/core/lib/gprpp/arena.cc', - 'src/core/lib/gprpp/examine_stack.cc', - 'src/core/lib/gprpp/fork.cc', - 'src/core/lib/gprpp/global_config_env.cc', - 'src/core/lib/gprpp/host_port.cc', - 'src/core/lib/gprpp/mpscq.cc', - 'src/core/lib/gprpp/stat_posix.cc', - 'src/core/lib/gprpp/stat_windows.cc', - 'src/core/lib/gprpp/status_helper.cc', - 'src/core/lib/gprpp/thd_posix.cc', - 'src/core/lib/gprpp/thd_windows.cc', - 'src/core/lib/gprpp/time_util.cc', - 'src/core/lib/http/format_request.cc', - 'src/core/lib/http/httpcli.cc', - 'src/core/lib/http/httpcli_security_connector.cc', - 'src/core/lib/http/parser.cc', - 'src/core/lib/iomgr/buffer_list.cc', - 'src/core/lib/iomgr/call_combiner.cc', - 'src/core/lib/iomgr/cfstream_handle.cc', - 'src/core/lib/iomgr/combiner.cc', - 'src/core/lib/iomgr/dualstack_socket_posix.cc', - 'src/core/lib/iomgr/endpoint.cc', - 'src/core/lib/iomgr/endpoint_cfstream.cc', - 'src/core/lib/iomgr/endpoint_pair_event_engine.cc', - 'src/core/lib/iomgr/endpoint_pair_posix.cc', - 'src/core/lib/iomgr/endpoint_pair_windows.cc', - 'src/core/lib/iomgr/error.cc', - 'src/core/lib/iomgr/error_cfstream.cc', - 'src/core/lib/iomgr/ev_apple.cc', - 'src/core/lib/iomgr/ev_epoll1_linux.cc', - 'src/core/lib/iomgr/ev_epollex_linux.cc', - 'src/core/lib/iomgr/ev_poll_posix.cc', - 'src/core/lib/iomgr/ev_posix.cc', - 'src/core/lib/iomgr/ev_windows.cc', - 'src/core/lib/iomgr/event_engine/closure.cc', - 'src/core/lib/iomgr/event_engine/endpoint.cc', - 'src/core/lib/iomgr/event_engine/iomgr.cc', - 'src/core/lib/iomgr/event_engine/pollset.cc', - 'src/core/lib/iomgr/event_engine/resolved_address_internal.cc', - 'src/core/lib/iomgr/event_engine/resolver.cc', - 'src/core/lib/iomgr/event_engine/tcp.cc', - 'src/core/lib/iomgr/event_engine/timer.cc', - 'src/core/lib/iomgr/exec_ctx.cc', - 'src/core/lib/iomgr/executor.cc', - 'src/core/lib/iomgr/executor/mpmcqueue.cc', - 'src/core/lib/iomgr/executor/threadpool.cc', - 'src/core/lib/iomgr/fork_posix.cc', - 'src/core/lib/iomgr/fork_windows.cc', - 'src/core/lib/iomgr/gethostname_fallback.cc', - 'src/core/lib/iomgr/gethostname_host_name_max.cc', - 'src/core/lib/iomgr/gethostname_sysconf.cc', - 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc', - 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc', - 'src/core/lib/iomgr/internal_errqueue.cc', - 'src/core/lib/iomgr/iocp_windows.cc', - 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_custom.cc', - 'src/core/lib/iomgr/iomgr_internal.cc', - 'src/core/lib/iomgr/iomgr_posix.cc', - 'src/core/lib/iomgr/iomgr_posix_cfstream.cc', - 'src/core/lib/iomgr/iomgr_windows.cc', - 'src/core/lib/iomgr/is_epollexclusive_available.cc', - 'src/core/lib/iomgr/load_file.cc', - 'src/core/lib/iomgr/lockfree_event.cc', - 'src/core/lib/iomgr/polling_entity.cc', - 'src/core/lib/iomgr/pollset.cc', - 'src/core/lib/iomgr/pollset_custom.cc', - 'src/core/lib/iomgr/pollset_set.cc', - 'src/core/lib/iomgr/pollset_set_custom.cc', - 'src/core/lib/iomgr/pollset_set_windows.cc', - 'src/core/lib/iomgr/pollset_windows.cc', - 'src/core/lib/iomgr/resolve_address.cc', - 'src/core/lib/iomgr/resolve_address_custom.cc', - 'src/core/lib/iomgr/resolve_address_posix.cc', - 'src/core/lib/iomgr/resolve_address_windows.cc', - 'src/core/lib/iomgr/socket_factory_posix.cc', - 'src/core/lib/iomgr/socket_mutator.cc', - 'src/core/lib/iomgr/socket_utils_common_posix.cc', - 'src/core/lib/iomgr/socket_utils_linux.cc', - 'src/core/lib/iomgr/socket_utils_posix.cc', - 'src/core/lib/iomgr/socket_utils_windows.cc', - 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/tcp_client.cc', - 'src/core/lib/iomgr/tcp_client_cfstream.cc', - 'src/core/lib/iomgr/tcp_client_custom.cc', - 'src/core/lib/iomgr/tcp_client_posix.cc', - 'src/core/lib/iomgr/tcp_client_windows.cc', - 'src/core/lib/iomgr/tcp_custom.cc', - 'src/core/lib/iomgr/tcp_posix.cc', - 'src/core/lib/iomgr/tcp_server.cc', - 'src/core/lib/iomgr/tcp_server_custom.cc', - 'src/core/lib/iomgr/tcp_server_posix.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_common.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc', - 'src/core/lib/iomgr/tcp_server_windows.cc', - 'src/core/lib/iomgr/tcp_windows.cc', - 'src/core/lib/iomgr/time_averaged_stats.cc', - 'src/core/lib/iomgr/timer.cc', - 'src/core/lib/iomgr/timer_custom.cc', - 'src/core/lib/iomgr/timer_generic.cc', - 'src/core/lib/iomgr/timer_heap.cc', - 'src/core/lib/iomgr/timer_manager.cc', - 'src/core/lib/iomgr/unix_sockets_posix.cc', - 'src/core/lib/iomgr/unix_sockets_posix_noop.cc', - 'src/core/lib/iomgr/wakeup_fd_eventfd.cc', - 'src/core/lib/iomgr/wakeup_fd_nospecial.cc', - 'src/core/lib/iomgr/wakeup_fd_pipe.cc', - 'src/core/lib/iomgr/wakeup_fd_posix.cc', - 'src/core/lib/iomgr/work_serializer.cc', - 'src/core/lib/json/json_reader.cc', - 'src/core/lib/json/json_util.cc', - 'src/core/lib/json/json_writer.cc', - 'src/core/lib/matchers/matchers.cc', - 'src/core/lib/profiling/basic_timers.cc', - 'src/core/lib/profiling/stap_timers.cc', - 'src/core/lib/promise/activity.cc', - 'src/core/lib/resource_quota/api.cc', - 'src/core/lib/resource_quota/memory_quota.cc', - 'src/core/lib/resource_quota/resource_quota.cc', - 'src/core/lib/resource_quota/thread_quota.cc', - 'src/core/lib/resource_quota/trace.cc', - 'src/core/lib/security/authorization/authorization_policy_provider_vtable.cc', - 'src/core/lib/security/authorization/evaluate_args.cc', - 'src/core/lib/security/authorization/sdk_server_authz_filter.cc', - 'src/core/lib/security/context/security_context.cc', - 'src/core/lib/security/credentials/alts/alts_credentials.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', - 'src/core/lib/security/credentials/composite/composite_credentials.cc', - 'src/core/lib/security/credentials/credentials.cc', - 'src/core/lib/security/credentials/credentials_metadata.cc', - 'src/core/lib/security/credentials/external/aws_external_account_credentials.cc', - 'src/core/lib/security/credentials/external/aws_request_signer.cc', - 'src/core/lib/security/credentials/external/external_account_credentials.cc', - 'src/core/lib/security/credentials/external/file_external_account_credentials.cc', - 'src/core/lib/security/credentials/external/url_external_account_credentials.cc', - 'src/core/lib/security/credentials/fake/fake_credentials.cc', - 'src/core/lib/security/credentials/google_default/credentials_generic.cc', - 'src/core/lib/security/credentials/google_default/google_default_credentials.cc', - 'src/core/lib/security/credentials/iam/iam_credentials.cc', - 'src/core/lib/security/credentials/insecure/insecure_credentials.cc', - 'src/core/lib/security/credentials/jwt/json_token.cc', - 'src/core/lib/security/credentials/jwt/jwt_credentials.cc', - 'src/core/lib/security/credentials/jwt/jwt_verifier.cc', - 'src/core/lib/security/credentials/local/local_credentials.cc', - 'src/core/lib/security/credentials/oauth2/oauth2_credentials.cc', - 'src/core/lib/security/credentials/plugin/plugin_credentials.cc', - 'src/core/lib/security/credentials/ssl/ssl_credentials.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc', - 'src/core/lib/security/credentials/tls/tls_credentials.cc', - 'src/core/lib/security/credentials/tls/tls_utils.cc', - 'src/core/lib/security/credentials/xds/xds_credentials.cc', - 'src/core/lib/security/security_connector/alts/alts_security_connector.cc', - 'src/core/lib/security/security_connector/fake/fake_security_connector.cc', - 'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc', - 'src/core/lib/security/security_connector/load_system_roots_fallback.cc', - 'src/core/lib/security/security_connector/load_system_roots_linux.cc', - 'src/core/lib/security/security_connector/local/local_security_connector.cc', - 'src/core/lib/security/security_connector/security_connector.cc', - 'src/core/lib/security/security_connector/ssl/ssl_security_connector.cc', - 'src/core/lib/security/security_connector/ssl_utils.cc', - 'src/core/lib/security/security_connector/ssl_utils_config.cc', - 'src/core/lib/security/security_connector/tls/tls_security_connector.cc', - 'src/core/lib/security/transport/client_auth_filter.cc', - 'src/core/lib/security/transport/secure_endpoint.cc', - 'src/core/lib/security/transport/security_handshaker.cc', - 'src/core/lib/security/transport/server_auth_filter.cc', - 'src/core/lib/security/transport/tsi_error.cc', - 'src/core/lib/security/util/json_util.cc', - 'src/core/lib/slice/b64.cc', - 'src/core/lib/slice/percent_encoding.cc', - 'src/core/lib/slice/slice.cc', - 'src/core/lib/slice/slice_api.cc', - 'src/core/lib/slice/slice_buffer.cc', - 'src/core/lib/slice/slice_intern.cc', - 'src/core/lib/slice/slice_refcount.cc', - 'src/core/lib/slice/slice_split.cc', - 'src/core/lib/slice/slice_string_helpers.cc', - 'src/core/lib/slice/static_slice.cc', - 'src/core/lib/surface/api_trace.cc', - 'src/core/lib/surface/builtins.cc', - 'src/core/lib/surface/byte_buffer.cc', - 'src/core/lib/surface/byte_buffer_reader.cc', - 'src/core/lib/surface/call.cc', - 'src/core/lib/surface/call_details.cc', - 'src/core/lib/surface/call_log_batch.cc', - 'src/core/lib/surface/channel.cc', - 'src/core/lib/surface/channel_init.cc', - 'src/core/lib/surface/channel_ping.cc', - 'src/core/lib/surface/channel_stack_type.cc', - 'src/core/lib/surface/completion_queue.cc', - 'src/core/lib/surface/completion_queue_factory.cc', - 'src/core/lib/surface/event_string.cc', - 'src/core/lib/surface/init.cc', - 'src/core/lib/surface/init_secure.cc', - 'src/core/lib/surface/lame_client.cc', - 'src/core/lib/surface/metadata_array.cc', - 'src/core/lib/surface/server.cc', - 'src/core/lib/surface/validate_metadata.cc', - 'src/core/lib/surface/version.cc', - 'src/core/lib/transport/bdp_estimator.cc', - 'src/core/lib/transport/byte_stream.cc', - 'src/core/lib/transport/connectivity_state.cc', - 'src/core/lib/transport/error_utils.cc', - 'src/core/lib/transport/metadata.cc', - 'src/core/lib/transport/metadata_batch.cc', - 'src/core/lib/transport/parsed_metadata.cc', - 'src/core/lib/transport/pid_controller.cc', - 'src/core/lib/transport/static_metadata.cc', - 'src/core/lib/transport/status_conversion.cc', - 'src/core/lib/transport/status_metadata.cc', - 'src/core/lib/transport/timeout_encoding.cc', - 'src/core/lib/transport/transport.cc', - 'src/core/lib/transport/transport_op_string.cc', - 'src/core/lib/uri/uri_parser.cc', - 'src/core/plugin_registry/grpc_plugin_registry.cc', - 'src/core/tsi/alts/crypt/aes_gcm.cc', - 'src/core/tsi/alts/crypt/gsec.cc', - 'src/core/tsi/alts/frame_protector/alts_counter.cc', - 'src/core/tsi/alts/frame_protector/alts_crypter.cc', - 'src/core/tsi/alts/frame_protector/alts_frame_protector.cc', - 'src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc', - 'src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc', - 'src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc', - 'src/core/tsi/alts/frame_protector/frame_handler.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_client.cc', - 'src/core/tsi/alts/handshaker/alts_shared_resource.cc', - 'src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc', - 'src/core/tsi/alts/handshaker/alts_tsi_utils.cc', - 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc', - 'src/core/tsi/fake_transport_security.cc', - 'src/core/tsi/local_transport_security.cc', - 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', - 'src/core/tsi/ssl/session_cache/ssl_session_cache.cc', - 'src/core/tsi/ssl/session_cache/ssl_session_openssl.cc', - 'src/core/tsi/ssl_transport_security.cc', - 'src/core/tsi/transport_security.cc', - 'src/core/tsi/transport_security_grpc.cc', - 'third_party/abseil-cpp/y_absl/base/internal/cycleclock.cc', - 'third_party/abseil-cpp/y_absl/base/internal/low_level_alloc.cc', - 'third_party/abseil-cpp/y_absl/base/internal/raw_logging.cc', - 'third_party/abseil-cpp/y_absl/base/internal/spinlock.cc', - 'third_party/abseil-cpp/y_absl/base/internal/spinlock_wait.cc', - 'third_party/abseil-cpp/y_absl/base/internal/sysinfo.cc', - 'third_party/abseil-cpp/y_absl/base/internal/thread_identity.cc', - 'third_party/abseil-cpp/y_absl/base/internal/throw_delegate.cc', - 'third_party/abseil-cpp/y_absl/base/internal/unscaledcycleclock.cc', - 'third_party/abseil-cpp/y_absl/base/log_severity.cc', - 'third_party/abseil-cpp/y_absl/container/internal/hashtablez_sampler.cc', - 'third_party/abseil-cpp/y_absl/container/internal/hashtablez_sampler_force_weak_definition.cc', - 'third_party/abseil-cpp/y_absl/container/internal/raw_hash_set.cc', - 'third_party/abseil-cpp/y_absl/debugging/internal/address_is_readable.cc', - 'third_party/abseil-cpp/y_absl/debugging/internal/demangle.cc', - 'third_party/abseil-cpp/y_absl/debugging/internal/elf_mem_image.cc', - 'third_party/abseil-cpp/y_absl/debugging/internal/vdso_support.cc', - 'third_party/abseil-cpp/y_absl/debugging/stacktrace.cc', - 'third_party/abseil-cpp/y_absl/debugging/symbolize.cc', - 'third_party/abseil-cpp/y_absl/hash/internal/city.cc', - 'third_party/abseil-cpp/y_absl/hash/internal/hash.cc', - 'third_party/abseil-cpp/y_absl/hash/internal/low_level_hash.cc', - 'third_party/abseil-cpp/y_absl/numeric/int128.cc', - 'third_party/abseil-cpp/y_absl/profiling/internal/exponential_biased.cc', - 'third_party/abseil-cpp/y_absl/status/status.cc', - 'third_party/abseil-cpp/y_absl/status/status_payload_printer.cc', - 'third_party/abseil-cpp/y_absl/status/statusor.cc', - 'third_party/abseil-cpp/y_absl/strings/ascii.cc', - 'third_party/abseil-cpp/y_absl/strings/charconv.cc', - 'third_party/abseil-cpp/y_absl/strings/cord.cc', - 'third_party/abseil-cpp/y_absl/strings/escaping.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/charconv_bigint.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/charconv_parse.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/cord_internal.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_btree.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_btree_navigator.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_btree_reader.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_consume.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_ring.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/cordz_functions.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/cordz_handle.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/cordz_info.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/escaping.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/memutil.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/ostringstream.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/str_format/arg.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/str_format/bind.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/str_format/extension.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/str_format/float_conversion.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/str_format/output.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/str_format/parser.cc', - 'third_party/abseil-cpp/y_absl/strings/internal/utf8.cc', - 'third_party/abseil-cpp/y_absl/strings/match.cc', - 'third_party/abseil-cpp/y_absl/strings/numbers.cc', - 'third_party/abseil-cpp/y_absl/strings/str_cat.cc', - 'third_party/abseil-cpp/y_absl/strings/str_replace.cc', - 'third_party/abseil-cpp/y_absl/strings/str_split.cc', - 'third_party/abseil-cpp/y_absl/strings/string_view.cc', - 'third_party/abseil-cpp/y_absl/strings/substitute.cc', - 'third_party/abseil-cpp/y_absl/synchronization/barrier.cc', - 'third_party/abseil-cpp/y_absl/synchronization/blocking_counter.cc', - 'third_party/abseil-cpp/y_absl/synchronization/internal/create_thread_identity.cc', - 'third_party/abseil-cpp/y_absl/synchronization/internal/graphcycles.cc', - 'third_party/abseil-cpp/y_absl/synchronization/internal/per_thread_sem.cc', - 'third_party/abseil-cpp/y_absl/synchronization/internal/waiter.cc', - 'third_party/abseil-cpp/y_absl/synchronization/mutex.cc', - 'third_party/abseil-cpp/y_absl/synchronization/notification.cc', - 'third_party/abseil-cpp/y_absl/time/civil_time.cc', - 'third_party/abseil-cpp/y_absl/time/clock.cc', - 'third_party/abseil-cpp/y_absl/time/duration.cc', - 'third_party/abseil-cpp/y_absl/time/format.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/civil_time_detail.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_fixed.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_format.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_if.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_impl.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_info.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_libc.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_lookup.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_posix.cc', - 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/zone_info_source.cc', - 'third_party/abseil-cpp/y_absl/time/time.cc', - 'third_party/abseil-cpp/y_absl/types/bad_optional_access.cc', - 'third_party/abseil-cpp/y_absl/types/bad_variant_access.cc', - 'third_party/address_sorting/address_sorting.c', - 'third_party/address_sorting/address_sorting_posix.c', - 'third_party/address_sorting/address_sorting_windows.c', - 'third_party/boringssl-with-bazel/err_data.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_d2i_fp.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_dup.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_i2d_fp.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_utf8.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/time_support.c', - 'third_party/boringssl-with-bazel/src/crypto/base64/base64.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/bio.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/connect.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/fd.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/file.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/hexdump.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/pair.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/printf.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/socket.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c', - 'third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c', - 'third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/bn_extra/convert.c', - 'third_party/boringssl-with-bazel/src/crypto/buf/buf.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/asn1_compat.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/cbb.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/unicode.c', - 'third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/cipher_extra.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/derive_key.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesccm.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesctrhmac.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesgcmsiv.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_null.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc2.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc4.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c', - 'third_party/boringssl-with-bazel/src/crypto/cmac/cmac.c', - 'third_party/boringssl-with-bazel/src/crypto/conf/conf.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-fuchsia.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-linux.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-win.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu-arm-linux.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu-arm.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu-intel.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu-ppc64le.c', - 'third_party/boringssl-with-bazel/src/crypto/crypto.c', - 'third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c', - 'third_party/boringssl-with-bazel/src/crypto/curve25519/spake25519.c', - 'third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c', - 'third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c', - 'third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c', - 'third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_derive.c', - 'third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c', - 'third_party/boringssl-with-bazel/src/crypto/ecdh_extra/ecdh_extra.c', - 'third_party/boringssl-with-bazel/src/crypto/ecdsa_extra/ecdsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/engine/engine.c', - 'third_party/boringssl-with-bazel/src/crypto/err/err.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/digestsign.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/evp.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/evp_ctx.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_dsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_ec.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_ec_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_rsa.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_rsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_x25519.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_x25519_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/pbkdf.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/print.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/sign.c', - 'third_party/boringssl-with-bazel/src/crypto/ex_data.c', - 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c', - 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/fips_shared_support.c', - 'third_party/boringssl-with-bazel/src/crypto/hkdf/hkdf.c', - 'third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c', - 'third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c', - 'third_party/boringssl-with-bazel/src/crypto/lhash/lhash.c', - 'third_party/boringssl-with-bazel/src/crypto/mem.c', - 'third_party/boringssl-with-bazel/src/crypto/obj/obj.c', - 'third_party/boringssl-with-bazel/src/crypto/obj/obj_xref.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_all.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_info.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_oth.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_pk8.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_pkey.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_xaux.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs8/p5_pbev2.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c', - 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c', - 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c', - 'third_party/boringssl-with-bazel/src/crypto/pool/pool.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/forkunsafe.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/fuchsia.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c', - 'third_party/boringssl-with-bazel/src/crypto/rc4/rc4.c', - 'third_party/boringssl-with-bazel/src/crypto/refcount_c11.c', - 'third_party/boringssl-with-bazel/src/crypto/refcount_lock.c', - 'third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_print.c', - 'third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c', - 'third_party/boringssl-with-bazel/src/crypto/stack/stack.c', - 'third_party/boringssl-with-bazel/src/crypto/thread.c', - 'third_party/boringssl-with-bazel/src/crypto/thread_none.c', - 'third_party/boringssl-with-bazel/src/crypto/thread_pthread.c', - 'third_party/boringssl-with-bazel/src/crypto/thread_win.c', - 'third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c', - 'third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c', - 'third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/a_digest.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/by_file.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/i2d_pr.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/name_print.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/t_req.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_def.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_txt.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509name.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509rset.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509spki.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_all.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_exten.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_info.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_name.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_pkey.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_req.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_spki.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_val.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akeya.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bcons.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_crld.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_extku.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_info.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_int.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ncons.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ocsp.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pci.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pcia.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pcons.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pmaps.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c', - 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c', - 'third_party/boringssl-with-bazel/src/ssl/bio_ssl.cc', - 'third_party/boringssl-with-bazel/src/ssl/d1_both.cc', - 'third_party/boringssl-with-bazel/src/ssl/d1_lib.cc', - 'third_party/boringssl-with-bazel/src/ssl/d1_pkt.cc', - 'third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc', - 'third_party/boringssl-with-bazel/src/ssl/dtls_method.cc', - 'third_party/boringssl-with-bazel/src/ssl/dtls_record.cc', - 'third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc', - 'third_party/boringssl-with-bazel/src/ssl/extensions.cc', - 'third_party/boringssl-with-bazel/src/ssl/handoff.cc', - 'third_party/boringssl-with-bazel/src/ssl/handshake.cc', - 'third_party/boringssl-with-bazel/src/ssl/handshake_client.cc', - 'third_party/boringssl-with-bazel/src/ssl/handshake_server.cc', - 'third_party/boringssl-with-bazel/src/ssl/s3_both.cc', - 'third_party/boringssl-with-bazel/src/ssl/s3_lib.cc', - 'third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_aead_ctx.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_buffer.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_file.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_session.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc', - 'third_party/boringssl-with-bazel/src/ssl/t1_enc.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls13_both.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls13_client.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls13_server.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls_method.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls_record.cc', - 'third_party/cares/cares/ares__close_sockets.c', - 'third_party/cares/cares/ares__get_hostent.c', - 'third_party/cares/cares/ares__read_line.c', - 'third_party/cares/cares/ares__timeval.c', - 'third_party/cares/cares/ares_cancel.c', - 'third_party/cares/cares/ares_create_query.c', - 'third_party/cares/cares/ares_data.c', - 'third_party/cares/cares/ares_destroy.c', - 'third_party/cares/cares/ares_expand_name.c', - 'third_party/cares/cares/ares_expand_string.c', - 'third_party/cares/cares/ares_fds.c', - 'third_party/cares/cares/ares_free_hostent.c', - 'third_party/cares/cares/ares_free_string.c', - 'third_party/cares/cares/ares_getenv.c', - 'third_party/cares/cares/ares_gethostbyaddr.c', - 'third_party/cares/cares/ares_gethostbyname.c', - 'third_party/cares/cares/ares_getnameinfo.c', - 'third_party/cares/cares/ares_getopt.c', - 'third_party/cares/cares/ares_getsock.c', - 'third_party/cares/cares/ares_init.c', - 'third_party/cares/cares/ares_library_init.c', - 'third_party/cares/cares/ares_llist.c', - 'third_party/cares/cares/ares_mkquery.c', - 'third_party/cares/cares/ares_nowarn.c', - 'third_party/cares/cares/ares_options.c', - 'third_party/cares/cares/ares_parse_a_reply.c', - 'third_party/cares/cares/ares_parse_aaaa_reply.c', - 'third_party/cares/cares/ares_parse_mx_reply.c', - 'third_party/cares/cares/ares_parse_naptr_reply.c', - 'third_party/cares/cares/ares_parse_ns_reply.c', - 'third_party/cares/cares/ares_parse_ptr_reply.c', - 'third_party/cares/cares/ares_parse_soa_reply.c', - 'third_party/cares/cares/ares_parse_srv_reply.c', - 'third_party/cares/cares/ares_parse_txt_reply.c', - 'third_party/cares/cares/ares_platform.c', - 'third_party/cares/cares/ares_process.c', - 'third_party/cares/cares/ares_query.c', - 'third_party/cares/cares/ares_search.c', - 'third_party/cares/cares/ares_send.c', - 'third_party/cares/cares/ares_strcasecmp.c', - 'third_party/cares/cares/ares_strdup.c', - 'third_party/cares/cares/ares_strerror.c', - 'third_party/cares/cares/ares_strsplit.c', - 'third_party/cares/cares/ares_timeout.c', - 'third_party/cares/cares/ares_version.c', - 'third_party/cares/cares/ares_writev.c', - 'third_party/cares/cares/bitncmp.c', - 'third_party/cares/cares/inet_net_pton.c', - 'third_party/cares/cares/inet_ntop.c', - 'third_party/cares/cares/windows_port.c', - 'third_party/re2/re2/bitstate.cc', - 'third_party/re2/re2/compile.cc', - 'third_party/re2/re2/dfa.cc', - 'third_party/re2/re2/filtered_re2.cc', - 'third_party/re2/re2/mimics_pcre.cc', - 'third_party/re2/re2/nfa.cc', - 'third_party/re2/re2/onepass.cc', - 'third_party/re2/re2/parse.cc', - 'third_party/re2/re2/perl_groups.cc', - 'third_party/re2/re2/prefilter.cc', - 'third_party/re2/re2/prefilter_tree.cc', - 'third_party/re2/re2/prog.cc', - 'third_party/re2/re2/re2.cc', - 'third_party/re2/re2/regexp.cc', - 'third_party/re2/re2/set.cc', - 'third_party/re2/re2/simplify.cc', - 'third_party/re2/re2/stringpiece.cc', - 'third_party/re2/re2/tostring.cc', - 'third_party/re2/re2/unicode_casefold.cc', - 'third_party/re2/re2/unicode_groups.cc', - 'third_party/re2/util/pcre.cc', - 'third_party/re2/util/rune.cc', - 'third_party/re2/util/strutil.cc', - 'third_party/upb/upb/decode.c', - 'third_party/upb/upb/decode_fast.c', - 'third_party/upb/upb/def.c', - 'third_party/upb/upb/encode.c', - 'third_party/upb/upb/msg.c', - 'third_party/upb/upb/reflection.c', - 'third_party/upb/upb/table.c', - 'third_party/upb/upb/text_encode.c', - 'third_party/upb/upb/upb.c', - 'third_party/zlib/adler32.c', - 'third_party/zlib/compress.c', - 'third_party/zlib/crc32.c', - 'third_party/zlib/deflate.c', - 'third_party/zlib/gzclose.c', - 'third_party/zlib/gzlib.c', - 'third_party/zlib/gzread.c', - 'third_party/zlib/gzwrite.c', - 'third_party/zlib/infback.c', - 'third_party/zlib/inffast.c', - 'third_party/zlib/inflate.c', - 'third_party/zlib/inftrees.c', - 'third_party/zlib/trees.c', - 'third_party/zlib/uncompr.c', - 'third_party/zlib/zutil.c', -] - -ASM_SOURCE_FILES = { - 'crypto_ios_aarch64': [ - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/chacha/chacha-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/aesv8-armx64.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/armv8-mont.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha1-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha256-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha512-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/test/trampoline-armv8.S', - ], - 'crypto_ios_arm': [ - 'third_party/boringssl-with-bazel/ios-arm/crypto/chacha/chacha-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/aesv8-armx32.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/armv4-mont.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/bsaes-armv7.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghash-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghashv8-armx32.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha1-armv4-large.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha256-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha512-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/vpaes-armv7.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/test/trampoline-armv4.S', - ], - 'crypto_linux_aarch64': [ - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/chacha/chacha-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/aesv8-armx64.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/armv8-mont.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha1-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha256-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha512-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/test/trampoline-armv8.S', - ], - 'crypto_linux_arm': [ - 'third_party/boringssl-with-bazel/linux-arm/crypto/chacha/chacha-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/aesv8-armx32.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/armv4-mont.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/bsaes-armv7.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghash-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghashv8-armx32.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha1-armv4-large.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha256-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha512-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/vpaes-armv7.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/test/trampoline-armv4.S', - 'third_party/boringssl-with-bazel/src/crypto/curve25519/asm/x25519-asm-arm.S', - 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm_asm.S', - ], - 'crypto_linux_ppc64le': [ - 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S', - 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S', - 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/test/trampoline-ppc.S', - ], - 'crypto_linux_x86': [ - 'third_party/boringssl-with-bazel/linux-x86/crypto/chacha/chacha-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/aesni-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/bn-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/co-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/md5-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha1-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha256-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha512-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/vpaes-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/x86-mont.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/test/trampoline-x86.S', - ], - 'crypto_linux_x86_64': [ - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/chacha/chacha-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/md5-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/test/trampoline-x86_64.S', - 'third_party/boringssl-with-bazel/src/crypto/hrss/asm/poly_rq_mul.S', - ], - 'crypto_mac_x86': [ - 'third_party/boringssl-with-bazel/mac-x86/crypto/chacha/chacha-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/aesni-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/bn-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/co-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/md5-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha1-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha256-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha512-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/vpaes-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/x86-mont.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/test/trampoline-x86.S', - ], - 'crypto_mac_x86_64': [ - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/chacha/chacha-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/md5-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/test/trampoline-x86_64.S', - ], - 'crypto_win_aarch64': [ - 'third_party/boringssl-with-bazel/win-aarch64/crypto/chacha/chacha-armv8.S', - 'third_party/boringssl-with-bazel/win-aarch64/crypto/fipsmodule/aesv8-armx64.S', - 'third_party/boringssl-with-bazel/win-aarch64/crypto/fipsmodule/armv8-mont.S', - 'third_party/boringssl-with-bazel/win-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', - 'third_party/boringssl-with-bazel/win-aarch64/crypto/fipsmodule/ghashv8-armx64.S', - 'third_party/boringssl-with-bazel/win-aarch64/crypto/fipsmodule/sha1-armv8.S', - 'third_party/boringssl-with-bazel/win-aarch64/crypto/fipsmodule/sha256-armv8.S', - 'third_party/boringssl-with-bazel/win-aarch64/crypto/fipsmodule/sha512-armv8.S', - 'third_party/boringssl-with-bazel/win-aarch64/crypto/fipsmodule/vpaes-armv8.S', - 'third_party/boringssl-with-bazel/win-aarch64/crypto/test/trampoline-armv8.S', - ], - 'crypto_win_x86': [ - 'third_party/boringssl-with-bazel/win-x86/crypto/chacha/chacha-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/aesni-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/bn-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/co-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/md5-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha1-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha256-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha512-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/vpaes-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/x86-mont.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/test/trampoline-x86.asm', - ], - 'crypto_win_x86_64': [ - 'third_party/boringssl-with-bazel/win-x86_64/crypto/chacha/chacha-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/md5-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rdrand-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rsaz-avx2.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha1-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha256-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha512-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont5.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/test/trampoline-x86_64.asm', - ], -} diff --git a/contrib/libs/grpc/src/python/grpcio/grpc_version.py b/contrib/libs/grpc/src/python/grpcio/grpc_version.py deleted file mode 100644 index 9636ff390e..0000000000 --- a/contrib/libs/grpc/src/python/grpcio/grpc_version.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! - -VERSION = '1.43.2' diff --git a/contrib/libs/grpc/src/python/grpcio/support.py b/contrib/libs/grpc/src/python/grpcio/support.py deleted file mode 100644 index 3d64b3170c..0000000000 --- a/contrib/libs/grpc/src/python/grpcio/support.py +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright 2016 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from distutils import errors -import os -import os.path -import shutil -import sys -import tempfile - -import commands - -C_PYTHON_DEV = """ -#include <Python.h> -int main(int argc, char **argv) { return 0; } -""" -C_PYTHON_DEV_ERROR_MESSAGE = """ -Could not find <Python.h>. This could mean the following: - * You're on Ubuntu and haven't run `apt-get install <PY_REPR>-dev`. - * You're on RHEL/Fedora and haven't run `yum install <PY_REPR>-devel` or - `dnf install <PY_REPR>-devel` (make sure you also have redhat-rpm-config - installed) - * You're on Mac OS X and the usual Python framework was somehow corrupted - (check your environment variables or try re-installing?) - * You're on Windows and your Python installation was somehow corrupted - (check your environment variables or try re-installing?) -""" -if sys.version_info[0] == 2: - PYTHON_REPRESENTATION = 'python' -elif sys.version_info[0] == 3: - PYTHON_REPRESENTATION = 'python3' -else: - raise NotImplementedError('Unsupported Python version: %s' % sys.version) - -C_CHECKS = { - C_PYTHON_DEV: - C_PYTHON_DEV_ERROR_MESSAGE.replace('<PY_REPR>', PYTHON_REPRESENTATION), -} - - -def _compile(compiler, source_string): - tempdir = tempfile.mkdtemp() - cpath = os.path.join(tempdir, 'a.c') - with open(cpath, 'w') as cfile: - cfile.write(source_string) - try: - compiler.compile([cpath]) - except errors.CompileError as error: - return error - finally: - shutil.rmtree(tempdir) - - -def _expect_compile(compiler, source_string, error_message): - if _compile(compiler, source_string) is not None: - sys.stderr.write(error_message) - raise commands.CommandError( - "Diagnostics found a compilation environment issue:\n{}".format( - error_message)) - - -def diagnose_compile_error(build_ext, error): - """Attempt to diagnose an error during compilation.""" - for c_check, message in C_CHECKS.items(): - _expect_compile(build_ext.compiler, c_check, message) - python_sources = [ - source for source in build_ext.get_source_files() - if source.startswith('./src/python') and source.endswith('c') - ] - for source in python_sources: - if not os.path.isfile(source): - raise commands.CommandError(( - "Diagnostics found a missing Python extension source file:\n{}\n\n" - "This is usually because the Cython sources haven't been transpiled " - "into C yet and you're building from source.\n" - "Try setting the environment variable " - "`GRPC_PYTHON_BUILD_WITH_CYTHON=1` when invoking `setup.py` or " - "when using `pip`, e.g.:\n\n" - "pip install -rrequirements.txt\n" - "GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .").format(source)) - - -def diagnose_attribute_error(build_ext, error): - if any('_needs_stub' in arg for arg in error.args): - raise commands.CommandError( - "We expect a missing `_needs_stub` attribute from older versions of " - "setuptools. Consider upgrading setuptools.") - - -_ERROR_DIAGNOSES = { - errors.CompileError: diagnose_compile_error, - AttributeError: diagnose_attribute_error, -} - - -def diagnose_build_ext_error(build_ext, error, formatted): - diagnostic = _ERROR_DIAGNOSES.get(type(error)) - if diagnostic is None: - raise commands.CommandError( - "\n\nWe could not diagnose your build failure. If you are unable to " - "proceed, please file an issue at http://www.github.com/grpc/grpc " - "with `[Python install]` in the title; please attach the whole log " - "(including everything that may have appeared above the Python " - "backtrace).\n\n{}".format(formatted)) - else: - diagnostic(build_ext, error) diff --git a/contrib/libs/grpc/src/python/grpcio_admin/grpc_admin/__init__.py b/contrib/libs/grpc/src/python/grpcio_admin/grpc_admin/__init__.py deleted file mode 100644 index 95e70858b3..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_admin/grpc_admin/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2021 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""gRPC Python's Admin interface.""" - -from grpc_channelz.v1 import channelz -import grpc_csds - - -def add_admin_servicers(server): - """Register admin servicers to a server. - - gRPC provides some predefined admin services to make debugging easier by - exposing gRPC's internal states. Each existing admin service is packaged as - a separate library, and the documentation of the predefined admin services - is usually scattered. It can be time consuming to get the dependency - management, module initialization, and library import right for each one of - them. - - This API provides a convenient way to create a gRPC server to expose admin - services. With this, any new admin services that you may add in the future - are automatically available via the admin interface just by upgrading your - gRPC version. - - Args: - server: A gRPC server to which all admin services will be added. - """ - channelz.add_channelz_servicer(server) - grpc_csds.add_csds_servicer(server) - - -__all__ = ['add_admin_servicers'] diff --git a/contrib/libs/grpc/src/python/grpcio_admin/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_admin/grpc_version.py deleted file mode 100644 index c48475b87e..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_admin/grpc_version.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2021 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/grpc_version.py.template`!!! - -VERSION = '1.43.2' diff --git a/contrib/libs/grpc/src/python/grpcio_admin/setup.py b/contrib/libs/grpc/src/python/grpcio_admin/setup.py deleted file mode 100644 index 2d966cdc0a..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_admin/setup.py +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2021 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Setup module for admin interface in gRPC Python.""" - -import os -import sys - -import setuptools - -_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__)) -_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst') - -# Ensure we're in the proper directory whether or not we're being used by pip. -os.chdir(os.path.dirname(os.path.abspath(__file__))) - -# Break import-style to ensure we can actually find our local modules. -import grpc_version - -CLASSIFIERS = [ - 'Development Status :: 5 - Production/Stable', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'License :: OSI Approved :: Apache Software License', -] - -PACKAGE_DIRECTORIES = { - '': '.', -} - -INSTALL_REQUIRES = ( - 'grpcio-channelz>={version}'.format(version=grpc_version.VERSION), - 'grpcio-csds>={version}'.format(version=grpc_version.VERSION), -) -SETUP_REQUIRES = INSTALL_REQUIRES - -setuptools.setup(name='grpcio-admin', - version=grpc_version.VERSION, - license='Apache License 2.0', - description='a collection of admin services', - long_description=open(_README_PATH, 'r').read(), - author='The gRPC Authors', - author_email='grpc-io@googlegroups.com', - classifiers=CLASSIFIERS, - url='https://grpc.io', - package_dir=PACKAGE_DIRECTORIES, - packages=setuptools.find_packages('.'), - python_requires='>=3.6', - install_requires=INSTALL_REQUIRES, - setup_requires=SETUP_REQUIRES) diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_channelz/.yandex_meta/licenses.list.txt deleted file mode 100644 index e1a08df61b..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_channelz/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,24 +0,0 @@ -====================Apache-2.0==================== - 'License :: OSI Approved :: Apache Software License', - - -====================Apache-2.0==================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -====================COPYRIGHT==================== -// Copyright 2018 The gRPC Authors - - -====================COPYRIGHT==================== -// Copyright 2020 The gRPC Authors diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/channelz_commands.py b/contrib/libs/grpc/src/python/grpcio_channelz/channelz_commands.py deleted file mode 100644 index dbbce2fda5..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_channelz/channelz_commands.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2018 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Provides distutils command classes for the GRPC Python setup process.""" - -import os -import shutil - -import setuptools - -ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) -CHANNELZ_PROTO = os.path.join(ROOT_DIR, - '../../proto/grpc/channelz/channelz.proto') -LICENSE = os.path.join(ROOT_DIR, '../../../LICENSE') - - -class Preprocess(setuptools.Command): - """Command to copy proto modules from grpc/src/proto and LICENSE from - the root directory""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - if os.path.isfile(CHANNELZ_PROTO): - shutil.copyfile( - CHANNELZ_PROTO, - os.path.join(ROOT_DIR, 'grpc_channelz/v1/channelz.proto')) - if os.path.isfile(LICENSE): - shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE')) - - -class BuildPackageProtos(setuptools.Command): - """Command to generate project *_pb2.py modules from proto files.""" - - description = 'build grpc protobuf modules' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - # due to limitations of the proto generator, we require that only *one* - # directory is provided as an 'include' directory. We assume it's the '' key - # to `self.distribution.package_dir` (and get a key error if it's not - # there). - from grpc_tools import command - command.build_package_protos(self.distribution.package_dir['']) diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py deleted file mode 100644 index 34edb1e08c..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2018 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!! - -VERSION = '1.43.2' diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/setup.py b/contrib/libs/grpc/src/python/grpcio_channelz/setup.py deleted file mode 100644 index cec1ea2ee9..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_channelz/setup.py +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2018 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Setup module for the GRPC Python package's Channelz.""" - -import os -import sys - -import setuptools - -_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__)) -_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst') - -# Ensure we're in the proper directory whether or not we're being used by pip. -os.chdir(os.path.dirname(os.path.abspath(__file__))) - -# Break import-style to ensure we can actually find our local modules. -import grpc_version - - -class _NoOpCommand(setuptools.Command): - """No-op command.""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - pass - - -CLASSIFIERS = [ - 'Development Status :: 5 - Production/Stable', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'License :: OSI Approved :: Apache Software License', -] - -PACKAGE_DIRECTORIES = { - '': '.', -} - -INSTALL_REQUIRES = ( - 'protobuf>=3.6.0', - 'grpcio>={version}'.format(version=grpc_version.VERSION), -) - -try: - import channelz_commands as _channelz_commands - - # we are in the build environment, otherwise the above import fails - SETUP_REQUIRES = ('grpcio-tools=={version}'.format( - version=grpc_version.VERSION),) - COMMAND_CLASS = { - # Run preprocess from the repository *before* doing any packaging! - 'preprocess': _channelz_commands.Preprocess, - 'build_package_protos': _channelz_commands.BuildPackageProtos, - } -except ImportError: - SETUP_REQUIRES = () - COMMAND_CLASS = { - # wire up commands to no-op not to break the external dependencies - 'preprocess': _NoOpCommand, - 'build_package_protos': _NoOpCommand, - } - -setuptools.setup( - name='grpcio-channelz', - version=grpc_version.VERSION, - license='Apache License 2.0', - description='Channel Level Live Debug Information Service for gRPC', - long_description=open(_README_PATH, 'r').read(), - author='The gRPC Authors', - author_email='grpc-io@googlegroups.com', - classifiers=CLASSIFIERS, - url='https://grpc.io', - package_dir=PACKAGE_DIRECTORIES, - packages=setuptools.find_packages('.'), - python_requires='>=3.6', - install_requires=INSTALL_REQUIRES, - setup_requires=SETUP_REQUIRES, - cmdclass=COMMAND_CLASS) diff --git a/contrib/libs/grpc/src/python/grpcio_csds/grpc_csds/__init__.py b/contrib/libs/grpc/src/python/grpcio_csds/grpc_csds/__init__.py deleted file mode 100644 index aa83465c61..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_csds/grpc_csds/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2021 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Channelz debug service implementation in gRPC Python.""" - -from google.protobuf import json_format -from grpc._cython import cygrpc - -try: - from envoy.service.status.v3 import csds_pb2 - from envoy.service.status.v3 import csds_pb2_grpc -except ImportError: - from src.proto.grpc.testing.xds.v3 import csds_pb2 - from src.proto.grpc.testing.xds.v3 import csds_pb2_grpc - - -class ClientStatusDiscoveryServiceServicer( - csds_pb2_grpc.ClientStatusDiscoveryServiceServicer): - """CSDS Servicer works for both the sync API and asyncio API.""" - - @staticmethod - def FetchClientStatus(request, unused_context): - client_config = csds_pb2.ClientConfig.FromString( - cygrpc.dump_xds_configs()) - response = csds_pb2.ClientStatusResponse() - response.config.append(client_config) - return response - - @staticmethod - def StreamClientStatus(request_iterator, context): - for request in request_iterator: - yield ClientStatusDiscoveryServiceServicer.FetchClientStatus( - request, context) - - -def add_csds_servicer(server): - """Register CSDS servicer to a server. - - CSDS is part of xDS protocol used to expose in-effective traffic - configuration (or xDS resources). It focuses on simplify the debugging of - unexpected routing behaviors, which could be due to a misconfiguration, - unhealthy backends or issues in the control or data plane. - - Args: - server: A gRPC server to which the CSDS service will be added. - """ - csds_pb2_grpc.add_ClientStatusDiscoveryServiceServicer_to_server( - ClientStatusDiscoveryServiceServicer(), server) - - -__all__ = ['ClientStatusDiscoveryServiceServicer', 'add_csds_servicer'] diff --git a/contrib/libs/grpc/src/python/grpcio_csds/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_csds/grpc_version.py deleted file mode 100644 index 88b38f3a6e..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_csds/grpc_version.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2021 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/grpc_version.py.template`!!! - -VERSION = '1.43.2' diff --git a/contrib/libs/grpc/src/python/grpcio_csds/setup.py b/contrib/libs/grpc/src/python/grpcio_csds/setup.py deleted file mode 100644 index c89c6b927b..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_csds/setup.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2021 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Setup module for CSDS in gRPC Python.""" - -import os -import sys - -import setuptools - -_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__)) -_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst') - -# Ensure we're in the proper directory whether or not we're being used by pip. -os.chdir(os.path.dirname(os.path.abspath(__file__))) - -# Break import-style to ensure we can actually find our local modules. -import grpc_version - -CLASSIFIERS = [ - 'Development Status :: 5 - Production/Stable', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'License :: OSI Approved :: Apache Software License', -] - -PACKAGE_DIRECTORIES = { - '': '.', -} - -INSTALL_REQUIRES = ( - 'protobuf>=3.6.0', - 'xds-protos>=0.0.7', - 'grpcio>={version}'.format(version=grpc_version.VERSION), -) -SETUP_REQUIRES = INSTALL_REQUIRES - -setuptools.setup(name='grpcio-csds', - version=grpc_version.VERSION, - license='Apache License 2.0', - description='xDS configuration dump library', - long_description=open(_README_PATH, 'r').read(), - author='The gRPC Authors', - author_email='grpc-io@googlegroups.com', - classifiers=CLASSIFIERS, - url='https://grpc.io', - package_dir=PACKAGE_DIRECTORIES, - packages=setuptools.find_packages('.'), - python_requires='>=3.6', - install_requires=INSTALL_REQUIRES, - setup_requires=SETUP_REQUIRES) diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_health_checking/.yandex_meta/licenses.list.txt deleted file mode 100644 index 02cb1ca478..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_health_checking/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,32 +0,0 @@ -====================Apache-2.0==================== - license='Apache License 2.0', - - -====================Apache-2.0==================== - 'License :: OSI Approved :: Apache Software License', - - -====================Apache-2.0==================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -====================COPYRIGHT==================== - * Copyright 2015 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2016 gRPC authors. - - -====================COPYRIGHT==================== -// Copyright 2020 The gRPC Authors diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py deleted file mode 100644 index b56a945c61..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright 2020 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Reference implementation for health checking in gRPC Python.""" - -import asyncio -import collections -from typing import MutableMapping - -import grpc -from grpc_health.v1 import health_pb2 as _health_pb2 -from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc - - -class HealthServicer(_health_pb2_grpc.HealthServicer): - """An AsyncIO implementation of health checking servicer.""" - _server_status: MutableMapping[ - str, '_health_pb2.HealthCheckResponse.ServingStatus'] - _server_watchers: MutableMapping[str, asyncio.Condition] - _gracefully_shutting_down: bool - - def __init__(self) -> None: - self._server_status = {"": _health_pb2.HealthCheckResponse.SERVING} - self._server_watchers = collections.defaultdict(asyncio.Condition) - self._gracefully_shutting_down = False - - async def Check(self, request: _health_pb2.HealthCheckRequest, - context) -> None: - status = self._server_status.get(request.service) - - if status is None: - await context.abort(grpc.StatusCode.NOT_FOUND) - else: - return _health_pb2.HealthCheckResponse(status=status) - - async def Watch(self, request: _health_pb2.HealthCheckRequest, - context) -> None: - condition = self._server_watchers[request.service] - last_status = None - try: - async with condition: - while True: - status = self._server_status.get( - request.service, - _health_pb2.HealthCheckResponse.SERVICE_UNKNOWN) - - # NOTE(lidiz) If the observed status is the same, it means - # there are missing intermediate statuses. It's considered - # acceptable since peer only interested in eventual status. - if status != last_status: - # Responds with current health state - await context.write( - _health_pb2.HealthCheckResponse(status=status)) - - # Records the last sent status - last_status = status - - # Polling on health state changes - await condition.wait() - finally: - if request.service in self._server_watchers: - del self._server_watchers[request.service] - - async def _set( - self, service: str, - status: _health_pb2.HealthCheckResponse.ServingStatus) -> None: - if service in self._server_watchers: - condition = self._server_watchers.get(service) - async with condition: - self._server_status[service] = status - condition.notify_all() - else: - self._server_status[service] = status - - async def set( - self, service: str, - status: _health_pb2.HealthCheckResponse.ServingStatus) -> None: - """Sets the status of a service. - - Args: - service: string, the name of the service. - status: HealthCheckResponse.status enum value indicating the status of - the service - """ - if self._gracefully_shutting_down: - return - else: - await self._set(service, status) - - async def enter_graceful_shutdown(self) -> None: - """Permanently sets the status of all services to NOT_SERVING. - - This should be invoked when the server is entering a graceful shutdown - period. After this method is invoked, future attempts to set the status - of a service will be ignored. - """ - if self._gracefully_shutting_down: - return - else: - self._gracefully_shutting_down = True - for service in self._server_status: - await self._set(service, - _health_pb2.HealthCheckResponse.NOT_SERVING) diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py deleted file mode 100644 index 0ba5178b82..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2016 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! - -VERSION = '1.43.2' diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/health_commands.py b/contrib/libs/grpc/src/python/grpcio_health_checking/health_commands.py deleted file mode 100644 index 874dec7343..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_health_checking/health_commands.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Provides distutils command classes for the GRPC Python setup process.""" - -import os -import shutil - -import setuptools - -ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) -HEALTH_PROTO = os.path.join(ROOT_DIR, '../../proto/grpc/health/v1/health.proto') -LICENSE = os.path.join(ROOT_DIR, '../../../LICENSE') - - -class Preprocess(setuptools.Command): - """Command to copy proto modules from grpc/src/proto and LICENSE from - the root directory""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - if os.path.isfile(HEALTH_PROTO): - shutil.copyfile( - HEALTH_PROTO, - os.path.join(ROOT_DIR, 'grpc_health/v1/health.proto')) - if os.path.isfile(LICENSE): - shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE')) - - -class BuildPackageProtos(setuptools.Command): - """Command to generate project *_pb2.py modules from proto files.""" - - description = 'build grpc protobuf modules' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - # due to limitations of the proto generator, we require that only *one* - # directory is provided as an 'include' directory. We assume it's the '' key - # to `self.distribution.package_dir` (and get a key error if it's not - # there). - from grpc_tools import command - command.build_package_protos(self.distribution.package_dir['']) diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py b/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py deleted file mode 100644 index 7491bd400a..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Setup module for the GRPC Python package's optional health checking.""" - -import os - -import setuptools - -_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__)) -_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst') - -# Ensure we're in the proper directory whether or not we're being used by pip. -os.chdir(os.path.dirname(os.path.abspath(__file__))) - -# Break import-style to ensure we can actually find our local modules. -import grpc_version - - -class _NoOpCommand(setuptools.Command): - """No-op command.""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - pass - - -CLASSIFIERS = [ - 'Development Status :: 5 - Production/Stable', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'License :: OSI Approved :: Apache Software License', -] - -PACKAGE_DIRECTORIES = { - '': '.', -} - -INSTALL_REQUIRES = ( - 'protobuf>=3.6.0', - 'grpcio>={version}'.format(version=grpc_version.VERSION), -) - -try: - import health_commands as _health_commands - - # we are in the build environment, otherwise the above import fails - SETUP_REQUIRES = ('grpcio-tools=={version}'.format( - version=grpc_version.VERSION),) - COMMAND_CLASS = { - # Run preprocess from the repository *before* doing any packaging! - 'preprocess': _health_commands.Preprocess, - 'build_package_protos': _health_commands.BuildPackageProtos, - } -except ImportError: - SETUP_REQUIRES = () - COMMAND_CLASS = { - # wire up commands to no-op not to break the external dependencies - 'preprocess': _NoOpCommand, - 'build_package_protos': _NoOpCommand, - } - -setuptools.setup(name='grpcio-health-checking', - version=grpc_version.VERSION, - description='Standard Health Checking Service for gRPC', - long_description=open(_README_PATH, 'r').read(), - author='The gRPC Authors', - author_email='grpc-io@googlegroups.com', - url='https://grpc.io', - license='Apache License 2.0', - classifiers=CLASSIFIERS, - package_dir=PACKAGE_DIRECTORIES, - packages=setuptools.find_packages('.'), - python_requires='>=3.6', - install_requires=INSTALL_REQUIRES, - setup_requires=SETUP_REQUIRES, - cmdclass=COMMAND_CLASS) diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_reflection/.yandex_meta/licenses.list.txt deleted file mode 100644 index 33706ec084..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_reflection/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,28 +0,0 @@ -====================Apache-2.0==================== - license='Apache License 2.0', - - -====================Apache-2.0==================== - 'License :: OSI Approved :: Apache Software License', - - -====================Apache-2.0==================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -====================COPYRIGHT==================== - * Copyright 2016 gRPC authors. - - -====================COPYRIGHT==================== - * Copyright 2020 gRPC authors. diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py deleted file mode 100644 index 55ed71e32f..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2016 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! - -VERSION = '1.43.2' diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/reflection_commands.py b/contrib/libs/grpc/src/python/grpcio_reflection/reflection_commands.py deleted file mode 100644 index 311ca4c4db..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_reflection/reflection_commands.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 2016 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Provides distutils command classes for the GRPC Python setup process.""" - -import os -import shutil - -import setuptools - -ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) -REFLECTION_PROTO = os.path.join( - ROOT_DIR, '../../proto/grpc/reflection/v1alpha/reflection.proto') -LICENSE = os.path.join(ROOT_DIR, '../../../LICENSE') - - -class Preprocess(setuptools.Command): - """Command to copy proto modules from grpc/src/proto and LICENSE from - the root directory""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - if os.path.isfile(REFLECTION_PROTO): - shutil.copyfile( - REFLECTION_PROTO, - os.path.join(ROOT_DIR, - 'grpc_reflection/v1alpha/reflection.proto')) - if os.path.isfile(LICENSE): - shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE')) - - -class BuildPackageProtos(setuptools.Command): - """Command to generate project *_pb2.py modules from proto files.""" - - description = 'build grpc protobuf modules' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - # due to limitations of the proto generator, we require that only *one* - # directory is provided as an 'include' directory. We assume it's the '' key - # to `self.distribution.package_dir` (and get a key error if it's not - # there). - from grpc_tools import command - command.build_package_protos(self.distribution.package_dir['']) diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/setup.py b/contrib/libs/grpc/src/python/grpcio_reflection/setup.py deleted file mode 100644 index f90a3cce88..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_reflection/setup.py +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2016 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Setup module for the GRPC Python package's optional reflection.""" - -import os -import sys - -import setuptools - -_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__)) -_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst') - -# Ensure we're in the proper directory whether or not we're being used by pip. -os.chdir(os.path.dirname(os.path.abspath(__file__))) - -# Break import-style to ensure we can actually find our local modules. -import grpc_version - - -class _NoOpCommand(setuptools.Command): - """No-op command.""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - pass - - -CLASSIFIERS = [ - 'Development Status :: 5 - Production/Stable', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'License :: OSI Approved :: Apache Software License', -] - -PACKAGE_DIRECTORIES = { - '': '.', -} - -INSTALL_REQUIRES = ( - 'protobuf>=3.6.0', - 'grpcio>={version}'.format(version=grpc_version.VERSION), -) - -try: - import reflection_commands as _reflection_commands - - # we are in the build environment, otherwise the above import fails - SETUP_REQUIRES = ('grpcio-tools=={version}'.format( - version=grpc_version.VERSION),) - COMMAND_CLASS = { - # Run preprocess from the repository *before* doing any packaging! - 'preprocess': _reflection_commands.Preprocess, - 'build_package_protos': _reflection_commands.BuildPackageProtos, - } -except ImportError: - SETUP_REQUIRES = () - COMMAND_CLASS = { - # wire up commands to no-op not to break the external dependencies - 'preprocess': _NoOpCommand, - 'build_package_protos': _NoOpCommand, - } - -setuptools.setup(name='grpcio-reflection', - version=grpc_version.VERSION, - license='Apache License 2.0', - description='Standard Protobuf Reflection Service for gRPC', - long_description=open(_README_PATH, 'r').read(), - author='The gRPC Authors', - author_email='grpc-io@googlegroups.com', - classifiers=CLASSIFIERS, - url='https://grpc.io', - package_dir=PACKAGE_DIRECTORIES, - packages=setuptools.find_packages('.'), - python_requires='>=3.6', - install_requires=INSTALL_REQUIRES, - setup_requires=SETUP_REQUIRES, - cmdclass=COMMAND_CLASS) diff --git a/contrib/libs/grpc/src/python/grpcio_status/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_status/.yandex_meta/licenses.list.txt deleted file mode 100644 index 93c430236f..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_status/.yandex_meta/licenses.list.txt +++ /dev/null @@ -1,28 +0,0 @@ -====================Apache-2.0==================== - license='Apache License 2.0', - - -====================Apache-2.0==================== - 'License :: OSI Approved :: Apache Software License', - - -====================Apache-2.0==================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -====================COPYRIGHT==================== -// Copyright 2018 The gRPC Authors - - -====================COPYRIGHT==================== -// Copyright 2020 The gRPC Authors diff --git a/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py deleted file mode 100644 index c80d0a4a88..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2018 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!! - -VERSION = '1.43.2' diff --git a/contrib/libs/grpc/src/python/grpcio_status/setup.py b/contrib/libs/grpc/src/python/grpcio_status/setup.py deleted file mode 100644 index 23bd11cb6b..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_status/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 2018 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Setup module for the GRPC Python package's status mapping.""" - -import os - -import setuptools - -_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__)) -_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst') - -# Ensure we're in the proper directory whether or not we're being used by pip. -os.chdir(os.path.dirname(os.path.abspath(__file__))) - -# Break import-style to ensure we can actually find our local modules. -import grpc_version - - -class _NoOpCommand(setuptools.Command): - """No-op command.""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - pass - - -CLASSIFIERS = [ - 'Development Status :: 5 - Production/Stable', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'License :: OSI Approved :: Apache Software License', -] - -PACKAGE_DIRECTORIES = { - '': '.', -} - -INSTALL_REQUIRES = ( - 'protobuf>=3.6.0', - 'grpcio>={version}'.format(version=grpc_version.VERSION), - 'googleapis-common-protos>=1.5.5', -) - -try: - import status_commands as _status_commands - - # we are in the build environment, otherwise the above import fails - COMMAND_CLASS = { - # Run preprocess from the repository *before* doing any packaging! - 'preprocess': _status_commands.Preprocess, - 'build_package_protos': _NoOpCommand, - } -except ImportError: - COMMAND_CLASS = { - # wire up commands to no-op not to break the external dependencies - 'preprocess': _NoOpCommand, - 'build_package_protos': _NoOpCommand, - } - -setuptools.setup(name='grpcio-status', - version=grpc_version.VERSION, - description='Status proto mapping for gRPC', - long_description=open(_README_PATH, 'r').read(), - author='The gRPC Authors', - author_email='grpc-io@googlegroups.com', - url='https://grpc.io', - license='Apache License 2.0', - classifiers=CLASSIFIERS, - package_dir=PACKAGE_DIRECTORIES, - packages=setuptools.find_packages('.'), - python_requires='>=3.6', - install_requires=INSTALL_REQUIRES, - cmdclass=COMMAND_CLASS) diff --git a/contrib/libs/grpc/src/python/grpcio_status/status_commands.py b/contrib/libs/grpc/src/python/grpcio_status/status_commands.py deleted file mode 100644 index 8306f3c027..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_status/status_commands.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2018 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Provides distutils command classes for the GRPC Python setup process.""" - -import os -import shutil - -import setuptools - -ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) -STATUS_PROTO = os.path.join( - ROOT_DIR, '../../../third_party/googleapis/google/rpc/status.proto') -PACKAGE_STATUS_PROTO_PATH = 'grpc_status/google/rpc' -LICENSE = os.path.join(ROOT_DIR, '../../../LICENSE') - - -class Preprocess(setuptools.Command): - """Command to copy LICENSE from root directory.""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - if os.path.isfile(STATUS_PROTO): - if not os.path.isdir(PACKAGE_STATUS_PROTO_PATH): - os.makedirs(PACKAGE_STATUS_PROTO_PATH) - shutil.copyfile( - STATUS_PROTO, - os.path.join(ROOT_DIR, PACKAGE_STATUS_PROTO_PATH, - 'status.proto')) - if os.path.isfile(LICENSE): - shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE')) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/__init__.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/__init__.py deleted file mode 100644 index 235b3afcf4..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/__init__.py +++ /dev/null @@ -1,696 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Objects for use in testing gRPC Python-using application code.""" - -import abc - -from google.protobuf import descriptor -import grpc -import six - - -class UnaryUnaryChannelRpc(six.with_metaclass(abc.ABCMeta)): - """Fixture for a unary-unary RPC invoked by a system under test. - - Enables users to "play server" for the RPC. - """ - - @abc.abstractmethod - def send_initial_metadata(self, initial_metadata): - """Sends the RPC's initial metadata to the system under test. - - Args: - initial_metadata: The RPC's initial metadata to be "sent" to - the system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def cancelled(self): - """Blocks until the system under test has cancelled the RPC.""" - raise NotImplementedError() - - @abc.abstractmethod - def terminate(self, response, trailing_metadata, code, details): - """Terminates the RPC. - - Args: - response: The response for the RPC. - trailing_metadata: The RPC's trailing metadata. - code: The RPC's status code. - details: The RPC's status details. - """ - raise NotImplementedError() - - -class UnaryStreamChannelRpc(six.with_metaclass(abc.ABCMeta)): - """Fixture for a unary-stream RPC invoked by a system under test. - - Enables users to "play server" for the RPC. - """ - - @abc.abstractmethod - def send_initial_metadata(self, initial_metadata): - """Sends the RPC's initial metadata to the system under test. - - Args: - initial_metadata: The RPC's initial metadata to be "sent" to - the system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def send_response(self, response): - """Sends a response to the system under test. - - Args: - response: A response message to be "sent" to the system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def cancelled(self): - """Blocks until the system under test has cancelled the RPC.""" - raise NotImplementedError() - - @abc.abstractmethod - def terminate(self, trailing_metadata, code, details): - """Terminates the RPC. - - Args: - trailing_metadata: The RPC's trailing metadata. - code: The RPC's status code. - details: The RPC's status details. - """ - raise NotImplementedError() - - -class StreamUnaryChannelRpc(six.with_metaclass(abc.ABCMeta)): - """Fixture for a stream-unary RPC invoked by a system under test. - - Enables users to "play server" for the RPC. - """ - - @abc.abstractmethod - def send_initial_metadata(self, initial_metadata): - """Sends the RPC's initial metadata to the system under test. - - Args: - initial_metadata: The RPC's initial metadata to be "sent" to - the system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def take_request(self): - """Draws one of the requests added to the RPC by the system under test. - - This method blocks until the system under test has added to the RPC - the request to be returned. - - Successive calls to this method return requests in the same order in - which the system under test added them to the RPC. - - Returns: - A request message added to the RPC by the system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def requests_closed(self): - """Blocks until the system under test has closed the request stream.""" - raise NotImplementedError() - - @abc.abstractmethod - def cancelled(self): - """Blocks until the system under test has cancelled the RPC.""" - raise NotImplementedError() - - @abc.abstractmethod - def terminate(self, response, trailing_metadata, code, details): - """Terminates the RPC. - - Args: - response: The response for the RPC. - trailing_metadata: The RPC's trailing metadata. - code: The RPC's status code. - details: The RPC's status details. - """ - raise NotImplementedError() - - -class StreamStreamChannelRpc(six.with_metaclass(abc.ABCMeta)): - """Fixture for a stream-stream RPC invoked by a system under test. - - Enables users to "play server" for the RPC. - """ - - @abc.abstractmethod - def send_initial_metadata(self, initial_metadata): - """Sends the RPC's initial metadata to the system under test. - - Args: - initial_metadata: The RPC's initial metadata to be "sent" to the - system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def take_request(self): - """Draws one of the requests added to the RPC by the system under test. - - This method blocks until the system under test has added to the RPC - the request to be returned. - - Successive calls to this method return requests in the same order in - which the system under test added them to the RPC. - - Returns: - A request message added to the RPC by the system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def send_response(self, response): - """Sends a response to the system under test. - - Args: - response: A response messages to be "sent" to the system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def requests_closed(self): - """Blocks until the system under test has closed the request stream.""" - raise NotImplementedError() - - @abc.abstractmethod - def cancelled(self): - """Blocks until the system under test has cancelled the RPC.""" - raise NotImplementedError() - - @abc.abstractmethod - def terminate(self, trailing_metadata, code, details): - """Terminates the RPC. - - Args: - trailing_metadata: The RPC's trailing metadata. - code: The RPC's status code. - details: The RPC's status details. - """ - raise NotImplementedError() - - -class Channel(six.with_metaclass(abc.ABCMeta, grpc.Channel)): - """A grpc.Channel double with which to test a system that invokes RPCs.""" - - @abc.abstractmethod - def take_unary_unary(self, method_descriptor): - """Draws an RPC currently being made by the system under test. - - If the given descriptor does not identify any RPC currently being made - by the system under test, this method blocks until the system under - test invokes such an RPC. - - Args: - method_descriptor: A descriptor.MethodDescriptor describing a - unary-unary RPC method. - - Returns: - A (invocation_metadata, request, unary_unary_channel_rpc) tuple of - the RPC's invocation metadata, its request, and a - UnaryUnaryChannelRpc with which to "play server" for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def take_unary_stream(self, method_descriptor): - """Draws an RPC currently being made by the system under test. - - If the given descriptor does not identify any RPC currently being made - by the system under test, this method blocks until the system under - test invokes such an RPC. - - Args: - method_descriptor: A descriptor.MethodDescriptor describing a - unary-stream RPC method. - - Returns: - A (invocation_metadata, request, unary_stream_channel_rpc) tuple of - the RPC's invocation metadata, its request, and a - UnaryStreamChannelRpc with which to "play server" for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def take_stream_unary(self, method_descriptor): - """Draws an RPC currently being made by the system under test. - - If the given descriptor does not identify any RPC currently being made - by the system under test, this method blocks until the system under - test invokes such an RPC. - - Args: - method_descriptor: A descriptor.MethodDescriptor describing a - stream-unary RPC method. - - Returns: - A (invocation_metadata, stream_unary_channel_rpc) tuple of the RPC's - invocation metadata and a StreamUnaryChannelRpc with which to "play - server" for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def take_stream_stream(self, method_descriptor): - """Draws an RPC currently being made by the system under test. - - If the given descriptor does not identify any RPC currently being made - by the system under test, this method blocks until the system under - test invokes such an RPC. - - Args: - method_descriptor: A descriptor.MethodDescriptor describing a - stream-stream RPC method. - - Returns: - A (invocation_metadata, stream_stream_channel_rpc) tuple of the RPC's - invocation metadata and a StreamStreamChannelRpc with which to - "play server" for the RPC. - """ - raise NotImplementedError() - - -class UnaryUnaryServerRpc(six.with_metaclass(abc.ABCMeta)): - """Fixture for a unary-unary RPC serviced by a system under test. - - Enables users to "play client" for the RPC. - """ - - @abc.abstractmethod - def initial_metadata(self): - """Accesses the initial metadata emitted by the system under test. - - This method blocks until the system under test has added initial - metadata to the RPC (or has provided one or more response messages or - has terminated the RPC, either of which will cause gRPC Python to - synthesize initial metadata for the RPC). - - Returns: - The initial metadata for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def cancel(self): - """Cancels the RPC.""" - raise NotImplementedError() - - @abc.abstractmethod - def termination(self): - """Blocks until the system under test has terminated the RPC. - - Returns: - A (response, trailing_metadata, code, details) sequence with the RPC's - response, trailing metadata, code, and details. - """ - raise NotImplementedError() - - -class UnaryStreamServerRpc(six.with_metaclass(abc.ABCMeta)): - """Fixture for a unary-stream RPC serviced by a system under test. - - Enables users to "play client" for the RPC. - """ - - @abc.abstractmethod - def initial_metadata(self): - """Accesses the initial metadata emitted by the system under test. - - This method blocks until the system under test has added initial - metadata to the RPC (or has provided one or more response messages or - has terminated the RPC, either of which will cause gRPC Python to - synthesize initial metadata for the RPC). - - Returns: - The initial metadata for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def take_response(self): - """Draws one of the responses added to the RPC by the system under test. - - Successive calls to this method return responses in the same order in - which the system under test added them to the RPC. - - Returns: - A response message added to the RPC by the system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def cancel(self): - """Cancels the RPC.""" - raise NotImplementedError() - - @abc.abstractmethod - def termination(self): - """Blocks until the system under test has terminated the RPC. - - Returns: - A (trailing_metadata, code, details) sequence with the RPC's trailing - metadata, code, and details. - """ - raise NotImplementedError() - - -class StreamUnaryServerRpc(six.with_metaclass(abc.ABCMeta)): - """Fixture for a stream-unary RPC serviced by a system under test. - - Enables users to "play client" for the RPC. - """ - - @abc.abstractmethod - def initial_metadata(self): - """Accesses the initial metadata emitted by the system under test. - - This method blocks until the system under test has added initial - metadata to the RPC (or has provided one or more response messages or - has terminated the RPC, either of which will cause gRPC Python to - synthesize initial metadata for the RPC). - - Returns: - The initial metadata for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def send_request(self, request): - """Sends a request to the system under test. - - Args: - request: A request message for the RPC to be "sent" to the system - under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def requests_closed(self): - """Indicates the end of the RPC's request stream.""" - raise NotImplementedError() - - @abc.abstractmethod - def cancel(self): - """Cancels the RPC.""" - raise NotImplementedError() - - @abc.abstractmethod - def termination(self): - """Blocks until the system under test has terminated the RPC. - - Returns: - A (response, trailing_metadata, code, details) sequence with the RPC's - response, trailing metadata, code, and details. - """ - raise NotImplementedError() - - -class StreamStreamServerRpc(six.with_metaclass(abc.ABCMeta)): - """Fixture for a stream-stream RPC serviced by a system under test. - - Enables users to "play client" for the RPC. - """ - - @abc.abstractmethod - def initial_metadata(self): - """Accesses the initial metadata emitted by the system under test. - - This method blocks until the system under test has added initial - metadata to the RPC (or has provided one or more response messages or - has terminated the RPC, either of which will cause gRPC Python to - synthesize initial metadata for the RPC). - - Returns: - The initial metadata for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def send_request(self, request): - """Sends a request to the system under test. - - Args: - request: A request message for the RPC to be "sent" to the system - under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def requests_closed(self): - """Indicates the end of the RPC's request stream.""" - raise NotImplementedError() - - @abc.abstractmethod - def take_response(self): - """Draws one of the responses added to the RPC by the system under test. - - Successive calls to this method return responses in the same order in - which the system under test added them to the RPC. - - Returns: - A response message added to the RPC by the system under test. - """ - raise NotImplementedError() - - @abc.abstractmethod - def cancel(self): - """Cancels the RPC.""" - raise NotImplementedError() - - @abc.abstractmethod - def termination(self): - """Blocks until the system under test has terminated the RPC. - - Returns: - A (trailing_metadata, code, details) sequence with the RPC's trailing - metadata, code, and details. - """ - raise NotImplementedError() - - -class Server(six.with_metaclass(abc.ABCMeta)): - """A server with which to test a system that services RPCs.""" - - @abc.abstractmethod - def invoke_unary_unary(self, method_descriptor, invocation_metadata, - request, timeout): - """Invokes an RPC to be serviced by the system under test. - - Args: - method_descriptor: A descriptor.MethodDescriptor describing a unary-unary - RPC method. - invocation_metadata: The RPC's invocation metadata. - request: The RPC's request. - timeout: A duration of time in seconds for the RPC or None to - indicate that the RPC has no time limit. - - Returns: - A UnaryUnaryServerRpc with which to "play client" for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def invoke_unary_stream(self, method_descriptor, invocation_metadata, - request, timeout): - """Invokes an RPC to be serviced by the system under test. - - Args: - method_descriptor: A descriptor.MethodDescriptor describing a unary-stream - RPC method. - invocation_metadata: The RPC's invocation metadata. - request: The RPC's request. - timeout: A duration of time in seconds for the RPC or None to - indicate that the RPC has no time limit. - - Returns: - A UnaryStreamServerRpc with which to "play client" for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def invoke_stream_unary(self, method_descriptor, invocation_metadata, - timeout): - """Invokes an RPC to be serviced by the system under test. - - Args: - method_descriptor: A descriptor.MethodDescriptor describing a stream-unary - RPC method. - invocation_metadata: The RPC's invocation metadata. - timeout: A duration of time in seconds for the RPC or None to - indicate that the RPC has no time limit. - - Returns: - A StreamUnaryServerRpc with which to "play client" for the RPC. - """ - raise NotImplementedError() - - @abc.abstractmethod - def invoke_stream_stream(self, method_descriptor, invocation_metadata, - timeout): - """Invokes an RPC to be serviced by the system under test. - - Args: - method_descriptor: A descriptor.MethodDescriptor describing a stream-stream - RPC method. - invocation_metadata: The RPC's invocation metadata. - timeout: A duration of time in seconds for the RPC or None to - indicate that the RPC has no time limit. - - Returns: - A StreamStreamServerRpc with which to "play client" for the RPC. - """ - raise NotImplementedError() - - -class Time(six.with_metaclass(abc.ABCMeta)): - """A simulation of time. - - Implementations needn't be connected with real time as provided by the - Python interpreter, but as long as systems under test use - RpcContext.is_active and RpcContext.time_remaining for querying RPC liveness - implementations may be used to change passage of time in tests. - """ - - @abc.abstractmethod - def time(self): - """Accesses the current test time. - - Returns: - The current test time (over which this object has authority). - """ - raise NotImplementedError() - - @abc.abstractmethod - def call_in(self, behavior, delay): - """Adds a behavior to be called after some time. - - Args: - behavior: A behavior to be called with no arguments. - delay: A duration of time in seconds after which to call the behavior. - - Returns: - A grpc.Future with which the call of the behavior may be cancelled - before it is executed. - """ - raise NotImplementedError() - - @abc.abstractmethod - def call_at(self, behavior, time): - """Adds a behavior to be called at a specific time. - - Args: - behavior: A behavior to be called with no arguments. - time: The test time at which to call the behavior. - - Returns: - A grpc.Future with which the call of the behavior may be cancelled - before it is executed. - """ - raise NotImplementedError() - - @abc.abstractmethod - def sleep_for(self, duration): - """Blocks for some length of test time. - - Args: - duration: A duration of test time in seconds for which to block. - """ - raise NotImplementedError() - - @abc.abstractmethod - def sleep_until(self, time): - """Blocks until some test time. - - Args: - time: The test time until which to block. - """ - raise NotImplementedError() - - -def strict_real_time(): - """Creates a Time backed by the Python interpreter's time. - - The returned instance will be "strict" with respect to callbacks - submitted to it: it will ensure that all callbacks registered to - be called at time t have been called before it describes the time - as having advanced beyond t. - - Returns: - A Time backed by the "system" (Python interpreter's) time. - """ - from grpc_testing import _time - return _time.StrictRealTime() - - -def strict_fake_time(now): - """Creates a Time that can be manipulated by test code. - - The returned instance maintains an internal representation of time - independent of real time. This internal representation only advances - when user code calls the instance's sleep_for and sleep_until methods. - - The returned instance will be "strict" with respect to callbacks - submitted to it: it will ensure that all callbacks registered to - be called at time t have been called before it describes the time - as having advanced beyond t. - - Returns: - A Time that simulates the passage of time. - """ - from grpc_testing import _time - return _time.StrictFakeTime(now) - - -def channel(service_descriptors, time): - """Creates a Channel for use in tests of a gRPC Python-using system. - - Args: - service_descriptors: An iterable of descriptor.ServiceDescriptors - describing the RPCs that will be made on the returned Channel by the - system under test. - time: A Time to be used for tests. - - Returns: - A Channel for use in tests. - """ - from grpc_testing import _channel - return _channel.testing_channel(service_descriptors, time) - - -def server_from_dictionary(descriptors_to_servicers, time): - """Creates a Server for use in tests of a gRPC Python-using system. - - Args: - descriptors_to_servicers: A dictionary from descriptor.ServiceDescriptors - defining RPC services to servicer objects (usually instances of classes - that implement "Servicer" interfaces defined in generated "_pb2_grpc" - modules) implementing those services. - time: A Time to be used for tests. - - Returns: - A Server for use in tests. - """ - from grpc_testing import _server - return _server.server_from_dictionary(descriptors_to_servicers, time) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/__init__.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/__init__.py deleted file mode 100644 index 7a64cda889..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from grpc_testing._channel import _channel -from grpc_testing._channel import _channel_state - - -# descriptors is reserved for later use. -# pylint: disable=unused-argument -def testing_channel(descriptors, time): - return _channel.TestingChannel(time, _channel_state.State()) - - -# pylint: enable=unused-argument diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_channel.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_channel.py deleted file mode 100644 index 0c1941e6be..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_channel.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import grpc_testing -from grpc_testing._channel import _channel_rpc -from grpc_testing._channel import _multi_callable - - -# All serializer and deserializer parameters are not (yet) used by this -# test infrastructure. -# pylint: disable=unused-argument -class TestingChannel(grpc_testing.Channel): - - def __init__(self, time, state): - self._time = time - self._state = state - - def subscribe(self, callback, try_to_connect=False): - raise NotImplementedError() - - def unsubscribe(self, callback): - raise NotImplementedError() - - def unary_unary(self, - method, - request_serializer=None, - response_deserializer=None): - return _multi_callable.UnaryUnary(method, self._state) - - def unary_stream(self, - method, - request_serializer=None, - response_deserializer=None): - return _multi_callable.UnaryStream(method, self._state) - - def stream_unary(self, - method, - request_serializer=None, - response_deserializer=None): - return _multi_callable.StreamUnary(method, self._state) - - def stream_stream(self, - method, - request_serializer=None, - response_deserializer=None): - return _multi_callable.StreamStream(method, self._state) - - def _close(self): - # TODO(https://github.com/grpc/grpc/issues/12531): Decide what - # action to take here, if any? - pass - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - self._close() - return False - - def close(self): - self._close() - - def take_unary_unary(self, method_descriptor): - return _channel_rpc.unary_unary(self._state, method_descriptor) - - def take_unary_stream(self, method_descriptor): - return _channel_rpc.unary_stream(self._state, method_descriptor) - - def take_stream_unary(self, method_descriptor): - return _channel_rpc.stream_unary(self._state, method_descriptor) - - def take_stream_stream(self, method_descriptor): - return _channel_rpc.stream_stream(self._state, method_descriptor) - - -# pylint: enable=unused-argument diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_channel_rpc.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_channel_rpc.py deleted file mode 100644 index 54499b3b55..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_channel_rpc.py +++ /dev/null @@ -1,119 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import grpc_testing - - -class _UnaryUnary(grpc_testing.UnaryUnaryChannelRpc): - - def __init__(self, rpc_state): - self._rpc_state = rpc_state - - def send_initial_metadata(self, initial_metadata): - self._rpc_state.send_initial_metadata(initial_metadata) - - def cancelled(self): - self._rpc_state.cancelled() - - def terminate(self, response, trailing_metadata, code, details): - self._rpc_state.terminate_with_response(response, trailing_metadata, - code, details) - - -class _UnaryStream(grpc_testing.UnaryStreamChannelRpc): - - def __init__(self, rpc_state): - self._rpc_state = rpc_state - - def send_initial_metadata(self, initial_metadata): - self._rpc_state.send_initial_metadata(initial_metadata) - - def send_response(self, response): - self._rpc_state.send_response(response) - - def cancelled(self): - self._rpc_state.cancelled() - - def terminate(self, trailing_metadata, code, details): - self._rpc_state.terminate(trailing_metadata, code, details) - - -class _StreamUnary(grpc_testing.StreamUnaryChannelRpc): - - def __init__(self, rpc_state): - self._rpc_state = rpc_state - - def send_initial_metadata(self, initial_metadata): - self._rpc_state.send_initial_metadata(initial_metadata) - - def take_request(self): - return self._rpc_state.take_request() - - def requests_closed(self): - return self._rpc_state.requests_closed() - - def cancelled(self): - self._rpc_state.cancelled() - - def terminate(self, response, trailing_metadata, code, details): - self._rpc_state.terminate_with_response(response, trailing_metadata, - code, details) - - -class _StreamStream(grpc_testing.StreamStreamChannelRpc): - - def __init__(self, rpc_state): - self._rpc_state = rpc_state - - def send_initial_metadata(self, initial_metadata): - self._rpc_state.send_initial_metadata(initial_metadata) - - def take_request(self): - return self._rpc_state.take_request() - - def send_response(self, response): - self._rpc_state.send_response(response) - - def requests_closed(self): - return self._rpc_state.requests_closed() - - def cancelled(self): - self._rpc_state.cancelled() - - def terminate(self, trailing_metadata, code, details): - self._rpc_state.terminate(trailing_metadata, code, details) - - -def unary_unary(channel_state, method_descriptor): - rpc_state = channel_state.take_rpc_state(method_descriptor) - invocation_metadata, request = ( - rpc_state.take_invocation_metadata_and_request()) - return invocation_metadata, request, _UnaryUnary(rpc_state) - - -def unary_stream(channel_state, method_descriptor): - rpc_state = channel_state.take_rpc_state(method_descriptor) - invocation_metadata, request = ( - rpc_state.take_invocation_metadata_and_request()) - return invocation_metadata, request, _UnaryStream(rpc_state) - - -def stream_unary(channel_state, method_descriptor): - rpc_state = channel_state.take_rpc_state(method_descriptor) - return rpc_state.take_invocation_metadata(), _StreamUnary(rpc_state) - - -def stream_stream(channel_state, method_descriptor): - rpc_state = channel_state.take_rpc_state(method_descriptor) - return rpc_state.take_invocation_metadata(), _StreamStream(rpc_state) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_channel_state.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_channel_state.py deleted file mode 100644 index 779d59e59a..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_channel_state.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import collections -import threading - -from grpc_testing import _common -from grpc_testing._channel import _rpc_state - - -class State(_common.ChannelHandler): - - def __init__(self): - self._condition = threading.Condition() - self._rpc_states = collections.defaultdict(list) - - def invoke_rpc(self, method_full_rpc_name, invocation_metadata, requests, - requests_closed, timeout): - rpc_state = _rpc_state.State(invocation_metadata, requests, - requests_closed) - with self._condition: - self._rpc_states[method_full_rpc_name].append(rpc_state) - self._condition.notify_all() - return rpc_state - - def take_rpc_state(self, method_descriptor): - method_full_rpc_name = '/{}/{}'.format( - method_descriptor.containing_service.full_name, - method_descriptor.name) - with self._condition: - while True: - method_rpc_states = self._rpc_states[method_full_rpc_name] - if method_rpc_states: - return method_rpc_states.pop(0) - else: - self._condition.wait() diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_invocation.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_invocation.py deleted file mode 100644 index d7205ca579..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_invocation.py +++ /dev/null @@ -1,324 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import logging -import threading - -import grpc - -_NOT_YET_OBSERVED = object() -logging.basicConfig() -_LOGGER = logging.getLogger(__name__) - - -def _cancel(handler): - return handler.cancel(grpc.StatusCode.CANCELLED, 'Locally cancelled!') - - -def _is_active(handler): - return handler.is_active() - - -def _time_remaining(unused_handler): - raise NotImplementedError() - - -def _add_callback(handler, callback): - return handler.add_callback(callback) - - -def _initial_metadata(handler): - return handler.initial_metadata() - - -def _trailing_metadata(handler): - trailing_metadata, unused_code, unused_details = handler.termination() - return trailing_metadata - - -def _code(handler): - unused_trailing_metadata, code, unused_details = handler.termination() - return code - - -def _details(handler): - unused_trailing_metadata, unused_code, details = handler.termination() - return details - - -class _Call(grpc.Call): - - def __init__(self, handler): - self._handler = handler - - def cancel(self): - _cancel(self._handler) - - def is_active(self): - return _is_active(self._handler) - - def time_remaining(self): - return _time_remaining(self._handler) - - def add_callback(self, callback): - return _add_callback(self._handler, callback) - - def initial_metadata(self): - return _initial_metadata(self._handler) - - def trailing_metadata(self): - return _trailing_metadata(self._handler) - - def code(self): - return _code(self._handler) - - def details(self): - return _details(self._handler) - - -class _RpcErrorCall(grpc.RpcError, grpc.Call): - - def __init__(self, handler): - self._handler = handler - - def cancel(self): - _cancel(self._handler) - - def is_active(self): - return _is_active(self._handler) - - def time_remaining(self): - return _time_remaining(self._handler) - - def add_callback(self, callback): - return _add_callback(self._handler, callback) - - def initial_metadata(self): - return _initial_metadata(self._handler) - - def trailing_metadata(self): - return _trailing_metadata(self._handler) - - def code(self): - return _code(self._handler) - - def details(self): - return _details(self._handler) - - -def _next(handler): - read = handler.take_response() - if read.code is None: - return read.response - elif read.code is grpc.StatusCode.OK: - raise StopIteration() - else: - raise _RpcErrorCall(handler) - - -class _HandlerExtras(object): - - def __init__(self): - self.condition = threading.Condition() - self.unary_response = _NOT_YET_OBSERVED - self.cancelled = False - - -def _with_extras_cancel(handler, extras): - with extras.condition: - if handler.cancel(grpc.StatusCode.CANCELLED, 'Locally cancelled!'): - extras.cancelled = True - return True - else: - return False - - -def _extras_without_cancelled(extras): - with extras.condition: - return extras.cancelled - - -def _running(handler): - return handler.is_active() - - -def _done(handler): - return not handler.is_active() - - -def _with_extras_unary_response(handler, extras): - with extras.condition: - if extras.unary_response is _NOT_YET_OBSERVED: - read = handler.take_response() - if read.code is None: - extras.unary_response = read.response - return read.response - else: - raise _RpcErrorCall(handler) - else: - return extras.unary_response - - -def _exception(unused_handler): - raise NotImplementedError('TODO!') - - -def _traceback(unused_handler): - raise NotImplementedError('TODO!') - - -def _add_done_callback(handler, callback, future): - adapted_callback = lambda: callback(future) - if not handler.add_callback(adapted_callback): - callback(future) - - -class _FutureCall(grpc.Future, grpc.Call): - - def __init__(self, handler, extras): - self._handler = handler - self._extras = extras - - def cancel(self): - return _with_extras_cancel(self._handler, self._extras) - - def cancelled(self): - return _extras_without_cancelled(self._extras) - - def running(self): - return _running(self._handler) - - def done(self): - return _done(self._handler) - - def result(self): - return _with_extras_unary_response(self._handler, self._extras) - - def exception(self): - return _exception(self._handler) - - def traceback(self): - return _traceback(self._handler) - - def add_done_callback(self, fn): - _add_done_callback(self._handler, fn, self) - - def is_active(self): - return _is_active(self._handler) - - def time_remaining(self): - return _time_remaining(self._handler) - - def add_callback(self, callback): - return _add_callback(self._handler, callback) - - def initial_metadata(self): - return _initial_metadata(self._handler) - - def trailing_metadata(self): - return _trailing_metadata(self._handler) - - def code(self): - return _code(self._handler) - - def details(self): - return _details(self._handler) - - -def consume_requests(request_iterator, handler): - - def _consume(): - while True: - try: - request = next(request_iterator) - added = handler.add_request(request) - if not added: - break - except StopIteration: - handler.close_requests() - break - except Exception: # pylint: disable=broad-except - details = 'Exception iterating requests!' - _LOGGER.exception(details) - handler.cancel(grpc.StatusCode.UNKNOWN, details) - - consumption = threading.Thread(target=_consume) - consumption.start() - - -def blocking_unary_response(handler): - read = handler.take_response() - if read.code is None: - unused_trailing_metadata, code, unused_details = handler.termination() - if code is grpc.StatusCode.OK: - return read.response - else: - raise _RpcErrorCall(handler) - else: - raise _RpcErrorCall(handler) - - -def blocking_unary_response_with_call(handler): - read = handler.take_response() - if read.code is None: - unused_trailing_metadata, code, unused_details = handler.termination() - if code is grpc.StatusCode.OK: - return read.response, _Call(handler) - else: - raise _RpcErrorCall(handler) - else: - raise _RpcErrorCall(handler) - - -def future_call(handler): - return _FutureCall(handler, _HandlerExtras()) - - -class ResponseIteratorCall(grpc.Call): - - def __init__(self, handler): - self._handler = handler - - def __iter__(self): - return self - - def __next__(self): - return _next(self._handler) - - def next(self): - return _next(self._handler) - - def cancel(self): - _cancel(self._handler) - - def is_active(self): - return _is_active(self._handler) - - def time_remaining(self): - return _time_remaining(self._handler) - - def add_callback(self, callback): - return _add_callback(self._handler, callback) - - def initial_metadata(self): - return _initial_metadata(self._handler) - - def trailing_metadata(self): - return _trailing_metadata(self._handler) - - def code(self): - return _code(self._handler) - - def details(self): - return _details(self._handler) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_multi_callable.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_multi_callable.py deleted file mode 100644 index 2b2f5761f5..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_multi_callable.py +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import grpc -from grpc_testing import _common -from grpc_testing._channel import _invocation - - -# All per-call credentials parameters are unused by this test infrastructure. -# pylint: disable=unused-argument -class UnaryUnary(grpc.UnaryUnaryMultiCallable): - - def __init__(self, method_full_rpc_name, channel_handler): - self._method_full_rpc_name = method_full_rpc_name - self._channel_handler = channel_handler - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - rpc_handler = self._channel_handler.invoke_rpc( - self._method_full_rpc_name, _common.fuss_with_metadata(metadata), - [request], True, timeout) - return _invocation.blocking_unary_response(rpc_handler) - - def with_call(self, request, timeout=None, metadata=None, credentials=None): - rpc_handler = self._channel_handler.invoke_rpc( - self._method_full_rpc_name, _common.fuss_with_metadata(metadata), - [request], True, timeout) - return _invocation.blocking_unary_response_with_call(rpc_handler) - - def future(self, request, timeout=None, metadata=None, credentials=None): - rpc_handler = self._channel_handler.invoke_rpc( - self._method_full_rpc_name, _common.fuss_with_metadata(metadata), - [request], True, timeout) - return _invocation.future_call(rpc_handler) - - -class UnaryStream(grpc.StreamStreamMultiCallable): - - def __init__(self, method_full_rpc_name, channel_handler): - self._method_full_rpc_name = method_full_rpc_name - self._channel_handler = channel_handler - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - rpc_handler = self._channel_handler.invoke_rpc( - self._method_full_rpc_name, _common.fuss_with_metadata(metadata), - [request], True, timeout) - return _invocation.ResponseIteratorCall(rpc_handler) - - -class StreamUnary(grpc.StreamUnaryMultiCallable): - - def __init__(self, method_full_rpc_name, channel_handler): - self._method_full_rpc_name = method_full_rpc_name - self._channel_handler = channel_handler - - def __call__(self, - request_iterator, - timeout=None, - metadata=None, - credentials=None): - rpc_handler = self._channel_handler.invoke_rpc( - self._method_full_rpc_name, _common.fuss_with_metadata(metadata), - [], False, timeout) - _invocation.consume_requests(request_iterator, rpc_handler) - return _invocation.blocking_unary_response(rpc_handler) - - def with_call(self, - request_iterator, - timeout=None, - metadata=None, - credentials=None): - rpc_handler = self._channel_handler.invoke_rpc( - self._method_full_rpc_name, _common.fuss_with_metadata(metadata), - [], False, timeout) - _invocation.consume_requests(request_iterator, rpc_handler) - return _invocation.blocking_unary_response_with_call(rpc_handler) - - def future(self, - request_iterator, - timeout=None, - metadata=None, - credentials=None): - rpc_handler = self._channel_handler.invoke_rpc( - self._method_full_rpc_name, _common.fuss_with_metadata(metadata), - [], False, timeout) - _invocation.consume_requests(request_iterator, rpc_handler) - return _invocation.future_call(rpc_handler) - - -class StreamStream(grpc.StreamStreamMultiCallable): - - def __init__(self, method_full_rpc_name, channel_handler): - self._method_full_rpc_name = method_full_rpc_name - self._channel_handler = channel_handler - - def __call__(self, - request_iterator, - timeout=None, - metadata=None, - credentials=None): - rpc_handler = self._channel_handler.invoke_rpc( - self._method_full_rpc_name, _common.fuss_with_metadata(metadata), - [], False, timeout) - _invocation.consume_requests(request_iterator, rpc_handler) - return _invocation.ResponseIteratorCall(rpc_handler) - - -# pylint: enable=unused-argument diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py deleted file mode 100644 index a548ef0f12..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py +++ /dev/null @@ -1,193 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import threading - -import grpc -from grpc_testing import _common - - -class State(_common.ChannelRpcHandler): - - def __init__(self, invocation_metadata, requests, requests_closed): - self._condition = threading.Condition() - self._invocation_metadata = invocation_metadata - self._requests = requests - self._requests_closed = requests_closed - self._initial_metadata = None - self._responses = [] - self._trailing_metadata = None - self._code = None - self._details = None - - def initial_metadata(self): - with self._condition: - while True: - if self._initial_metadata is None: - if self._code is None: - self._condition.wait() - else: - return _common.FUSSED_EMPTY_METADATA - else: - return self._initial_metadata - - def add_request(self, request): - with self._condition: - if self._code is None and not self._requests_closed: - self._requests.append(request) - self._condition.notify_all() - return True - else: - return False - - def close_requests(self): - with self._condition: - if self._code is None and not self._requests_closed: - self._requests_closed = True - self._condition.notify_all() - - def take_response(self): - with self._condition: - while True: - if self._code is grpc.StatusCode.OK: - if self._responses: - response = self._responses.pop(0) - return _common.ChannelRpcRead(response, None, None, - None) - else: - return _common.ChannelRpcRead(None, - self._trailing_metadata, - grpc.StatusCode.OK, - self._details) - elif self._code is None: - if self._responses: - response = self._responses.pop(0) - return _common.ChannelRpcRead(response, None, None, - None) - else: - self._condition.wait() - else: - return _common.ChannelRpcRead(None, self._trailing_metadata, - self._code, self._details) - - def termination(self): - with self._condition: - while True: - if self._code is None: - self._condition.wait() - else: - return self._trailing_metadata, self._code, self._details - - def cancel(self, code, details): - with self._condition: - if self._code is None: - if self._initial_metadata is None: - self._initial_metadata = _common.FUSSED_EMPTY_METADATA - self._trailing_metadata = _common.FUSSED_EMPTY_METADATA - self._code = code - self._details = details - self._condition.notify_all() - return True - else: - return False - - def take_invocation_metadata(self): - with self._condition: - if self._invocation_metadata is None: - raise ValueError('Expected invocation metadata!') - else: - invocation_metadata = self._invocation_metadata - self._invocation_metadata = None - return invocation_metadata - - def take_invocation_metadata_and_request(self): - with self._condition: - if self._invocation_metadata is None: - raise ValueError('Expected invocation metadata!') - elif not self._requests: - raise ValueError('Expected at least one request!') - else: - invocation_metadata = self._invocation_metadata - self._invocation_metadata = None - return invocation_metadata, self._requests.pop(0) - - def send_initial_metadata(self, initial_metadata): - with self._condition: - self._initial_metadata = _common.fuss_with_metadata( - initial_metadata) - self._condition.notify_all() - - def take_request(self): - with self._condition: - while True: - if self._requests: - return self._requests.pop(0) - else: - self._condition.wait() - - def requests_closed(self): - with self._condition: - while True: - if self._requests_closed: - return - else: - self._condition.wait() - - def send_response(self, response): - with self._condition: - if self._code is None: - self._responses.append(response) - self._condition.notify_all() - - def terminate_with_response(self, response, trailing_metadata, code, - details): - with self._condition: - if self._initial_metadata is None: - self._initial_metadata = _common.FUSSED_EMPTY_METADATA - self._responses.append(response) - self._trailing_metadata = _common.fuss_with_metadata( - trailing_metadata) - self._code = code - self._details = details - self._condition.notify_all() - - def terminate(self, trailing_metadata, code, details): - with self._condition: - if self._initial_metadata is None: - self._initial_metadata = _common.FUSSED_EMPTY_METADATA - self._trailing_metadata = _common.fuss_with_metadata( - trailing_metadata) - self._code = code - self._details = details - self._condition.notify_all() - - def cancelled(self): - with self._condition: - while True: - if self._code is grpc.StatusCode.CANCELLED: - return - elif self._code is None: - self._condition.wait() - else: - raise ValueError('Status code unexpectedly {}!'.format( - self._code)) - - def is_active(self): - raise NotImplementedError() - - def time_remaining(self): - raise NotImplementedError() - - def add_callback(self, callback): - raise NotImplementedError() diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_common.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_common.py deleted file mode 100644 index cebad31b5c..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_common.py +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Common interfaces and implementation.""" - -import abc -import collections - -import six - - -def _fuss(tuplified_metadata): - return tuplified_metadata + (( - 'grpc.metadata_added_by_runtime', - 'gRPC is allowed to add metadata in transmission and does so.', - ),) - - -FUSSED_EMPTY_METADATA = _fuss(()) - - -def fuss_with_metadata(metadata): - if metadata is None: - return FUSSED_EMPTY_METADATA - else: - return _fuss(tuple(metadata)) - - -def rpc_names(service_descriptors): - rpc_names_to_descriptors = {} - for service_descriptor in service_descriptors: - for method_descriptor in service_descriptor.methods_by_name.values(): - rpc_name = '/{}/{}'.format(service_descriptor.full_name, - method_descriptor.name) - rpc_names_to_descriptors[rpc_name] = method_descriptor - return rpc_names_to_descriptors - - -class ChannelRpcRead( - collections.namedtuple('ChannelRpcRead', ( - 'response', - 'trailing_metadata', - 'code', - 'details', - ))): - pass - - -class ChannelRpcHandler(six.with_metaclass(abc.ABCMeta)): - - @abc.abstractmethod - def initial_metadata(self): - raise NotImplementedError() - - @abc.abstractmethod - def add_request(self, request): - raise NotImplementedError() - - @abc.abstractmethod - def close_requests(self): - raise NotImplementedError() - - @abc.abstractmethod - def take_response(self): - raise NotImplementedError() - - @abc.abstractmethod - def cancel(self, code, details): - raise NotImplementedError() - - @abc.abstractmethod - def termination(self): - raise NotImplementedError() - - @abc.abstractmethod - def is_active(self): - raise NotImplementedError() - - @abc.abstractmethod - def time_remaining(self): - raise NotImplementedError() - - @abc.abstractmethod - def add_callback(self, callback): - raise NotImplementedError() - - -class ChannelHandler(six.with_metaclass(abc.ABCMeta)): - - @abc.abstractmethod - def invoke_rpc(self, method_full_rpc_name, invocation_metadata, requests, - requests_closed, timeout): - raise NotImplementedError() - - -class ServerRpcRead( - collections.namedtuple('ServerRpcRead', ( - 'request', - 'requests_closed', - 'terminated', - ))): - pass - - -REQUESTS_CLOSED = ServerRpcRead(None, True, False) -TERMINATED = ServerRpcRead(None, False, True) - - -class ServerRpcHandler(six.with_metaclass(abc.ABCMeta)): - - @abc.abstractmethod - def send_initial_metadata(self, initial_metadata): - raise NotImplementedError() - - @abc.abstractmethod - def take_request(self): - raise NotImplementedError() - - @abc.abstractmethod - def add_response(self, response): - raise NotImplementedError() - - @abc.abstractmethod - def send_termination(self, trailing_metadata, code, details): - raise NotImplementedError() - - @abc.abstractmethod - def add_termination_callback(self, callback): - raise NotImplementedError() - - -class Serverish(six.with_metaclass(abc.ABCMeta)): - - @abc.abstractmethod - def invoke_unary_unary(self, method_descriptor, handler, - invocation_metadata, request, deadline): - raise NotImplementedError() - - @abc.abstractmethod - def invoke_unary_stream(self, method_descriptor, handler, - invocation_metadata, request, deadline): - raise NotImplementedError() - - @abc.abstractmethod - def invoke_stream_unary(self, method_descriptor, handler, - invocation_metadata, deadline): - raise NotImplementedError() - - @abc.abstractmethod - def invoke_stream_stream(self, method_descriptor, handler, - invocation_metadata, deadline): - raise NotImplementedError() diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/__init__.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/__init__.py deleted file mode 100644 index 5f035a91ca..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from grpc_testing._server import _server - - -def server_from_dictionary(descriptors_to_servicers, time): - return _server.server_from_descriptor_to_servicers(descriptors_to_servicers, - time) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_handler.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_handler.py deleted file mode 100644 index 100d8195f6..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_handler.py +++ /dev/null @@ -1,217 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import abc -import threading - -import grpc -from grpc_testing import _common - -_CLIENT_INACTIVE = object() - - -class Handler(_common.ServerRpcHandler): - - @abc.abstractmethod - def initial_metadata(self): - raise NotImplementedError() - - @abc.abstractmethod - def add_request(self, request): - raise NotImplementedError() - - @abc.abstractmethod - def take_response(self): - raise NotImplementedError() - - @abc.abstractmethod - def requests_closed(self): - raise NotImplementedError() - - @abc.abstractmethod - def cancel(self): - raise NotImplementedError() - - @abc.abstractmethod - def unary_response_termination(self): - raise NotImplementedError() - - @abc.abstractmethod - def stream_response_termination(self): - raise NotImplementedError() - - -class _Handler(Handler): - - def __init__(self, requests_closed): - self._condition = threading.Condition() - self._requests = [] - self._requests_closed = requests_closed - self._initial_metadata = None - self._responses = [] - self._trailing_metadata = None - self._code = None - self._details = None - self._unary_response = None - self._expiration_future = None - self._termination_callbacks = [] - - def send_initial_metadata(self, initial_metadata): - with self._condition: - self._initial_metadata = initial_metadata - self._condition.notify_all() - - def take_request(self): - with self._condition: - while True: - if self._code is None: - if self._requests: - request = self._requests.pop(0) - self._condition.notify_all() - return _common.ServerRpcRead(request, False, False) - elif self._requests_closed: - return _common.REQUESTS_CLOSED - else: - self._condition.wait() - else: - return _common.TERMINATED - - def is_active(self): - with self._condition: - return self._code is None - - def add_response(self, response): - with self._condition: - self._responses.append(response) - self._condition.notify_all() - - def send_termination(self, trailing_metadata, code, details): - with self._condition: - self._trailing_metadata = trailing_metadata - self._code = code - self._details = details - if self._expiration_future is not None: - self._expiration_future.cancel() - self._condition.notify_all() - - def add_termination_callback(self, callback): - with self._condition: - if self._code is None: - self._termination_callbacks.append(callback) - return True - else: - return False - - def initial_metadata(self): - with self._condition: - while True: - if self._initial_metadata is None: - if self._code is None: - self._condition.wait() - else: - raise ValueError( - 'No initial metadata despite status code!') - else: - return self._initial_metadata - - def add_request(self, request): - with self._condition: - self._requests.append(request) - self._condition.notify_all() - - def take_response(self): - with self._condition: - while True: - if self._responses: - response = self._responses.pop(0) - self._condition.notify_all() - return response - elif self._code is None: - self._condition.wait() - else: - raise ValueError('No more responses!') - - def requests_closed(self): - with self._condition: - self._requests_closed = True - self._condition.notify_all() - - def cancel(self): - with self._condition: - if self._code is None: - self._code = _CLIENT_INACTIVE - termination_callbacks = self._termination_callbacks - self._termination_callbacks = None - if self._expiration_future is not None: - self._expiration_future.cancel() - self._condition.notify_all() - for termination_callback in termination_callbacks: - termination_callback() - - def unary_response_termination(self): - with self._condition: - while True: - if self._code is _CLIENT_INACTIVE: - raise ValueError('Huh? Cancelled but wanting status?') - elif self._code is None: - self._condition.wait() - else: - if self._unary_response is None: - if self._responses: - self._unary_response = self._responses.pop(0) - return ( - self._unary_response, - self._trailing_metadata, - self._code, - self._details, - ) - - def stream_response_termination(self): - with self._condition: - while True: - if self._code is _CLIENT_INACTIVE: - raise ValueError('Huh? Cancelled but wanting status?') - elif self._code is None: - self._condition.wait() - else: - return self._trailing_metadata, self._code, self._details - - def expire(self): - with self._condition: - if self._code is None: - if self._initial_metadata is None: - self._initial_metadata = _common.FUSSED_EMPTY_METADATA - self._trailing_metadata = _common.FUSSED_EMPTY_METADATA - self._code = grpc.StatusCode.DEADLINE_EXCEEDED - self._details = 'Took too much time!' - termination_callbacks = self._termination_callbacks - self._termination_callbacks = None - self._condition.notify_all() - for termination_callback in termination_callbacks: - termination_callback() - - def set_expiration_future(self, expiration_future): - with self._condition: - self._expiration_future = expiration_future - - -def handler_without_deadline(requests_closed): - return _Handler(requests_closed) - - -def handler_with_deadline(requests_closed, time, deadline): - handler = _Handler(requests_closed) - expiration_future = time.call_at(handler.expire, deadline) - handler.set_expiration_future(expiration_future) - return handler diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_rpc.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_rpc.py deleted file mode 100644 index 736b714dc6..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_rpc.py +++ /dev/null @@ -1,155 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import logging -import threading - -import grpc -from grpc_testing import _common - -logging.basicConfig() -_LOGGER = logging.getLogger(__name__) - - -class Rpc(object): - - def __init__(self, handler, invocation_metadata): - self._condition = threading.Condition() - self._handler = handler - self._invocation_metadata = invocation_metadata - self._initial_metadata_sent = False - self._pending_trailing_metadata = None - self._pending_code = None - self._pending_details = None - self._callbacks = [] - self._active = True - self._rpc_errors = [] - - def _ensure_initial_metadata_sent(self): - if not self._initial_metadata_sent: - self._handler.send_initial_metadata(_common.FUSSED_EMPTY_METADATA) - self._initial_metadata_sent = True - - def _call_back(self): - callbacks = tuple(self._callbacks) - self._callbacks = None - - def call_back(): - for callback in callbacks: - try: - callback() - except Exception: # pylint: disable=broad-except - _LOGGER.exception('Exception calling server-side callback!') - - callback_calling_thread = threading.Thread(target=call_back) - callback_calling_thread.start() - - def _terminate(self, trailing_metadata, code, details): - if self._active: - self._active = False - self._handler.send_termination(trailing_metadata, code, details) - self._call_back() - self._condition.notify_all() - - def _complete(self): - if self._pending_trailing_metadata is None: - trailing_metadata = _common.FUSSED_EMPTY_METADATA - else: - trailing_metadata = self._pending_trailing_metadata - if self._pending_code is None: - code = grpc.StatusCode.OK - else: - code = self._pending_code - details = '' if self._pending_details is None else self._pending_details - self._terminate(trailing_metadata, code, details) - - def _abort(self, code, details): - self._terminate(_common.FUSSED_EMPTY_METADATA, code, details) - - def add_rpc_error(self, rpc_error): - with self._condition: - self._rpc_errors.append(rpc_error) - - def application_cancel(self): - with self._condition: - self._abort(grpc.StatusCode.CANCELLED, - 'Cancelled by server-side application!') - - def application_exception_abort(self, exception): - with self._condition: - if exception not in self._rpc_errors: - _LOGGER.exception('Exception calling application!') - self._abort( - grpc.StatusCode.UNKNOWN, - 'Exception calling application: {}'.format(exception)) - - def extrinsic_abort(self): - with self._condition: - if self._active: - self._active = False - self._call_back() - self._condition.notify_all() - - def unary_response_complete(self, response): - with self._condition: - self._ensure_initial_metadata_sent() - self._handler.add_response(response) - self._complete() - - def stream_response(self, response): - with self._condition: - self._ensure_initial_metadata_sent() - self._handler.add_response(response) - - def stream_response_complete(self): - with self._condition: - self._ensure_initial_metadata_sent() - self._complete() - - def send_initial_metadata(self, initial_metadata): - with self._condition: - if self._initial_metadata_sent: - return False - else: - self._handler.send_initial_metadata(initial_metadata) - self._initial_metadata_sent = True - return True - - def is_active(self): - with self._condition: - return self._active - - def add_callback(self, callback): - with self._condition: - if self._callbacks is None: - return False - else: - self._callbacks.append(callback) - return True - - def invocation_metadata(self): - with self._condition: - return self._invocation_metadata - - def set_trailing_metadata(self, trailing_metadata): - with self._condition: - self._pending_trailing_metadata = trailing_metadata - - def set_code(self, code): - with self._condition: - self._pending_code = code - - def set_details(self, details): - with self._condition: - self._pending_details = details diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server.py deleted file mode 100644 index 6d256d848f..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server.py +++ /dev/null @@ -1,154 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import threading - -import grpc_testing -from grpc_testing import _common -from grpc_testing._server import _handler -from grpc_testing._server import _rpc -from grpc_testing._server import _server_rpc -from grpc_testing._server import _service -from grpc_testing._server import _servicer_context - - -def _implementation(descriptors_to_servicers, method_descriptor): - servicer = descriptors_to_servicers[method_descriptor.containing_service] - return getattr(servicer, method_descriptor.name) - - -def _unary_unary_service(request): - - def service(implementation, rpc, servicer_context): - _service.unary_unary(implementation, rpc, request, servicer_context) - - return service - - -def _unary_stream_service(request): - - def service(implementation, rpc, servicer_context): - _service.unary_stream(implementation, rpc, request, servicer_context) - - return service - - -def _stream_unary_service(handler): - - def service(implementation, rpc, servicer_context): - _service.stream_unary(implementation, rpc, handler, servicer_context) - - return service - - -def _stream_stream_service(handler): - - def service(implementation, rpc, servicer_context): - _service.stream_stream(implementation, rpc, handler, servicer_context) - - return service - - -class _Serverish(_common.Serverish): - - def __init__(self, descriptors_to_servicers, time): - self._descriptors_to_servicers = descriptors_to_servicers - self._time = time - - def _invoke(self, service_behavior, method_descriptor, handler, - invocation_metadata, deadline): - implementation = _implementation(self._descriptors_to_servicers, - method_descriptor) - rpc = _rpc.Rpc(handler, invocation_metadata) - if handler.add_termination_callback(rpc.extrinsic_abort): - servicer_context = _servicer_context.ServicerContext( - rpc, self._time, deadline) - service_thread = threading.Thread(target=service_behavior, - args=( - implementation, - rpc, - servicer_context, - )) - service_thread.start() - - def invoke_unary_unary(self, method_descriptor, handler, - invocation_metadata, request, deadline): - self._invoke(_unary_unary_service(request), method_descriptor, handler, - invocation_metadata, deadline) - - def invoke_unary_stream(self, method_descriptor, handler, - invocation_metadata, request, deadline): - self._invoke(_unary_stream_service(request), method_descriptor, handler, - invocation_metadata, deadline) - - def invoke_stream_unary(self, method_descriptor, handler, - invocation_metadata, deadline): - self._invoke(_stream_unary_service(handler), method_descriptor, handler, - invocation_metadata, deadline) - - def invoke_stream_stream(self, method_descriptor, handler, - invocation_metadata, deadline): - self._invoke(_stream_stream_service(handler), method_descriptor, - handler, invocation_metadata, deadline) - - -def _deadline_and_handler(requests_closed, time, timeout): - if timeout is None: - return None, _handler.handler_without_deadline(requests_closed) - else: - deadline = time.time() + timeout - handler = _handler.handler_with_deadline(requests_closed, time, - deadline) - return deadline, handler - - -class _Server(grpc_testing.Server): - - def __init__(self, serverish, time): - self._serverish = serverish - self._time = time - - def invoke_unary_unary(self, method_descriptor, invocation_metadata, - request, timeout): - deadline, handler = _deadline_and_handler(True, self._time, timeout) - self._serverish.invoke_unary_unary(method_descriptor, handler, - invocation_metadata, request, - deadline) - return _server_rpc.UnaryUnaryServerRpc(handler) - - def invoke_unary_stream(self, method_descriptor, invocation_metadata, - request, timeout): - deadline, handler = _deadline_and_handler(True, self._time, timeout) - self._serverish.invoke_unary_stream(method_descriptor, handler, - invocation_metadata, request, - deadline) - return _server_rpc.UnaryStreamServerRpc(handler) - - def invoke_stream_unary(self, method_descriptor, invocation_metadata, - timeout): - deadline, handler = _deadline_and_handler(False, self._time, timeout) - self._serverish.invoke_stream_unary(method_descriptor, handler, - invocation_metadata, deadline) - return _server_rpc.StreamUnaryServerRpc(handler) - - def invoke_stream_stream(self, method_descriptor, invocation_metadata, - timeout): - deadline, handler = _deadline_and_handler(False, self._time, timeout) - self._serverish.invoke_stream_stream(method_descriptor, handler, - invocation_metadata, deadline) - return _server_rpc.StreamStreamServerRpc(handler) - - -def server_from_descriptor_to_servicers(descriptors_to_servicers, time): - return _Server(_Serverish(descriptors_to_servicers, time), time) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server_rpc.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server_rpc.py deleted file mode 100644 index 30de8ff0e2..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server_rpc.py +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import grpc_testing - - -class UnaryUnaryServerRpc(grpc_testing.UnaryUnaryServerRpc): - - def __init__(self, handler): - self._handler = handler - - def initial_metadata(self): - return self._handler.initial_metadata() - - def cancel(self): - self._handler.cancel() - - def termination(self): - return self._handler.unary_response_termination() - - -class UnaryStreamServerRpc(grpc_testing.UnaryStreamServerRpc): - - def __init__(self, handler): - self._handler = handler - - def initial_metadata(self): - return self._handler.initial_metadata() - - def take_response(self): - return self._handler.take_response() - - def cancel(self): - self._handler.cancel() - - def termination(self): - return self._handler.stream_response_termination() - - -class StreamUnaryServerRpc(grpc_testing.StreamUnaryServerRpc): - - def __init__(self, handler): - self._handler = handler - - def initial_metadata(self): - return self._handler.initial_metadata() - - def send_request(self, request): - self._handler.add_request(request) - - def requests_closed(self): - self._handler.requests_closed() - - def cancel(self): - self._handler.cancel() - - def termination(self): - return self._handler.unary_response_termination() - - -class StreamStreamServerRpc(grpc_testing.StreamStreamServerRpc): - - def __init__(self, handler): - self._handler = handler - - def initial_metadata(self): - return self._handler.initial_metadata() - - def send_request(self, request): - self._handler.add_request(request) - - def requests_closed(self): - self._handler.requests_closed() - - def take_response(self): - return self._handler.take_response() - - def cancel(self): - self._handler.cancel() - - def termination(self): - return self._handler.stream_response_termination() diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py deleted file mode 100644 index 661257e275..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import copy - -import grpc - - -class _RequestIterator(object): - - def __init__(self, rpc, handler): - self._rpc = rpc - self._handler = handler - - def _next(self): - read = self._handler.take_request() - if read.requests_closed: - raise StopIteration() - elif read.terminated: - rpc_error = grpc.RpcError() - self._rpc.add_rpc_error(rpc_error) - raise rpc_error - else: - return read.request - - def __iter__(self): - return self - - def __next__(self): - return self._next() - - def next(self): - return self._next() - - -def _unary_response(argument, implementation, rpc, servicer_context): - try: - response = implementation(argument, servicer_context) - except Exception as exception: # pylint: disable=broad-except - rpc.application_exception_abort(exception) - else: - rpc.unary_response_complete(response) - - -def _stream_response(argument, implementation, rpc, servicer_context): - try: - response_iterator = implementation(argument, servicer_context) - except Exception as exception: # pylint: disable=broad-except - rpc.application_exception_abort(exception) - else: - while True: - try: - response = copy.deepcopy(next(response_iterator)) - except StopIteration: - rpc.stream_response_complete() - break - except Exception as exception: # pylint: disable=broad-except - rpc.application_exception_abort(exception) - break - else: - rpc.stream_response(response) - - -def unary_unary(implementation, rpc, request, servicer_context): - _unary_response(request, implementation, rpc, servicer_context) - - -def unary_stream(implementation, rpc, request, servicer_context): - _stream_response(request, implementation, rpc, servicer_context) - - -def stream_unary(implementation, rpc, handler, servicer_context): - _unary_response(_RequestIterator(rpc, handler), implementation, rpc, - servicer_context) - - -def stream_stream(implementation, rpc, handler, servicer_context): - _stream_response(_RequestIterator(rpc, handler), implementation, rpc, - servicer_context) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_servicer_context.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_servicer_context.py deleted file mode 100644 index c63750f978..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_servicer_context.py +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import grpc -from grpc_testing import _common - - -class ServicerContext(grpc.ServicerContext): - - def __init__(self, rpc, time, deadline): - self._rpc = rpc - self._time = time - self._deadline = deadline - - def is_active(self): - return self._rpc.is_active() - - def time_remaining(self): - if self._rpc.is_active(): - if self._deadline is None: - return None - else: - return max(0.0, self._deadline - self._time.time()) - else: - return 0.0 - - def cancel(self): - self._rpc.application_cancel() - - def add_callback(self, callback): - return self._rpc.add_callback(callback) - - def invocation_metadata(self): - return self._rpc.invocation_metadata() - - def peer(self): - raise NotImplementedError() - - def peer_identities(self): - raise NotImplementedError() - - def peer_identity_key(self): - raise NotImplementedError() - - def auth_context(self): - raise NotImplementedError() - - def set_compression(self): - raise NotImplementedError() - - def send_initial_metadata(self, initial_metadata): - initial_metadata_sent = self._rpc.send_initial_metadata( - _common.fuss_with_metadata(initial_metadata)) - if not initial_metadata_sent: - raise ValueError( - 'ServicerContext.send_initial_metadata called too late!') - - def disable_next_message_compression(self): - raise NotImplementedError() - - def set_trailing_metadata(self, trailing_metadata): - self._rpc.set_trailing_metadata( - _common.fuss_with_metadata(trailing_metadata)) - - def abort(self, code, details): - with self._rpc._condition: - self._rpc._abort(code, details) - raise Exception() - - def abort_with_status(self, status): - raise NotImplementedError() - - def set_code(self, code): - self._rpc.set_code(code) - - def set_details(self, details): - self._rpc.set_details(details) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_time.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_time.py deleted file mode 100644 index 9692c34e6f..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_time.py +++ /dev/null @@ -1,229 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Test times.""" - -import collections -import logging -import threading -import time as _time - -import grpc -import grpc_testing - -logging.basicConfig() -_LOGGER = logging.getLogger(__name__) - - -def _call(behaviors): - for behavior in behaviors: - try: - behavior() - except Exception: # pylint: disable=broad-except - _LOGGER.exception('Exception calling behavior "%r"!', behavior) - - -def _call_in_thread(behaviors): - calling = threading.Thread(target=_call, args=(behaviors,)) - calling.start() - # NOTE(nathaniel): Because this function is called from "strict" Time - # implementations, it blocks until after all behaviors have terminated. - calling.join() - - -class _State(object): - - def __init__(self): - self.condition = threading.Condition() - self.times_to_behaviors = collections.defaultdict(list) - - -class _Delta( - collections.namedtuple('_Delta', ( - 'mature_behaviors', - 'earliest_mature_time', - 'earliest_immature_time', - ))): - pass - - -def _process(state, now): - mature_behaviors = [] - earliest_mature_time = None - while state.times_to_behaviors: - earliest_time = min(state.times_to_behaviors) - if earliest_time <= now: - if earliest_mature_time is None: - earliest_mature_time = earliest_time - earliest_mature_behaviors = state.times_to_behaviors.pop( - earliest_time) - mature_behaviors.extend(earliest_mature_behaviors) - else: - earliest_immature_time = earliest_time - break - else: - earliest_immature_time = None - return _Delta(mature_behaviors, earliest_mature_time, - earliest_immature_time) - - -class _Future(grpc.Future): - - def __init__(self, state, behavior, time): - self._state = state - self._behavior = behavior - self._time = time - self._cancelled = False - - def cancel(self): - with self._state.condition: - if self._cancelled: - return True - else: - behaviors_at_time = self._state.times_to_behaviors.get( - self._time) - if behaviors_at_time is None: - return False - else: - behaviors_at_time.remove(self._behavior) - if not behaviors_at_time: - self._state.times_to_behaviors.pop(self._time) - self._state.condition.notify_all() - self._cancelled = True - return True - - def cancelled(self): - with self._state.condition: - return self._cancelled - - def running(self): - raise NotImplementedError() - - def done(self): - raise NotImplementedError() - - def result(self, timeout=None): - raise NotImplementedError() - - def exception(self, timeout=None): - raise NotImplementedError() - - def traceback(self, timeout=None): - raise NotImplementedError() - - def add_done_callback(self, fn): - raise NotImplementedError() - - -class StrictRealTime(grpc_testing.Time): - - def __init__(self): - self._state = _State() - self._active = False - self._calling = None - - def _activity(self): - while True: - with self._state.condition: - while True: - now = _time.time() - delta = _process(self._state, now) - self._state.condition.notify_all() - if delta.mature_behaviors: - self._calling = delta.earliest_mature_time - break - self._calling = None - if delta.earliest_immature_time is None: - self._active = False - return - else: - timeout = max(0, delta.earliest_immature_time - now) - self._state.condition.wait(timeout=timeout) - _call(delta.mature_behaviors) - - def _ensure_called_through(self, time): - with self._state.condition: - while ((self._state.times_to_behaviors and - min(self._state.times_to_behaviors) < time) or - (self._calling is not None and self._calling < time)): - self._state.condition.wait() - - def _call_at(self, behavior, time): - with self._state.condition: - self._state.times_to_behaviors[time].append(behavior) - if self._active: - self._state.condition.notify_all() - else: - activity = threading.Thread(target=self._activity) - activity.start() - self._active = True - return _Future(self._state, behavior, time) - - def time(self): - return _time.time() - - def call_in(self, behavior, delay): - return self._call_at(behavior, _time.time() + delay) - - def call_at(self, behavior, time): - return self._call_at(behavior, time) - - def sleep_for(self, duration): - time = _time.time() + duration - _time.sleep(duration) - self._ensure_called_through(time) - - def sleep_until(self, time): - _time.sleep(max(0, time - _time.time())) - self._ensure_called_through(time) - - -class StrictFakeTime(grpc_testing.Time): - - def __init__(self, time): - self._state = _State() - self._time = time - - def time(self): - return self._time - - def call_in(self, behavior, delay): - if delay <= 0: - _call_in_thread((behavior,)) - else: - with self._state.condition: - time = self._time + delay - self._state.times_to_behaviors[time].append(behavior) - return _Future(self._state, behavior, time) - - def call_at(self, behavior, time): - with self._state.condition: - if time <= self._time: - _call_in_thread((behavior,)) - else: - self._state.times_to_behaviors[time].append(behavior) - return _Future(self._state, behavior, time) - - def sleep_for(self, duration): - if 0 < duration: - with self._state.condition: - self._time += duration - delta = _process(self._state, self._time) - _call_in_thread(delta.mature_behaviors) - - def sleep_until(self, time): - with self._state.condition: - if self._time < time: - self._time = time - delta = _process(self._state, self._time) - _call_in_thread(delta.mature_behaviors) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py deleted file mode 100644 index 66abb8b188..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! - -VERSION = '1.43.2' diff --git a/contrib/libs/grpc/src/python/grpcio_testing/setup.py b/contrib/libs/grpc/src/python/grpcio_testing/setup.py deleted file mode 100644 index b976620484..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/setup.py +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Setup module for gRPC Python's testing package.""" - -import os -import sys - -import setuptools - -_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__)) -_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst') - -# Ensure we're in the proper directory whether or not we're being used by pip. -os.chdir(os.path.dirname(os.path.abspath(__file__))) - -# Break import style to ensure that we can find same-directory modules. -import grpc_version - - -class _NoOpCommand(setuptools.Command): - """No-op command.""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - pass - - -PACKAGE_DIRECTORIES = { - '': '.', -} - -INSTALL_REQUIRES = ( - 'protobuf>=3.6.0', - 'grpcio>={version}'.format(version=grpc_version.VERSION), -) - -try: - import testing_commands as _testing_commands - - # we are in the build environment, otherwise the above import fails - COMMAND_CLASS = { - # Run preprocess from the repository *before* doing any packaging! - 'preprocess': _testing_commands.Preprocess, - } -except ImportError: - COMMAND_CLASS = { - # wire up commands to no-op not to break the external dependencies - 'preprocess': _NoOpCommand, - } - -setuptools.setup(name='grpcio-testing', - version=grpc_version.VERSION, - license='Apache License 2.0', - description='Testing utilities for gRPC Python', - long_description=open(_README_PATH, 'r').read(), - author='The gRPC Authors', - author_email='grpc-io@googlegroups.com', - url='https://grpc.io', - package_dir=PACKAGE_DIRECTORIES, - packages=setuptools.find_packages('.'), - install_requires=INSTALL_REQUIRES, - cmdclass=COMMAND_CLASS) diff --git a/contrib/libs/grpc/src/python/grpcio_testing/testing_commands.py b/contrib/libs/grpc/src/python/grpcio_testing/testing_commands.py deleted file mode 100644 index fb40d37efb..0000000000 --- a/contrib/libs/grpc/src/python/grpcio_testing/testing_commands.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2018 gRPC Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Provides distutils command classes for the GRPC Python setup process.""" - -import os -import shutil - -import setuptools - -ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) -LICENSE = os.path.join(ROOT_DIR, '../../../LICENSE') - - -class Preprocess(setuptools.Command): - """Command to copy LICENSE from root directory.""" - - description = '' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - if os.path.isfile(LICENSE): - shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE')) |