Skip to content
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

Support for range based header matching while routing requests #2418

Closed
kavyako opened this issue Jan 19, 2018 · 4 comments
Closed

Support for range based header matching while routing requests #2418

kavyako opened this issue Jan 19, 2018 · 4 comments
Labels
enhancement Feature requests. Not bugs or questions. help wanted Needs help!

Comments

@kavyako
Copy link
Contributor

kavyako commented Jan 19, 2018

We have a requirement to perform header match if the value of a header is within a given range.

Today, route match happens based on the header's value (exact string comparison or regex matching). Can we add range as a third option there?

Something like: In the route config, headers section, range is specified as the lowKey and highKey. A match will happen if the header's value in the incoming request lies within the range.

Some options to implement this:

  1. Range is specified in the route headers value field as a comma delimited string of the form "lowKey,highKey" and the range entry is true. 'range' is false by default. . Example below, if the incoming request contains a header PartitionKey:5, this route is matched.
{
"name": "PartitionKey",
"value": "1,10",
"regex": false,
"range": true
}
  1. Another option is to have value as a JSON object and add a valueType entry which can be set to default, regex or range. When 'valueType='regex|default value is a string.
{
"name": "PartitionKey",
"value": {"low":1,"high":10},
"valueType": "range",
"regex": false, // possibly deprecate in the future
}

This will be a breaking change though.

Would love to hear any other suggestions as well. If we have consensus on the approach, I can take a stab at adding this support.

@mattklein123 mattklein123 added enhancement Feature requests. Not bugs or questions. help wanted Needs help! labels Jan 19, 2018
@mattklein123
Copy link
Member

In general it would be great if we could make this a v2 only feature. That would involve Iterating on this proto: https://github.com/envoyproxy/data-plane-api/blob/master/api/rds.proto#L808. It's unfortunate we did not use oneof there (this has already been brought up). I would suggest that we actually do this now, and deprecate the existing value and regex field. (oneof will basically create the appropriate enum). cc @wora @htuch

For the feature itself, I would rather the range stuff be strongly typed integers in proto, and then it seems fine to me. If you want to do the data-plane-api PR we can discuss further there.

@kavyako
Copy link
Contributor Author

kavyako commented Jan 25, 2018

Actually we are still using the v1 APIs here so will want the range support in v1 too. I have the changes with oneof implemented for v2 APIs.
Now looking at updating the v1 config schema for this.
What is the general protocol while updating the v1 config? Are breaking changes allowed (i.e use oneof there as well) or shall I add new fields in the config json for the range low, high and isRange and make this an additive change?
Will start a PR once I have everything working with the tests.

@mattklein123
Copy link
Member

@kavyako breaking changes are not allowed, so if you need v1 support the change must be additive. Please also make sure you have both v1 and v2 docs when you do your data-plane-api change. Thank you!

@mattklein123
Copy link
Member

This is done.

Shikugawa pushed a commit to Shikugawa/envoy that referenced this issue Mar 28, 2020
…xy#2418)

* Create .wasm files for metadata exchange and stats plugins.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Apply buildifier.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Use new image, buildify.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Address comments.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Move base64 to separate file.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Update formatting.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Address comments.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Address comments.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Address comments.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Address comments.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Remove abseil container dependency.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Use build_wasm.sh in README.

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Add fix for .wasm file ownership.

Signed-off-by: John Plevyak <jplevyak@gmail.com>
jpsim pushed a commit that referenced this issue Nov 28, 2022
Description: This change is an attempt to fix images in the generated documentation. As it is now they do not work - [example](https://envoy-mobile.github.io/docs/envoy-mobile/latest/development/debugging/android_local.html). The issues seems to be caused by the fact that Sphinx puts all of the images in `_images` directory and Github Pages, backed by `jekyll`, ignores all directories whose names start with `_`. The idea is to use `sphinx.ext.githubpages` extension that puts `.nojekyll` file in the root of the generated sphinx artifacts which is supposed to fix the issue as reported in https://stackoverflow.com/a/64544659. Not a great way to test this e2e locally so may need to revert the change if it turns out that the issue persists.
Risk Level: Low, documentation changes
Testing: Generated sphinx's artifacts locally with and without the change. Confirmed that with the change I can see `.nojekyll` file being added to `generated/docs` directory.
Docs Changes:
Release Notes:

Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this issue Nov 28, 2022
Description: Revert envoyproxy/envoy-mobile#2418 as the change did not fix the issues with images not appearing in documentation. envoy-mobile/envoy-mobile.github.io#24 fixed the issues instead.
Risk Level: None.
Testing: N/A
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this issue Nov 29, 2022
Description: This change is an attempt to fix images in the generated documentation. As it is now they do not work - [example](https://envoy-mobile.github.io/docs/envoy-mobile/latest/development/debugging/android_local.html). The issues seems to be caused by the fact that Sphinx puts all of the images in `_images` directory and Github Pages, backed by `jekyll`, ignores all directories whose names start with `_`. The idea is to use `sphinx.ext.githubpages` extension that puts `.nojekyll` file in the root of the generated sphinx artifacts which is supposed to fix the issue as reported in https://stackoverflow.com/a/64544659. Not a great way to test this e2e locally so may need to revert the change if it turns out that the issue persists.
Risk Level: Low, documentation changes
Testing: Generated sphinx's artifacts locally with and without the change. Confirmed that with the change I can see `.nojekyll` file being added to `generated/docs` directory.
Docs Changes:
Release Notes:

Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this issue Nov 29, 2022
Description: Revert envoyproxy/envoy-mobile#2418 as the change did not fix the issues with images not appearing in documentation. envoy-mobile/envoy-mobile.github.io#24 fixed the issues instead.
Risk Level: None.
Testing: N/A
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests. Not bugs or questions. help wanted Needs help!
Projects
None yet
Development

No branches or pull requests

2 participants