Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since @eguzki was very much against the idea of splitting the responsibility of sending the message from the actual
Action
underneath all of the layers in between, I came up with something that I thing would let you do that, while composing the state rather than folding it all together in a ball of mud.proposal_context::Filter
only responsibility is to hold on to the state relative to each phase of the request being handled:on_http_request_headers
: where a possible start of a "flow" happens, otherwiseStatus::Continue
;on_grpc_call_response
: where anOperation
is pending a response from a (single here, but it could expose the token associated with all of the) request(s) it's made;on_http_response_headers
: where possible additional headers added by some service need to be addedMost of the coordination now happens in
handle_operation
which will either associate theOperation
with the proper field, or let the requestdie
, i.e. deny it..."
FallibleOperation
s", tho not an explicit type, do expose a.fail() -> Operation
method. So to handle a GrpcMessage sending failure for instance.Code in the
no_implicit_dep
module, take an explicit&mut T: HttpContext
in, which in production would be theFilter
itself, while in testing can be a mock of it, so no implicit dependency, mostly funtion calls, to the proxy wasm sdk exists. They are all explicit... Coupling to the proxy wasm API remains, but not to the "runtime".This comes with the downside there is now a ever so thin dependency on the proxy wasm sdk types in our implementation. It also will need to be passed along all the way down thru
Core
layers to the individualAuth_Module
&RateLimiting_Module
from @eguzki 's design, but still makes this all cleaner than what we have today...Anyways, throwing this out there... This is very obviously not to be merged ever. At best, if someone thinks this can be a useful basis for further improvement, possibly this single commit could be reused. But I was mostly trying to highlight different options...