32 #include "absl/base/thread_annotations.h"
33 #include "absl/container/inlined_vector.h"
34 #include "absl/status/status.h"
35 #include "absl/status/statusor.h"
36 #include "absl/strings/match.h"
37 #include "absl/strings/numbers.h"
38 #include "absl/strings/str_cat.h"
39 #include "absl/strings/str_join.h"
40 #include "absl/strings/str_replace.h"
41 #include "absl/strings/string_view.h"
42 #include "absl/types/optional.h"
43 #include "absl/types/variant.h"
98 TraceFlag grpc_xds_server_config_fetcher_trace(
false,
99 "xds_server_config_fetcher");
105 XdsServerConfigFetcher(RefCountedPtr<XdsClient> xds_client,
109 std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
121 class ListenerWatcher;
126 std::map<grpc_server_config_fetcher::WatcherInterface*, ListenerWatcher*>
140 class XdsServerConfigFetcher::ListenerWatcher
141 :
public XdsListenerResourceType::WatcherInterface {
143 ListenerWatcher(RefCountedPtr<XdsClient> xds_client,
144 std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
145 server_config_watcher,
149 void OnResourceChanged(XdsListenerResource listener)
override;
153 void OnResourceDoesNotExist()
override;
158 class FilterChainMatchManager;
166 void PendingFilterChainMatchManagerReady(
167 FilterChainMatchManager* filter_chain_match_manager) {
169 PendingFilterChainMatchManagerReadyLocked(filter_chain_match_manager);
171 void PendingFilterChainMatchManagerReadyLocked(
172 FilterChainMatchManager* filter_chain_match_manager)
176 const std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
183 RefCountedPtr<FilterChainMatchManager> pending_filter_chain_match_manager_
192 class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager
195 FilterChainMatchManager(RefCountedPtr<XdsClient> xds_client,
196 XdsListenerResource::FilterChainMap filter_chain_map,
198 default_filter_chain);
203 void Orphan()
override;
206 void StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher)
209 const XdsListenerResource::FilterChainMap& filter_chain_map()
const {
214 default_filter_chain()
const {
219 struct CertificateProviders {
223 RefCountedPtr<grpc_tls_certificate_provider>
root;
224 RefCountedPtr<grpc_tls_certificate_provider>
instance;
225 RefCountedPtr<XdsCertificateProvider>
xds;
228 class RouteConfigWatcher;
229 struct RdsUpdateState {
234 class XdsServerConfigSelector;
235 class StaticXdsServerConfigSelectorProvider;
236 class DynamicXdsServerConfigSelectorProvider;
239 CreateOrGetXdsCertificateProviderFromFilterChainData(
240 const XdsListenerResource::FilterChainData* filter_chain);
244 void OnRouteConfigChanged(
const std::string& resource_name,
245 XdsRouteConfigResource route_config);
247 void OnResourceDoesNotExist(
const std::string& resource_name);
259 std::map<const XdsListenerResource::FilterChainData*, CertificateProviders>
270 class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
271 RouteConfigWatcher :
public XdsRouteConfigResourceType::WatcherInterface {
275 WeakRefCountedPtr<FilterChainMatchManager> filter_chain_match_manager)
279 void OnResourceChanged(XdsRouteConfigResource route_config)
override {
288 void OnResourceDoesNotExist()
override {
301 class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
302 XdsServerConfigSelector :
public ServerConfigSelector {
306 const std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>&
308 ~XdsServerConfigSelector()
override =
default;
321 class RouteListIterator :
public XdsRouting::RouteListIterator {
323 explicit RouteListIterator(
const std::vector<Route>*
routes)
326 size_t Size()
const override {
return routes_->size(); }
328 const XdsRouteConfigResource::Route::Matchers& GetMatchersForRoute(
329 size_t index)
const override {
341 class VirtualHostListIterator :
public XdsRouting::VirtualHostListIterator {
343 explicit VirtualHostListIterator(
344 const std::vector<VirtualHost>* virtual_hosts)
349 const std::vector<std::string>& GetDomainsForVirtualHost(
350 size_t index)
const override {
363 class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
364 StaticXdsServerConfigSelectorProvider
365 :
public ServerConfigSelectorProvider {
367 StaticXdsServerConfigSelectorProvider(
369 std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
375 std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
386 void Orphan()
override {}
388 void CancelWatch()
override {
watcher_.reset(); }
392 std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
394 std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
400 class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
401 DynamicXdsServerConfigSelectorProvider
402 :
public ServerConfigSelectorProvider {
404 DynamicXdsServerConfigSelectorProvider(
405 RefCountedPtr<XdsClient> xds_client,
std::string resource_name,
407 std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
410 void Orphan()
override;
413 std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
415 void CancelWatch()
override;
418 class RouteConfigWatcher;
420 void OnRouteConfigChanged(XdsRouteConfigResource
rds_update);
422 void OnResourceDoesNotExist();
426 std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
430 std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
437 class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
438 DynamicXdsServerConfigSelectorProvider::RouteConfigWatcher
439 :
public XdsRouteConfigResourceType::WatcherInterface {
441 explicit RouteConfigWatcher(
442 WeakRefCountedPtr<DynamicXdsServerConfigSelectorProvider> parent)
445 void OnResourceChanged(XdsRouteConfigResource route_config)
override {
451 void OnResourceDoesNotExist()
override {
parent_->OnResourceDoesNotExist(); }
454 WeakRefCountedPtr<DynamicXdsServerConfigSelectorProvider>
parent_;
461 XdsServerConfigFetcher::XdsServerConfigFetcher(
462 RefCountedPtr<XdsClient> xds_client,
472 tmp = URI::PercentEncodePath(listening_address);
473 listening_address =
tmp;
476 {{
"%s", listening_address}});
479 void XdsServerConfigFetcher::StartWatch(
481 std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
watcher) {
483 auto listener_watcher = MakeRefCounted<ListenerWatcher>(
486 auto* listener_watcher_ptr = listener_watcher.get();
487 XdsListenerResourceType::StartWatch(
489 ListenerResourceName(
490 xds_client_->bootstrap().server_listener_resource_name_template(),
494 listener_watchers_.emplace(watcher_ptr, listener_watcher_ptr);
497 void XdsServerConfigFetcher::CancelWatch(
500 auto it = listener_watchers_.find(
watcher);
501 if (
it != listener_watchers_.end()) {
503 XdsListenerResourceType::CancelWatch(
505 ListenerResourceName(
506 xds_client_->bootstrap().server_listener_resource_name_template(),
507 it->second->listening_address()),
509 listener_watchers_.erase(
it);
517 XdsServerConfigFetcher::ListenerWatcher::ListenerWatcher(
518 RefCountedPtr<XdsClient> xds_client,
519 std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
520 server_config_watcher,
528 void XdsServerConfigFetcher::ListenerWatcher::OnResourceChanged(
529 XdsListenerResource listener) {
532 "[ListenerWatcher %p] Received LDS update from xds client %p: %s",
533 this,
xds_client_.get(), listener.ToString().c_str());
538 "Address in LDS update does not match listening address"));
541 auto new_filter_chain_match_manager = MakeRefCounted<FilterChainMatchManager>(
543 std::move(listener.default_filter_chain));
546 !(new_filter_chain_match_manager->filter_chain_map() ==
548 new_filter_chain_match_manager->default_filter_chain() ==
550 pending_filter_chain_match_manager_ =
551 std::move(new_filter_chain_match_manager);
553 pending_filter_chain_match_manager_->StartRdsWatch(
Ref());
555 PendingFilterChainMatchManagerReadyLocked(
556 pending_filter_chain_match_manager_.get());
564 pending_filter_chain_match_manager_ !=
nullptr) {
566 "ListenerWatcher:%p XdsClient reports error: %s for %s; "
567 "ignoring in favor of existing resource",
573 {GRPC_STATUS_UNAVAILABLE, status.ToString().c_str()});
576 "ListenerWatcher:%p error obtaining xDS Listener resource: %s; "
583 void XdsServerConfigFetcher::ListenerWatcher::OnFatalError(
585 pending_filter_chain_match_manager_.reset();
595 {static_cast<grpc_status_code>(status.raw_code()),
596 std::string(status.message()).c_str()});
599 "ListenerWatcher:%p Encountered fatal error %s; not serving on %s",
604 void XdsServerConfigFetcher::ListenerWatcher::OnResourceDoesNotExist() {
609 void XdsServerConfigFetcher::ListenerWatcher::
610 PendingFilterChainMatchManagerReadyLocked(
611 XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager*
612 filter_chain_match_manager) {
613 if (pending_filter_chain_match_manager_ != filter_chain_match_manager) {
623 {GRPC_STATUS_OK,
""});
626 "xDS Listener resource obtained; will start serving on %s",
643 XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
644 FilterChainMatchManager(
645 RefCountedPtr<XdsClient> xds_client,
646 XdsListenerResource::FilterChainMap filter_chain_map,
648 default_filter_chain)
653 void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
654 StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher) {
658 std::set<std::string> resource_names;
659 std::set<XdsListenerResource::FilterChainData*> filter_chain_data_set;
661 for (
const auto& source_type : destination_ip.source_types_array) {
662 for (
const auto& source_ip : source_type) {
663 for (
const auto& source_port_pair : source_ip.ports_map) {
664 if (!source_port_pair.second.data->http_connection_manager
665 .route_config_name.empty()) {
666 resource_names.insert(
667 source_port_pair.second.data->http_connection_manager
670 filter_chain_data_set.insert(source_port_pair.second.data.get());
678 resource_names.insert(
686 for (
auto* filter_chain_data : filter_chain_data_set) {
688 filter_chain_data->http_connection_manager.http_filters.begin(),
689 filter_chain_data->http_connection_manager.http_filters.end());
692 struct WatcherToStart {
694 RefCountedPtr<RouteConfigWatcher>
watcher;
696 std::vector<WatcherToStart> watchers_to_start;
697 watchers_to_start.reserve(resource_names.size());
700 for (
const auto& resource_name : resource_names) {
701 ++rds_resources_yet_to_fetch_;
702 auto route_config_watcher =
703 MakeRefCounted<RouteConfigWatcher>(resource_name, WeakRef());
704 rds_map_.emplace(resource_name, RdsUpdateState{route_config_watcher.get(),
706 watchers_to_start.push_back(
707 WatcherToStart{resource_name,
std::move(route_config_watcher)});
709 if (rds_resources_yet_to_fetch_ != 0) {
711 listener_watcher =
nullptr;
714 for (
auto& watcher_to_start : watchers_to_start) {
715 XdsRouteConfigResourceType::StartWatch(
xds_client_.get(),
716 watcher_to_start.resource_name,
721 if (listener_watcher !=
nullptr) {
722 listener_watcher->PendingFilterChainMatchManagerReadyLocked(
this);
726 void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
730 for (
const auto& entry : rds_map_) {
731 XdsRouteConfigResourceType::CancelWatch(
xds_client_.get(), entry.first,
732 entry.second.watcher,
740 XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
741 CreateOrGetXdsCertificateProviderFromFilterChainData(
742 const XdsListenerResource::FilterChainData* filter_chain) {
744 auto it = certificate_providers_map_.find(filter_chain);
745 if (
it != certificate_providers_map_.end()) {
746 return it->second.xds;
748 CertificateProviders certificate_providers;
751 filter_chain->downstream_tls_context.common_tls_context
752 .certificate_validation_context.ca_certificate_provider_instance
755 filter_chain->downstream_tls_context.common_tls_context
756 .certificate_validation_context.ca_certificate_provider_instance
758 if (!root_provider_instance_name.
empty()) {
759 certificate_providers.root =
761 .CreateOrGetCertificateProvider(root_provider_instance_name);
762 if (certificate_providers.root ==
nullptr) {
765 root_provider_instance_name,
"\" not recognized."));
770 filter_chain->downstream_tls_context.common_tls_context
771 .tls_certificate_provider_instance.instance_name;
773 filter_chain->downstream_tls_context.common_tls_context
774 .tls_certificate_provider_instance.certificate_name;
775 if (!identity_provider_instance_name.
empty()) {
776 certificate_providers.instance =
778 .CreateOrGetCertificateProvider(identity_provider_instance_name);
779 if (certificate_providers.instance ==
nullptr) {
782 identity_provider_instance_name,
"\" not recognized."));
785 certificate_providers.xds = MakeRefCounted<XdsCertificateProvider>();
786 certificate_providers.xds->UpdateRootCertNameAndDistributor(
787 "", root_provider_cert_name,
788 certificate_providers.root ==
nullptr
790 : certificate_providers.root->distributor());
791 certificate_providers.xds->UpdateIdentityCertNameAndDistributor(
792 "", identity_provider_cert_name,
793 certificate_providers.instance ==
nullptr
795 : certificate_providers.instance->distributor());
796 certificate_providers.xds->UpdateRequireClientCertificate(
797 "", filter_chain->downstream_tls_context.require_client_certificate);
798 auto xds_certificate_provider = certificate_providers.xds;
799 certificate_providers_map_.emplace(filter_chain,
801 return xds_certificate_provider;
804 void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
805 OnRouteConfigChanged(
const std::string& resource_name,
806 XdsRouteConfigResource route_config) {
807 RefCountedPtr<ListenerWatcher> listener_watcher;
810 auto&
state = rds_map_[resource_name];
811 if (!
state.rds_update.has_value()) {
812 if (--rds_resources_yet_to_fetch_ == 0) {
820 if (listener_watcher !=
nullptr) {
821 listener_watcher->PendingFilterChainMatchManagerReady(
this);
827 RefCountedPtr<ListenerWatcher> listener_watcher;
830 auto&
state = rds_map_[resource_name];
831 if (!
state.rds_update.has_value()) {
832 if (--rds_resources_yet_to_fetch_ == 0) {
838 if (!
state.rds_update->ok()) {
845 if (listener_watcher !=
nullptr) {
846 listener_watcher->PendingFilterChainMatchManagerReady(
this);
850 void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
851 OnResourceDoesNotExist(
const std::string& resource_name) {
852 RefCountedPtr<ListenerWatcher> listener_watcher;
855 auto&
state = rds_map_[resource_name];
856 if (!
state.rds_update.has_value()) {
857 if (--rds_resources_yet_to_fetch_ == 0) {
866 if (listener_watcher !=
nullptr) {
867 listener_watcher->PendingFilterChainMatchManagerReady(
this);
871 const XdsListenerResource::FilterChainData* FindFilterChainDataForSourcePort(
872 const XdsListenerResource::FilterChainMap::SourcePortsMap& source_ports_map,
876 auto it = source_ports_map.find(
port);
877 if (
it != source_ports_map.end()) {
878 return it->second.data.get();
881 it = source_ports_map.find(0);
882 if (
it != source_ports_map.end()) {
883 return it->second.data.get();
888 const XdsListenerResource::FilterChainData* FindFilterChainDataForSourceIp(
889 const XdsListenerResource::FilterChainMap::SourceIpVector& source_ip_vector,
891 const XdsListenerResource::FilterChainMap::SourceIp* best_match =
nullptr;
892 for (
const auto& entry : source_ip_vector) {
894 if (!entry.prefix_range.has_value()) {
895 if (best_match ==
nullptr) {
900 if (best_match !=
nullptr && best_match->prefix_range.has_value() &&
901 best_match->prefix_range->prefix_len >=
902 entry.prefix_range->prefix_len) {
906 entry.prefix_range->prefix_len)) {
910 if (best_match ==
nullptr)
return nullptr;
911 return FindFilterChainDataForSourcePort(best_match->ports_map,
port);
915 const grpc_sockaddr* sock_addr =
916 reinterpret_cast<const grpc_sockaddr*
>(&address->
addr);
917 if (sock_addr->sa_family == GRPC_AF_INET) {
918 const grpc_sockaddr_in*
addr4 =
919 reinterpret_cast<const grpc_sockaddr_in*
>(sock_addr);
923 }
else if (sock_addr->sa_family == GRPC_AF_INET6) {
924 const grpc_sockaddr_in6*
addr6 =
925 reinterpret_cast<const grpc_sockaddr_in6*
>(sock_addr);
927 sizeof(in6addr_loopback)) == 0) {
934 const XdsListenerResource::FilterChainData* FindFilterChainDataForSourceType(
935 const XdsListenerResource::FilterChainMap::ConnectionSourceTypesArray&
939 if (!source_uri.ok() ||
940 (source_uri->scheme() !=
"ipv4" && source_uri->scheme() !=
"ipv6")) {
950 &source_addr, host.c_str(), 0 );
959 XdsListenerResource::FilterChainMap::
960 ConnectionSourceType::kSameIpOrLoopback)]
963 ConnectionSourceType::kExternal)]
965 return FindFilterChainDataForSourceIp(
967 XdsListenerResource::FilterChainMap::ConnectionSourceType::kAny)],
970 if (IsLoopbackIp(&source_addr) || host == destination_ip) {
971 return FindFilterChainDataForSourceIp(
973 XdsListenerResource::FilterChainMap::ConnectionSourceType::
977 return FindFilterChainDataForSourceIp(
979 XdsListenerResource::FilterChainMap::ConnectionSourceType::
985 const XdsListenerResource::FilterChainData* FindFilterChainDataForDestinationIp(
986 const XdsListenerResource::FilterChainMap::DestinationIpVector
987 destination_ip_vector,
990 if (!destination_uri.ok() || (destination_uri->scheme() !=
"ipv4" &&
991 destination_uri->scheme() !=
"ipv6")) {
1001 &destination_addr, host.c_str(), 0 );
1008 const XdsListenerResource::FilterChainMap::DestinationIp* best_match =
1010 for (
const auto& entry : destination_ip_vector) {
1012 if (!entry.prefix_range.has_value()) {
1013 if (best_match ==
nullptr) {
1014 best_match = &entry;
1018 if (best_match !=
nullptr && best_match->prefix_range.has_value() &&
1019 best_match->prefix_range->prefix_len >=
1020 entry.prefix_range->prefix_len) {
1024 &entry.prefix_range->address,
1025 entry.prefix_range->prefix_len)) {
1026 best_match = &entry;
1029 if (best_match ==
nullptr)
return nullptr;
1030 return FindFilterChainDataForSourceType(best_match->source_types_array,
tcp,
1035 FilterChainMatchManager::UpdateChannelArgsForConnection(
1037 const auto* filter_chain = FindFilterChainDataForDestinationIp(
1042 if (filter_chain ==
nullptr) {
1047 RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider;
1048 RefCountedPtr<XdsChannelStackModifier> channel_stack_modifier;
1049 RefCountedPtr<XdsCertificateProvider> xds_certificate_provider;
1052 std::vector<const grpc_channel_filter*> filters;
1055 for (
const auto& http_filter :
1056 filter_chain->http_connection_manager.http_filters) {
1059 const XdsHttpFilterImpl* filter_impl =
1060 XdsHttpFilterRegistry::GetFilterForType(
1061 http_filter.config.config_proto_type_name);
1065 if (filter_impl->channel_filter() !=
nullptr) {
1066 filters.push_back(filter_impl->channel_filter());
1070 channel_stack_modifier =
1071 MakeRefCounted<XdsChannelStackModifier>(
std::move(filters));
1072 if (filter_chain->http_connection_manager.rds_update.has_value()) {
1073 server_config_selector_provider =
1074 MakeRefCounted<StaticXdsServerConfigSelectorProvider>(
1075 filter_chain->http_connection_manager.rds_update.value(),
1076 filter_chain->http_connection_manager.http_filters);
1082 rds_map_[filter_chain->http_connection_manager.route_config_name]
1083 .rds_update.
value();
1085 server_config_selector_provider =
1086 MakeRefCounted<DynamicXdsServerConfigSelectorProvider>(
1088 filter_chain->http_connection_manager.route_config_name,
1090 filter_chain->http_connection_manager.http_filters);
1092 args_to_add.
emplace_back(server_config_selector_provider->MakeChannelArg());
1093 args_to_add.
emplace_back(channel_stack_modifier->MakeChannelArg());
1098 if (server_creds !=
nullptr &&
1101 CreateOrGetXdsCertificateProviderFromFilterChainData(filter_chain);
1107 GPR_ASSERT(xds_certificate_provider !=
nullptr);
1108 args_to_add.
emplace_back(xds_certificate_provider->MakeChannelArg());
1110 if (!args_to_add.
empty()) {
1114 args = updated_args;
1124 RefCountedPtr<XdsServerConfigFetcher::ListenerWatcher::
1125 FilterChainMatchManager::XdsServerConfigSelector>>
1126 XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1127 XdsServerConfigSelector::Create(
1130 XdsListenerResource::HttpConnectionManager::HttpFilter>&
1132 auto config_selector = MakeRefCounted<XdsServerConfigSelector>();
1133 for (
auto& vhost :
rds_update.virtual_hosts) {
1134 config_selector->virtual_hosts_.emplace_back();
1135 auto& virtual_host = config_selector->virtual_hosts_.back();
1136 virtual_host.domains =
std::move(vhost.domains);
1137 for (
auto&
route : vhost.routes) {
1138 virtual_host.routes.emplace_back();
1139 auto& config_selector_route = virtual_host.routes.back();
1141 config_selector_route.unsupported_action =
1142 absl::get_if<XdsRouteConfigResource::Route::NonForwardingAction>(
1143 &
route.action) ==
nullptr;
1144 XdsRouting::GeneratePerHttpFilterConfigsResult
result =
1145 XdsRouting::GeneratePerHTTPFilterConfigs(http_filters, vhost,
route,
1150 std::vector<std::string>
fields;
1152 for (
const auto&
p :
result.per_filter_configs) {
1160 " \"methodConfig\": [ {\n"
1169 config_selector_route.method_config =
1170 ServiceConfigImpl::Create(
result.args, json.c_str(), &
error);
1176 return config_selector;
1179 ServerConfigSelector::CallConfig XdsServerConfigFetcher::ListenerWatcher::
1180 FilterChainMatchManager::XdsServerConfigSelector::GetCallConfig(
1182 CallConfig call_config;
1183 if (
metadata->get_pointer(HttpPathMetadata()) ==
nullptr) {
1188 metadata->get_pointer(HttpPathMetadata())->as_string_view();
1189 if (
metadata->get_pointer(HttpAuthorityMetadata()) ==
nullptr) {
1195 metadata->get_pointer(HttpAuthorityMetadata())->as_string_view();
1196 auto vhost_index = XdsRouting::FindVirtualHostForDomain(
1198 if (!vhost_index.has_value()) {
1201 "could not find VirtualHost for ", authority,
1202 " in RouteConfiguration")),
1207 auto route_index = XdsRouting::GetRouteForRequest(
1208 VirtualHost::RouteListIterator(&virtual_host.routes),
path,
metadata);
1209 if (route_index.has_value()) {
1210 auto&
route = virtual_host.routes[route_index.value()];
1212 if (
route.unsupported_action) {
1215 "Matching route has unsupported action"),
1219 if (
route.method_config !=
nullptr) {
1220 call_config.method_configs =
1222 call_config.service_config =
route.method_config;
1236 XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1237 DynamicXdsServerConfigSelectorProvider::
1238 DynamicXdsServerConfigSelectorProvider(
1239 RefCountedPtr<XdsClient> xds_client,
std::string resource_name,
1241 std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
1251 auto route_config_watcher = MakeRefCounted<RouteConfigWatcher>(WeakRef());
1257 void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1258 DynamicXdsServerConfigSelectorProvider::Orphan() {
1265 XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1266 DynamicXdsServerConfigSelectorProvider::Watch(
1268 ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
1277 if (!resource.
ok()) {
1278 return resource.
status();
1283 void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1284 DynamicXdsServerConfigSelectorProvider::CancelWatch() {
1289 void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1290 DynamicXdsServerConfigSelectorProvider::OnRouteConfigChanged(
1301 watcher_->OnServerConfigSelectorUpdate(
1319 void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
1320 DynamicXdsServerConfigSelectorProvider::OnResourceDoesNotExist() {
1341 "grpc_server_config_fetcher_xds_create(notifier={on_serving_status_"
1342 "update=%p, user_data=%p}, args=%p)",
1358 "server_listener_resource_name_template not provided in bootstrap "
1362 return new grpc_core::XdsServerConfigFetcher(
std::move(xds_client), notifier);