envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
25.07k stars 4.82k forks source link

matcher: add implementation for ServerNameMatcher #37271

Open agrawroh opened 1 day ago

agrawroh commented 1 day ago

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

repokitteh-read-only[bot] commented 1 day ago

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!

:cat: Caused by: https://github.com/envoyproxy/envoy/pull/37271 was opened by agrawroh. see: [more](https://github.com/envoyproxy/envoy/pull/37271), [trace](https://prod.repokitteh.app/traces/ui/envoyproxy/envoy/b865cfe0-a77f-11ef-8eef-6545829e3c85).