networking: add pathTemplate match type to StringMatch#3675
networking: add pathTemplate match type to StringMatch#3675AntonioMorales97 wants to merge 1 commit intoistio:masterfrom
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>
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.