Both the Endpoint Picker (EPP) and the Body Based Router (BBR) are Envoy ExtProc filters. There is much code that has been copy and pasted from one to the other.
The code that receives the gRPC messages, populates IGW structs, accumulates the body, and generates Envoy gRPC response messages is fairly silmilar between the EPP and the BBR. There is also shared per request state between these two implementations.
The goal of this issue is to refactor as much as possible of the ext proc code into a common set of packages that can be used by both the EPP and the BBR.
As there is EPP only and BBR only processing and state involved in this, the common Ext Proc server will have a handler factory interface, which will be called to create handler instances for incoming requests as appropriate. The handler instances maintain any EPP/BBR specific state. The handler factory is an interface to enable it to inject into the handler it creates EPP/BBR related data.
Both the Endpoint Picker (EPP) and the Body Based Router (BBR) are Envoy ExtProc filters. There is much code that has been copy and pasted from one to the other.
The code that receives the gRPC messages, populates IGW structs, accumulates the body, and generates Envoy gRPC response messages is fairly silmilar between the EPP and the BBR. There is also shared per request state between these two implementations.
The goal of this issue is to refactor as much as possible of the ext proc code into a common set of packages that can be used by both the EPP and the BBR.
As there is EPP only and BBR only processing and state involved in this, the common Ext Proc server will have a handler factory interface, which will be called to create handler instances for incoming requests as appropriate. The handler instances maintain any EPP/BBR specific state. The handler factory is an interface to enable it to inject into the handler it creates EPP/BBR related data.