mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
demo: add default route matcher to enable ssh filter even if no routes
are present.
This commit is contained in:
parent
8fee7e9930
commit
ffc97e6372
1 changed files with 35 additions and 1 deletions
|
@ -183,6 +183,40 @@ func (b *Builder) buildRouteConfig(_ context.Context, cfg *config.Config) (*envo
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
defaultRejectAll := &xds_matcher_v3.Matcher_MatcherList_FieldMatcher{
|
||||||
|
Predicate: &xds_matcher_v3.Matcher_MatcherList_Predicate{
|
||||||
|
MatchType: &xds_matcher_v3.Matcher_MatcherList_Predicate_SinglePredicate_{
|
||||||
|
SinglePredicate: &xds_matcher_v3.Matcher_MatcherList_Predicate_SinglePredicate{
|
||||||
|
Input: &xds_core_v3.TypedExtensionConfig{
|
||||||
|
Name: "request",
|
||||||
|
TypedConfig: marshalAny(&envoy_generic_proxy_matcher_v3.RequestMatchInput{}),
|
||||||
|
},
|
||||||
|
Matcher: &xds_matcher_v3.Matcher_MatcherList_Predicate_SinglePredicate_CustomMatch{
|
||||||
|
CustomMatch: &xds_core_v3.TypedExtensionConfig{
|
||||||
|
Name: "request",
|
||||||
|
TypedConfig: marshalAny(&envoy_generic_proxy_matcher_v3.RequestMatcher{
|
||||||
|
Host: &matcherv3.StringMatcher{
|
||||||
|
MatchPattern: &matcherv3.StringMatcher_Exact{Exact: ""},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
OnMatch: &xds_matcher_v3.Matcher_OnMatch{
|
||||||
|
OnMatch: &xds_matcher_v3.Matcher_OnMatch_Action{
|
||||||
|
Action: &xds_core_v3.TypedExtensionConfig{
|
||||||
|
Name: "route",
|
||||||
|
TypedConfig: marshalAny(&envoy_generic_proxy_action_v3.RouteAction{
|
||||||
|
ClusterSpecifier: &envoy_generic_proxy_action_v3.RouteAction_Cluster{
|
||||||
|
Cluster: "nonexistent",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
return &envoy_generic_proxy_v3.RouteConfiguration{
|
return &envoy_generic_proxy_v3.RouteConfiguration{
|
||||||
Name: "route_config",
|
Name: "route_config",
|
||||||
VirtualHosts: []*envoy_generic_proxy_v3.VirtualHost{
|
VirtualHosts: []*envoy_generic_proxy_v3.VirtualHost{
|
||||||
|
@ -192,7 +226,7 @@ func (b *Builder) buildRouteConfig(_ context.Context, cfg *config.Config) (*envo
|
||||||
Routes: &xds_matcher_v3.Matcher{
|
Routes: &xds_matcher_v3.Matcher{
|
||||||
MatcherType: &xds_matcher_v3.Matcher_MatcherList_{
|
MatcherType: &xds_matcher_v3.Matcher_MatcherList_{
|
||||||
MatcherList: &xds_matcher_v3.Matcher_MatcherList{
|
MatcherList: &xds_matcher_v3.Matcher_MatcherList{
|
||||||
Matchers: routeMatchers,
|
Matchers: append(routeMatchers, defaultRejectAll),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue