matcher: add PathMatcher and use in routing, jwt and rbac (#10010)
Description: Add a new PathMatcher that strips the query and/or fragment string from the ":path" header before matching, use it in route, JWT and RBAC. Risk Level: Low Testing: Added unit tests and integration tests Docs Changes: Updated types.rst for PathMatcher Release Notes: Updated version_history.rst for RBAC API change Signed-off-by: Yangmin Zhu <ymzhu@google.com> Mirrored from https://github.com/envoyproxy/envoy @ 7ea52d5e2b0bccbd3263a805e38778fa132b715dmaster-ci-test
parent
2388a2e047
commit
c78b01efa3
4 changed files with 84 additions and 6 deletions
@ -0,0 +1,25 @@ |
|||||||
|
syntax = "proto3"; |
||||||
|
|
||||||
|
package envoy.type.matcher; |
||||||
|
|
||||||
|
import "envoy/type/matcher/string.proto"; |
||||||
|
|
||||||
|
import "validate/validate.proto"; |
||||||
|
|
||||||
|
option java_package = "io.envoyproxy.envoy.type.matcher"; |
||||||
|
option java_outer_classname = "PathProto"; |
||||||
|
option java_multiple_files = true; |
||||||
|
|
||||||
|
// [#protodoc-title: Path matcher] |
||||||
|
|
||||||
|
// Specifies the way to match a path on HTTP request. |
||||||
|
message PathMatcher { |
||||||
|
oneof rule { |
||||||
|
option (validate.required) = true; |
||||||
|
|
||||||
|
// The `path` must match the URL path portion of the :path header. The query and fragment |
||||||
|
// string (if present) are removed in the URL path portion. |
||||||
|
// For example, the path */data* will match the *:path* header */data#fragment?param=value*. |
||||||
|
StringMatcher path = 1 [(validate.rules).message = {required: true}]; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
syntax = "proto3"; |
||||||
|
|
||||||
|
package envoy.type.matcher.v3; |
||||||
|
|
||||||
|
import "envoy/type/matcher/v3/string.proto"; |
||||||
|
|
||||||
|
import "udpa/annotations/versioning.proto"; |
||||||
|
|
||||||
|
import "validate/validate.proto"; |
||||||
|
|
||||||
|
option java_package = "io.envoyproxy.envoy.type.matcher.v3"; |
||||||
|
option java_outer_classname = "PathProto"; |
||||||
|
option java_multiple_files = true; |
||||||
|
|
||||||
|
// [#protodoc-title: Path matcher] |
||||||
|
|
||||||
|
// Specifies the way to match a path on HTTP request. |
||||||
|
message PathMatcher { |
||||||
|
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.PathMatcher"; |
||||||
|
|
||||||
|
oneof rule { |
||||||
|
option (validate.required) = true; |
||||||
|
|
||||||
|
// The `path` must match the URL path portion of the :path header. The query and fragment |
||||||
|
// string (if present) are removed in the URL path portion. |
||||||
|
// For example, the path */data* will match the *:path* header */data#fragment?param=value*. |
||||||
|
StringMatcher path = 1 [(validate.rules).message = {required: true}]; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue