pomerium/config/envoyconfig/matchers.go
2025-04-01 08:36:00 -06:00

23 lines
765 B
Go

package envoyconfig
import envoy_type_matcher_v3 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"
func buildLocalReplyTypeMatcher(localReplyType string) *envoy_type_matcher_v3.MetadataMatcher {
return &envoy_type_matcher_v3.MetadataMatcher{
Filter: "envoy.filters.http.lua",
Path: []*envoy_type_matcher_v3.MetadataMatcher_PathSegment{{
Segment: &envoy_type_matcher_v3.MetadataMatcher_PathSegment_Key{
Key: "pomerium_local_reply_type",
},
}},
Value: &envoy_type_matcher_v3.ValueMatcher{
MatchPattern: &envoy_type_matcher_v3.ValueMatcher_StringMatch{
StringMatch: &envoy_type_matcher_v3.StringMatcher{
MatchPattern: &envoy_type_matcher_v3.StringMatcher_Exact{
Exact: localReplyType,
},
},
},
},
}
}