Skip to content

Multi-value header matching API #13751

Open

Description

@htuch

While the mechanics of plumbing multiple-valued headers to matchers have been taken care of by GHSA-2v25-cjjq-5f4w and its aftermath, we still do not have a particularly ergonomic way to match on multiple header values. We now have a canonicalized flat string of all header values, which requires gymnastics with regular expressions etc. to do a multi-value match.

Ideally we have a match interface that is capable of expressing first-class matchers that operate on a multimap, e.g. the ability to model multiple matchers and apply semantics to match such as "any of" or "all of".

Activity

  1. added
    enhancement
    triage
    api/v3
    help wanted
    and removed
    enhancement
    on Oct 25, 2020
  2. htuch commented on Oct 25, 2020

    @htuch
    MemberAuthor

    The work that @snowp is doing in #12968 is step in this direction, but does not cover all existing match sites yet.

  3. added and removed
    triage
    on Oct 26, 2020
  4. mattklein123 commented on Oct 27, 2020

    @mattklein123
    Member

    +1 to trying to cover this via the @snowp work.

  5. rialg commented on Nov 26, 2020

    @rialg
    Contributor

    Hi 👋 , do you still need help with this? I was looking at #13454 and got redirected to this issue. The idea would be to refactor the header matching operations without reintroducing the vulnerability found, is that correct?

  6. htuch commented on Nov 29, 2020

    @htuch
    MemberAuthor

    @grial1 I'd sync with @snowp on Slack on what might be possible, #12968 related work is the plan-of-record.

  7. yogeshkrbhat commented on Aug 26, 2023

    @yogeshkrbhat

    my header is as follows:
    curl --header "x-custom-route-svc:abcxyz:demo-service1.ns1.cluster.local" --header "x-custom-route-svc:mnop:demo-service2.ns2.cluster.local" URL

    Format - x-custom-route-svc:[token1:service1,token2:service2]

    And envoy route config:
    routes:
    - match:
    prefix: "/"
    headers:
    - name: "x-custom-route-svc"
    contains_match: "demo-service2.ns2.cluster.local"

    here the header "x-custom-route-svc" is a multi-value with different service names and user-token. Since user-token is varying in every request, I would like to do substring match as above.

    Unfortunately, contains_match does substring match with only first value.

    any suggestions for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api/v3area/httphelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions