networking: add pathTemplate match type to StringMatch#3675
networking: add pathTemplate match type to StringMatch#3675AntonioMorales97 wants to merge 1 commit into
Conversation
Add a new pathTemplate oneof variant to StringMatch to support URI
template path matching in VirtualService HTTPMatchRequest. This uses
{*} to match a single path segment and {**} to match one or more
segments, backed by Envoy's UriTemplateMatchConfig extension.
This is consistent with the existing path template support in
AuthorizationPolicy (issue #47306).
Closes #59533
Signed-off-by: Antonio <antoniomorales9711@gmail.com>
|
🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test? Courtesy of your friendly test nag. |
|
😊 Welcome @AntonioMorales97! This is either your first contribution to the Istio api repo, or it's been You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines Thanks for contributing! Courtesy of your friendly welcome wagon. |
|
|
|
Hi @AntonioMorales97. Thanks for your PR. I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Add support for the pathTemplate match type in VirtualService
HTTPMatchRequest.uri, using Envoy's URI template path matching
extension (UriTemplateMatchConfig). This is consistent with the
existing path template support in AuthorizationPolicy.
- Route conversion: StringMatch_PathTemplate maps to
RouteMatch_PathMatchPolicy with the uri_template_matcher extension,
reusing the existing PathTemplateMatcher() from the authz matcher
package for sanitization ({*}->*, {**}->**)
- Validation: pathTemplate is validated via CheckValidPathTemplate()
(same as AuthorizationPolicy) and is restricted to uri matches only
- Delegate conflict detection: pathTemplate is treated as incompatible
with delegate VirtualService composition
- Gateway API: getURIRank/getURILength updated to handle pathTemplate
Depends on istio/api#3675
Fixes istio#59533
Signed-off-by: Antonio <antoniomorales9711@gmail.com>
|
You might get more comments if you come to one of our weekly meeintgs https://github.com/istio/community/blob/master/WORKING-GROUPS.md#working-group-meetings |
@Stevenjin8 Hi! Is it possible to leave it as a point on the agenda of the meeting? 9:00 PST is 18:00 CEST so it's a bit hard for me to participate. The original issue is here (also linked in the PR description): istio/istio#59533 |
@AntonioMorales97 I'll present this on your behalf in next week's working group meeting! Added it to the agenda https://docs.google.com/document/d/1wsa06GGiq1LEGwhkiPP0FKIZJqdAiue-VeBonWAzAyk/edit?tab=t.0 |
|
Hey so sorry for the delay. I don't think this is something we want to do. Most core routing API evolutions are happening in gateway api, so it makes sense for something like this to become a standard there |
|
@AntonioMorales97 forgot to mention in my previous response: to get started with that process in Gateway API, open up an issue here or attend the community meeting to present the enhancement request |
|
Thanks @keithmattix, that direction makes sense. As the author of the original issue (istio/istio#59533), I've opened the enhancement in Gateway API here: kubernetes-sigs/gateway-api#5101. I can write the initial GEP draft and do the dataplane research; since I can't make the community meeting slot (CEST), I'm looking for a co-author or sponsor there to help carry it through. One ask while that runs: would you reconsider this PR as an interim addition until Gateway API reaches parity? The reasoning:
Glad to mark and document it as interim if that helps, and to remove or redirect once Gateway API ships the equivalent. @jaellio thank you for offering to present. I can't make the slot (CEST). Would you be able to represent this, and do you know anyone in the WG who'd be up for co-sponsoring the enhancement? I'll do the drafting and research behind it. |
Description
Add a new
pathTemplateoneof variant toStringMatchto support URI template path matching in VirtualServiceHTTPMatchRequest.uri.This allows matching patterns like
/users/{*}/orderswithout resorting to regex:{*}matches exactly one path segment{**}matches one or more path segments (must be the last operator)Backed by Envoy's
UriTemplateMatchConfigextension, the same mechanism already used forAuthorizationPolicypath matching.Motivation
AuthorizationPolicyalready supports{*}/{**}path templates (#47306);VirtualServiceshould tooRelated
{*}/{**}toAuthorizationPolicyThe implementation in
istio/istiois submitted as a dependent PR and will be linked once this merges.