Closed
Description
In order to support concurrent usage of mirrord on the same service in e.g. a staging cluster, we need to let users filter requests routed to them by header.
For example, when running mirrord-layer with FILTER_INCLUDE="mirrord-user: eyal", only requests with the specified header would be routed by the agent to the layer. Extrapolate to FILTER_EXCLUDE.
Architecture here.
Subtasks:
- Change existing stealer to be global per agent, rather than multiple stealers per agent (one per subscribed layer)
- Develop the Filter component - this component will know to receive raw HTTP traffic and a collection of filters, and determine whether the traffic answers one or more of the filter conditions. If it answers more than one filter conditions, just use the first one.
- Change the Stealer component to use the Filter component.
- Implement subscription with filters by configuration in the layer.