-
Notifications
You must be signed in to change notification settings - Fork 4.9k
uri_template: Add support for the "*" character matching in pattern rewrite and matching #39169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uri_template: Add support for the "*" character matching in pattern rewrite and matching #39169
Conversation
Hi @barchw, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
f4ae9e2
to
f453fe9
Compare
5cfc62e
to
bf77bcd
Compare
"="; // user included "=" allowed | ||
"=*"; // restricted characters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @RyanTheOptimist as a reviewer of this exclusion of *
reserved character. do you have any context why it's the only char excluded?
Using the literal *
in a path seems really a bad practice to me however (e.g. google search doesn't support non encoded reserved chars, not limited to *), so i am not sure if we want to expand this direction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/wait-any
@@ -44,7 +44,7 @@ constexpr absl::string_view kLiteral = "a-zA-Z0-9-._~" // Unreserved | |||
"%" // pct-encoded | |||
"!$&'()+,;" // sub-delims excluding *= | |||
":@" | |||
"="; // user included "=" allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know why * was excluded as a match character. But for a change like this a runtime guard is required as a minimum, since it changes the existing behavior of the matcher.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @yanavlasov, thanks for looking into this, I have moved the feature behind a runtime guard.
…ewrite and matching Signed-off-by: Chwila <bartosz.chwila@sap.com>
Signed-off-by: Chwila <bartosz.chwila@sap.com>
Signed-off-by: Chwila <bartosz.chwila@sap.com>
412071e
to
8998e86
Compare
Signed-off-by: Chwila <bartosz.chwila@sap.com>
afee755
to
45fa9bc
Compare
Signed-off-by: Chwila <bartosz.chwila@sap.com>
45fa9bc
to
e3e313e
Compare
Signed-off-by: Chwila <bartosz.chwila@sap.com>
870e754
to
f6dd87f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo a small nit
@@ -46,6 +47,14 @@ constexpr absl::string_view kLiteral = "a-zA-Z0-9-._~" // Unreserved | |||
":@" | |||
"="; // user included "=" allowed | |||
|
|||
// Additional literal that allows "*" in the pattern. | |||
// Valid pchar from https://datatracker.ietf.org/doc/html/rfc3986#appendix-A | |||
constexpr absl::string_view kLiteralAsterisk = "a-zA-Z0-9-._~" // Unreserved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This should probably be "LiteralWithAsterisk". The current name makes it sound like it would be just a literal asterisk. (And perhaps add a comment about removing when we remove the runtime feature)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, adapted
9bb1efd
to
26f07e8
Compare
26f07e8
to
f4900c0
Compare
Signed-off-by: Chwila <bartosz.chwila@sap.com>
f4900c0
to
9716900
Compare
/backport |
…ewrite and matching (envoyproxy#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: envoyproxy#39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: envoyproxy#39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com>
…ewrite and matching (envoyproxy#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: envoyproxy#39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: envoyproxy#39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com> Signed-off-by: Yan Avlasov <yavlasov@google.com>
…ewrite and matching (envoyproxy#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: envoyproxy#39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: envoyproxy#39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com> Signed-off-by: Yan Avlasov <yavlasov@google.com>
…ewrite and matching (envoyproxy#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: envoyproxy#39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: envoyproxy#39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com> Signed-off-by: Yan Avlasov <yavlasov@google.com>
…ewrite and matching (envoyproxy#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: envoyproxy#39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: envoyproxy#39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com> Signed-off-by: Yan Avlasov <yavlasov@google.com>
…ewrite and matching (envoyproxy#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: envoyproxy#39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: envoyproxy#39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com> Signed-off-by: Yan Avlasov <yavlasov@google.com>
…ewrite and matching (#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: #39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: #39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com> Signed-off-by: Yan Avlasov <yavlasov@google.com>
…ewrite and matching (#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: #39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: #39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com> Signed-off-by: Yan Avlasov <yavlasov@google.com>
…ewrite and matching (#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: #39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: #39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com> Signed-off-by: Yan Avlasov <yavlasov@google.com>
…ewrite and matching (#39169) Adds support for matching requests that include the `*` character in the path. A relevant issue was created: #39168 Risk Level: Testing: Updated unit tests Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk Resolves: #39168 --------- Signed-off-by: Chwila <bartosz.chwila@sap.com> Signed-off-by: Yan Avlasov <yavlasov@google.com>
Commit Message: uri_template: Add support for the "*" character matching in pattern rewrite and matching
Additional Description:
Adds support for matching requests that include the
*
character in the path. A relevant issue was created: #39168Risk Level:
Testing: Updated unit tests
Docs Changes: N/A
Release Notes: Added
Platform Specific Features: N/A
Runtime guard: envoy.reloadable_features.uri_template_match_on_asterisk
Resolves: #39168