aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--BUILD16
-rw-r--r--CMakeLists.txt8
-rw-r--r--build.yaml12
-rw-r--r--config.m42
-rw-r--r--config.w322
-rw-r--r--gRPC-C++.podspec3
-rw-r--r--gRPC-Core.podspec6
-rw-r--r--grpc.gemspec4
-rw-r--r--grpc.gyp6
-rw-r--r--package.xml4
-rw-r--r--src/core/lib/channel/client_authority_filter.cc18
-rw-r--r--src/core/lib/surface/init.cc7
-rw-r--r--src/core/lib/surface/init_secure.cc4
-rw-r--r--src/core/plugin_registry/grpc_plugin_registry.cc4
-rw-r--r--src/core/plugin_registry/grpc_unsecure_plugin_registry.cc4
-rw-r--r--src/python/grpcio/grpc_core_dependencies.py2
-rw-r--r--tools/doxygen/Doxyfile.c++.internal1
-rw-r--r--tools/run_tests/generated/sources_and_headers.json23
18 files changed, 89 insertions, 37 deletions
diff --git a/BUILD b/BUILD
index 49f45f8218..75aebb2462 100644
--- a/BUILD
+++ b/BUILD
@@ -966,6 +966,7 @@ grpc_cc_library(
# standard plugins
"census",
"grpc_deadline_filter",
+ "grpc_client_authority_filter",
"grpc_lb_policy_pick_first",
"grpc_lb_policy_round_robin",
"grpc_server_load_reporting",
@@ -1036,6 +1037,7 @@ grpc_cc_library(
deps = [
"gpr_base",
"grpc_base",
+ "grpc_client_authority_filter",
"grpc_deadline_filter",
"inlined_vector",
"orphanable",
@@ -1073,6 +1075,20 @@ grpc_cc_library(
)
grpc_cc_library(
+ name = "grpc_client_authority_filter",
+ srcs = [
+ "src/core/lib/channel/client_authority_filter.cc",
+ ],
+ hdrs = [
+ "src/core/lib/channel/client_authority_filter.h",
+ ],
+ language = "c++",
+ deps = [
+ "grpc_base",
+ ],
+)
+
+grpc_cc_library(
name = "grpc_message_size_filter",
srcs = [
"src/core/ext/filters/message_size/message_size_filter.cc",
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3e84c7751..1657f1ae7e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -855,7 +855,6 @@ add_library(grpc
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
- src/core/lib/channel/client_authority_filter.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
src/core/lib/channel/handshaker_factory.cc
@@ -1133,6 +1132,7 @@ add_library(grpc
src/core/ext/census/grpc_context.cc
src/core/ext/filters/max_age/max_age_filter.cc
src/core/ext/filters/message_size/message_size_filter.cc
+ src/core/lib/channel/client_authority_filter.cc
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
src/core/ext/filters/workarounds/workaround_utils.cc
src/core/plugin_registry/grpc_plugin_registry.cc
@@ -1231,7 +1231,6 @@ add_library(grpc_cronet
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
- src/core/lib/channel/client_authority_filter.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
src/core/lib/channel/handshaker_factory.cc
@@ -1598,7 +1597,6 @@ add_library(grpc_test_util
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
- src/core/lib/channel/client_authority_filter.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
src/core/lib/channel/handshaker_factory.cc
@@ -1888,7 +1886,6 @@ add_library(grpc_test_util_unsecure
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
- src/core/lib/channel/client_authority_filter.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
src/core/lib/channel/handshaker_factory.cc
@@ -2158,7 +2155,6 @@ add_library(grpc_unsecure
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
- src/core/lib/channel/client_authority_filter.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
src/core/lib/channel/handshaker_factory.cc
@@ -2371,6 +2367,7 @@ add_library(grpc_unsecure
src/core/ext/census/grpc_context.cc
src/core/ext/filters/max_age/max_age_filter.cc
src/core/ext/filters/message_size/message_size_filter.cc
+ src/core/lib/channel/client_authority_filter.cc
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
src/core/ext/filters/workarounds/workaround_utils.cc
src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
@@ -2962,7 +2959,6 @@ add_library(grpc++_cronet
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
- src/core/lib/channel/client_authority_filter.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
src/core/lib/channel/handshaker_factory.cc
diff --git a/build.yaml b/build.yaml
index eab2897706..20581ae00e 100644
--- a/build.yaml
+++ b/build.yaml
@@ -232,7 +232,6 @@ filegroups:
- src/core/lib/channel/channel_args.cc
- src/core/lib/channel/channel_stack.cc
- src/core/lib/channel/channel_stack_builder.cc
- - src/core/lib/channel/client_authority_filter.cc
- src/core/lib/channel/connected_channel.cc
- src/core/lib/channel/handshaker.cc
- src/core/lib/channel/handshaker_factory.cc
@@ -389,7 +388,6 @@ filegroups:
- src/core/lib/channel/channel_args.h
- src/core/lib/channel/channel_stack.h
- src/core/lib/channel/channel_stack_builder.h
- - src/core/lib/channel/client_authority_filter.h
- src/core/lib/channel/connected_channel.h
- src/core/lib/channel/context.h
- src/core/lib/channel/handshaker.h
@@ -517,6 +515,14 @@ filegroups:
uses:
- grpc_codegen
- grpc_trace_headers
+- name: grpc_client_authority_filter
+ headers:
+ - src/core/lib/channel/client_authority_filter.h
+ src:
+ - src/core/lib/channel/client_authority_filter.cc
+ plugin: grpc_client_authority_filter
+ uses:
+ - grpc_base
- name: grpc_client_channel
headers:
- src/core/ext/filters/client_channel/backup_poller.h
@@ -1354,6 +1360,7 @@ libs:
- grpc_max_age_filter
- grpc_message_size_filter
- grpc_deadline_filter
+ - grpc_client_authority_filter
- grpc_workaround_cronet_compression_filter
- grpc_server_backward_compatibility
generate_plugin_registry: true
@@ -1456,6 +1463,7 @@ libs:
- grpc_max_age_filter
- grpc_message_size_filter
- grpc_deadline_filter
+ - grpc_client_authority_filter
- grpc_workaround_cronet_compression_filter
- grpc_server_backward_compatibility
generate_plugin_registry: true
diff --git a/config.m4 b/config.m4
index 3b061e565e..9b48890d4c 100644
--- a/config.m4
+++ b/config.m4
@@ -84,7 +84,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
- src/core/lib/channel/client_authority_filter.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
src/core/lib/channel/handshaker_factory.cc \
@@ -362,6 +361,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/census/grpc_context.cc \
src/core/ext/filters/max_age/max_age_filter.cc \
src/core/ext/filters/message_size/message_size_filter.cc \
+ src/core/lib/channel/client_authority_filter.cc \
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
src/core/ext/filters/workarounds/workaround_utils.cc \
src/core/plugin_registry/grpc_plugin_registry.cc \
diff --git a/config.w32 b/config.w32
index 1b89419c57..b6b417e3de 100644
--- a/config.w32
+++ b/config.w32
@@ -61,7 +61,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\channel\\channel_args.cc " +
"src\\core\\lib\\channel\\channel_stack.cc " +
"src\\core\\lib\\channel\\channel_stack_builder.cc " +
- "src\\core\\lib\\channel\\client_authority_filter.cc " +
"src\\core\\lib\\channel\\connected_channel.cc " +
"src\\core\\lib\\channel\\handshaker.cc " +
"src\\core\\lib\\channel\\handshaker_factory.cc " +
@@ -339,6 +338,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\census\\grpc_context.cc " +
"src\\core\\ext\\filters\\max_age\\max_age_filter.cc " +
"src\\core\\ext\\filters\\message_size\\message_size_filter.cc " +
+ "src\\core\\lib\\channel\\client_authority_filter.cc " +
"src\\core\\ext\\filters\\workarounds\\workaround_cronet_compression_filter.cc " +
"src\\core\\ext\\filters\\workarounds\\workaround_utils.cc " +
"src\\core\\plugin_registry\\grpc_plugin_registry.cc " +
diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec
index 6334ac433d..5e8ae3f9a6 100644
--- a/gRPC-C++.podspec
+++ b/gRPC-C++.podspec
@@ -343,7 +343,6 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
- 'src/core/lib/channel/client_authority_filter.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
'src/core/lib/channel/handshaker.h',
@@ -480,6 +479,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/load_reporting/server_load_reporting_plugin.h',
'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h',
+ 'src/core/lib/channel/client_authority_filter.h',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
'src/core/ext/filters/workarounds/workaround_utils.h'
@@ -523,7 +523,6 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
- 'src/core/lib/channel/client_authority_filter.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
'src/core/lib/channel/handshaker.h',
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index 5827b397ff..242bc49bd3 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -354,7 +354,6 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
- 'src/core/lib/channel/client_authority_filter.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
'src/core/lib/channel/handshaker.h',
@@ -491,6 +490,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/load_reporting/server_load_reporting_plugin.h',
'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h',
+ 'src/core/lib/channel/client_authority_filter.h',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
'src/core/ext/filters/workarounds/workaround_utils.h',
'src/core/lib/surface/init.cc',
@@ -499,7 +499,6 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
- 'src/core/lib/channel/client_authority_filter.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
'src/core/lib/channel/handshaker_factory.cc',
@@ -774,6 +773,7 @@ Pod::Spec.new do |s|
'src/core/ext/census/grpc_context.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
+ 'src/core/lib/channel/client_authority_filter.cc',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
'src/core/ext/filters/workarounds/workaround_utils.cc',
'src/core/plugin_registry/grpc_plugin_registry.cc'
@@ -910,7 +910,6 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
- 'src/core/lib/channel/client_authority_filter.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
'src/core/lib/channel/handshaker.h',
@@ -1047,6 +1046,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/load_reporting/server_load_reporting_plugin.h',
'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h',
+ 'src/core/lib/channel/client_authority_filter.h',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
'src/core/ext/filters/workarounds/workaround_utils.h'
end
diff --git a/grpc.gemspec b/grpc.gemspec
index 06520c1f95..33ca745e69 100644
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -284,7 +284,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/channel/channel_args.h )
s.files += %w( src/core/lib/channel/channel_stack.h )
s.files += %w( src/core/lib/channel/channel_stack_builder.h )
- s.files += %w( src/core/lib/channel/client_authority_filter.h )
s.files += %w( src/core/lib/channel/connected_channel.h )
s.files += %w( src/core/lib/channel/context.h )
s.files += %w( src/core/lib/channel/handshaker.h )
@@ -421,6 +420,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/load_reporting/server_load_reporting_plugin.h )
s.files += %w( src/core/ext/filters/max_age/max_age_filter.h )
s.files += %w( src/core/ext/filters/message_size/message_size_filter.h )
+ s.files += %w( src/core/lib/channel/client_authority_filter.h )
s.files += %w( src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h )
s.files += %w( src/core/ext/filters/workarounds/workaround_utils.h )
s.files += %w( src/core/lib/surface/init.cc )
@@ -429,7 +429,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/channel/channel_args.cc )
s.files += %w( src/core/lib/channel/channel_stack.cc )
s.files += %w( src/core/lib/channel/channel_stack_builder.cc )
- s.files += %w( src/core/lib/channel/client_authority_filter.cc )
s.files += %w( src/core/lib/channel/connected_channel.cc )
s.files += %w( src/core/lib/channel/handshaker.cc )
s.files += %w( src/core/lib/channel/handshaker_factory.cc )
@@ -707,6 +706,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/census/grpc_context.cc )
s.files += %w( src/core/ext/filters/max_age/max_age_filter.cc )
s.files += %w( src/core/ext/filters/message_size/message_size_filter.cc )
+ s.files += %w( src/core/lib/channel/client_authority_filter.cc )
s.files += %w( src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc )
s.files += %w( src/core/ext/filters/workarounds/workaround_utils.cc )
s.files += %w( src/core/plugin_registry/grpc_plugin_registry.cc )
diff --git a/grpc.gyp b/grpc.gyp
index a398e4f460..04421bad57 100644
--- a/grpc.gyp
+++ b/grpc.gyp
@@ -236,7 +236,6 @@
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
- 'src/core/lib/channel/client_authority_filter.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
'src/core/lib/channel/handshaker_factory.cc',
@@ -514,6 +513,7 @@
'src/core/ext/census/grpc_context.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
+ 'src/core/lib/channel/client_authority_filter.cc',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
'src/core/ext/filters/workarounds/workaround_utils.cc',
'src/core/plugin_registry/grpc_plugin_registry.cc',
@@ -569,7 +569,6 @@
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
- 'src/core/lib/channel/client_authority_filter.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
'src/core/lib/channel/handshaker_factory.cc',
@@ -787,7 +786,6 @@
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
- 'src/core/lib/channel/client_authority_filter.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
'src/core/lib/channel/handshaker_factory.cc',
@@ -984,7 +982,6 @@
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
- 'src/core/lib/channel/client_authority_filter.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
'src/core/lib/channel/handshaker_factory.cc',
@@ -1197,6 +1194,7 @@
'src/core/ext/census/grpc_context.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
+ 'src/core/lib/channel/client_authority_filter.cc',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
'src/core/ext/filters/workarounds/workaround_utils.cc',
'src/core/plugin_registry/grpc_unsecure_plugin_registry.cc',
diff --git a/package.xml b/package.xml
index 0abcb89738..a8a3c4f356 100644
--- a/package.xml
+++ b/package.xml
@@ -291,7 +291,6 @@
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/channel/client_authority_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/connected_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/context.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker.h" role="src" />
@@ -428,6 +427,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/load_reporting/server_load_reporting_plugin.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/client_authority_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/init.cc" role="src" />
@@ -436,7 +436,6 @@
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/channel/client_authority_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/connected_channel.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.cc" role="src" />
@@ -714,6 +713,7 @@
<file baseinstalldir="/" name="src/core/ext/census/grpc_context.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/client_authority_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_utils.cc" role="src" />
<file baseinstalldir="/" name="src/core/plugin_registry/grpc_plugin_registry.cc" role="src" />
diff --git a/src/core/lib/channel/client_authority_filter.cc b/src/core/lib/channel/client_authority_filter.cc
index f684684be1..bf37f52e9c 100644
--- a/src/core/lib/channel/client_authority_filter.cc
+++ b/src/core/lib/channel/client_authority_filter.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include <assert.h>
+#include <limits.h>
#include <string.h>
#include <grpc/support/alloc.h>
@@ -115,3 +116,20 @@ const grpc_channel_filter grpc_client_authority_filter = {
destroy_channel_elem,
grpc_channel_next_get_info,
"authority"};
+
+static bool add_client_authority_filter(grpc_channel_stack_builder* builder,
+ void* arg) {
+ return grpc_channel_stack_builder_prepend_filter(
+ builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
+}
+
+void grpc_client_authority_filter_init(void) {
+ grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX,
+ add_client_authority_filter,
+ (void*)&grpc_client_authority_filter);
+ grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
+ add_client_authority_filter,
+ (void*)&grpc_client_authority_filter);
+}
+
+void grpc_client_authority_filter_shutdown(void) {}
diff --git a/src/core/lib/surface/init.cc b/src/core/lib/surface/init.cc
index 10c65ce09f..2d29c7d95f 100644
--- a/src/core/lib/surface/init.cc
+++ b/src/core/lib/surface/init.cc
@@ -84,13 +84,6 @@ static bool prepend_filter(grpc_channel_stack_builder* builder, void* arg) {
}
static void register_builtin_channel_init() {
- grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX,
- prepend_filter,
- (void*)(&grpc_client_authority_filter));
- grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
- prepend_filter,
- (void*)(&grpc_client_authority_filter));
-
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
grpc_add_connected_filter, nullptr);
diff --git a/src/core/lib/surface/init_secure.cc b/src/core/lib/surface/init_secure.cc
index 78e983e0cd..9700f43a55 100644
--- a/src/core/lib/surface/init_secure.cc
+++ b/src/core/lib/surface/init_secure.cc
@@ -67,9 +67,9 @@ static bool maybe_prepend_server_auth_filter(
}
void grpc_register_security_filters(void) {
- grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX,
+ grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX - 1,
maybe_prepend_client_auth_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
+ grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX - 1,
maybe_prepend_client_auth_filter, nullptr);
grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
maybe_prepend_server_auth_filter, nullptr);
diff --git a/src/core/plugin_registry/grpc_plugin_registry.cc b/src/core/plugin_registry/grpc_plugin_registry.cc
index 6f11e6bb5b..e371310fa1 100644
--- a/src/core/plugin_registry/grpc_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_plugin_registry.cc
@@ -52,6 +52,8 @@ void grpc_max_age_filter_init(void);
void grpc_max_age_filter_shutdown(void);
void grpc_message_size_filter_init(void);
void grpc_message_size_filter_shutdown(void);
+void grpc_client_authority_filter_init(void);
+void grpc_client_authority_filter_shutdown(void);
void grpc_workaround_cronet_compression_filter_init(void);
void grpc_workaround_cronet_compression_filter_shutdown(void);
@@ -88,6 +90,8 @@ void grpc_register_built_in_plugins(void) {
grpc_max_age_filter_shutdown);
grpc_register_plugin(grpc_message_size_filter_init,
grpc_message_size_filter_shutdown);
+ grpc_register_plugin(grpc_client_authority_filter_init,
+ grpc_client_authority_filter_shutdown);
grpc_register_plugin(grpc_workaround_cronet_compression_filter_init,
grpc_workaround_cronet_compression_filter_shutdown);
}
diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
index b08c5ce3ae..283db5b4f4 100644
--- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
@@ -50,6 +50,8 @@ void grpc_max_age_filter_init(void);
void grpc_max_age_filter_shutdown(void);
void grpc_message_size_filter_init(void);
void grpc_message_size_filter_shutdown(void);
+void grpc_client_authority_filter_init(void);
+void grpc_client_authority_filter_shutdown(void);
void grpc_workaround_cronet_compression_filter_init(void);
void grpc_workaround_cronet_compression_filter_shutdown(void);
@@ -84,6 +86,8 @@ void grpc_register_built_in_plugins(void) {
grpc_max_age_filter_shutdown);
grpc_register_plugin(grpc_message_size_filter_init,
grpc_message_size_filter_shutdown);
+ grpc_register_plugin(grpc_client_authority_filter_init,
+ grpc_client_authority_filter_shutdown);
grpc_register_plugin(grpc_workaround_cronet_compression_filter_init,
grpc_workaround_cronet_compression_filter_shutdown);
}
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index 7bd1adf8fe..bb426b070f 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -60,7 +60,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
- 'src/core/lib/channel/client_authority_filter.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
'src/core/lib/channel/handshaker_factory.cc',
@@ -338,6 +337,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/census/grpc_context.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
+ 'src/core/lib/channel/client_authority_filter.cc',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
'src/core/ext/filters/workarounds/workaround_utils.cc',
'src/core/plugin_registry/grpc_plugin_registry.cc',
diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal
index f1fb7d29fc..ff5abc679d 100644
--- a/tools/doxygen/Doxyfile.c++.internal
+++ b/tools/doxygen/Doxyfile.c++.internal
@@ -1007,7 +1007,6 @@ src/core/lib/backoff/backoff.h \
src/core/lib/channel/channel_args.h \
src/core/lib/channel/channel_stack.h \
src/core/lib/channel/channel_stack_builder.h \
-src/core/lib/channel/client_authority_filter.h \
src/core/lib/channel/connected_channel.h \
src/core/lib/channel/context.h \
src/core/lib/channel/handshaker.h \
diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json
index fa34d963aa..07edd14b04 100644
--- a/tools/run_tests/generated/sources_and_headers.json
+++ b/tools/run_tests/generated/sources_and_headers.json
@@ -6610,6 +6610,7 @@
"census",
"gpr",
"grpc_base",
+ "grpc_client_authority_filter",
"grpc_deadline_filter",
"grpc_lb_policy_grpclb_secure",
"grpc_lb_policy_pick_first",
@@ -6717,6 +6718,7 @@
"census",
"gpr",
"grpc_base",
+ "grpc_client_authority_filter",
"grpc_deadline_filter",
"grpc_lb_policy_grpclb",
"grpc_lb_policy_pick_first",
@@ -8988,7 +8990,6 @@
"src/core/lib/channel/channel_args.cc",
"src/core/lib/channel/channel_stack.cc",
"src/core/lib/channel/channel_stack_builder.cc",
- "src/core/lib/channel/client_authority_filter.cc",
"src/core/lib/channel/connected_channel.cc",
"src/core/lib/channel/handshaker.cc",
"src/core/lib/channel/handshaker_factory.cc",
@@ -9146,7 +9147,6 @@
"src/core/lib/channel/channel_args.h",
"src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h",
- "src/core/lib/channel/client_authority_filter.h",
"src/core/lib/channel/connected_channel.h",
"src/core/lib/channel/context.h",
"src/core/lib/channel/handshaker.h",
@@ -9291,7 +9291,6 @@
"src/core/lib/channel/channel_args.h",
"src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h",
- "src/core/lib/channel/client_authority_filter.h",
"src/core/lib/channel/connected_channel.h",
"src/core/lib/channel/context.h",
"src/core/lib/channel/handshaker.h",
@@ -9421,6 +9420,24 @@
{
"deps": [
"gpr",
+ "grpc_base"
+ ],
+ "headers": [
+ "src/core/lib/channel/client_authority_filter.h"
+ ],
+ "is_filegroup": true,
+ "language": "c",
+ "name": "grpc_client_authority_filter",
+ "src": [
+ "src/core/lib/channel/client_authority_filter.cc",
+ "src/core/lib/channel/client_authority_filter.h"
+ ],
+ "third_party": false,
+ "type": "filegroup"
+ },
+ {
+ "deps": [
+ "gpr",
"grpc_base",
"grpc_deadline_filter"
],