Closed mmatczuk closed 6 months ago
I'm afraid, this does not fully fix #498 as it still reports denied requests as errors in metrics.
forwarder_proxy_errors_total{reason="denied"} 1
Let's open another one or do not resolve it here.
While trying new via loop detection mechanism, I found #688.
This PR did not introduce this. It exists in the old approach as well.
This patchset is a significant refactoring of the martian core. It's a continuation of work initiated in #444.
The
RequestModifier
andResponseModifier
errors are handled and appropriate error response is generated based onErrorResponse()
. Subsequently the connection hijacking functionality is removed.Proxy connection
proxyConn
is introduced, and proxy code is restructured to more files focused around specific topics. TheproxyConn
andproxyHandler
have similar structure for easier navigation and compatibility. The Proxy remains for configuration and generic shared items. This has been done in #673 but we expand on it here.A
TraceID
is added and it takes the responsibility of request ID generation and duration tracking. The custom Context and Session structs are removed resulting in streamlined function interfaces. TraceID is attached to request context on creation.Logging is streamlined, single responsibility principle is applied allowing for logger stacking. Each logger has its domain.
Fixes #525 Fixes #523 Fixes #497 Fixes #498