envoy
envoy copied to clipboard
matcher: add implementation for ServerNameMatcher
Description
This PR adds a trie-based implementation for ServerNameMatcher [Link].
Example Config:
matcher_tree:
input:
name: input
typed_config:
"@type": type.googleapis.com/google.protobuf.StringValue
custom_match:
name: domain_matcher
typed_config:
"@type": type.googleapis.com/xds.type.matcher.v3.ServerNameMatcher
domain_matchers:
- domains:
- "api.example.com"
on_match:
action:
name: test_action
typed_config:
"@type": type.googleapis.com/google.protobuf.StringValue
value: exact_match
- domains:
- "*.example.com"
on_match:
action:
name: test_action
typed_config:
"@type": type.googleapis.com/google.protobuf.StringValue
value: wildcard_match
- domains:
- "*.com"
on_match:
action:
name: test_action
typed_config:
"@type": type.googleapis.com/google.protobuf.StringValue
value: global_wildcard
Commit Message: matcher: add implementation for ServerNameMatcher
Additional Description: This PR adds a trie-based implementation for ServerNameMatcher for both Network & HTTP.
Risk Level: Low
Testing: Unit Tests
Docs Changes: Added
Release Notes: Added
As a reminder, PRs marked as draft will not be automatically assigned reviewers, or be handled by maintainer-oncall triage.
Please mark your PR as ready when you want it to be reviewed!
/wait Let me know if it's ready for another review.
/wait Let me know if it's ready for another review.
@kyessenov Yes, I followed the IPMatcher and updated the code. Please do another pass and see if this looks good to you.
Can you merge main, please, while I review? /wait