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

Matching an element in a list #37

Open
kyessenov opened this issue May 26, 2022 · 1 comment
Open

Matching an element in a list #37

kyessenov opened this issue May 26, 2022 · 1 comment

Comments

@kyessenov
Copy link
Contributor

kyessenov commented May 26, 2022

There are several use cases in Envoy when we need to iterate over a list of items and match each item individually:

  • selecting the first ALPN for which a nested filter chain matcher accepts;
  • matching an item in DNS SAN list in a TLS cert;
  • matching an IP value in XFF header.

Ideally, we want to support all existing matchers for these use cases, instead of adapting all matchers to expect a list.

How should we define this in xds?

Option 1: Add a common input that takes another input and produces an iterator of data items. This requires some changes in the implementations to return an iterator for data inputs.
Option 2: Add a custom matcher that takes another matcher as input. The nested matcher can be any of string, custom input, prefix map, exact map, or custom sub-linear matcher. The custom matcher parses the input and then attempts to match elements one by one.

Ref: envoyproxy/envoy#20666

@kyessenov
Copy link
Contributor Author

Forgot to also mention:
Option 3: Add boolean flags to relevant inputs instructing to output a list of items instead of a concatenated string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant