-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor entire filter flow #161
Open
adam-cattermole
wants to merge
21
commits into
main
Choose a base branch
from
proposal-refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Adam Cattermole <[email protected]> Signed-off-by: Alex Snaps <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
adam-cattermole
force-pushed
the
proposal-refactor
branch
from
January 16, 2025 13:55
fb8ac40
to
1698f79
Compare
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Digest generates a Vec of operations we iterate over Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
Signed-off-by: Adam Cattermole <[email protected]>
adam-cattermole
force-pushed
the
proposal-refactor
branch
from
January 16, 2025 15:48
76c7e59
to
8a76515
Compare
Signed-off-by: Adam Cattermole <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
In this PR I've refactored the existing approach which had become somewhat unwieldy. I have tried to clean up the commits here, but it's worth noting this was an iterative process, and so some of the changes in the initial commits are changed/reverted in subsequent ones.
The main principle is as follows - I have aimed to reduce the leaking of the wasm/envoy hostcalls across every layer and instead delegate this to the filter. The filter has knowledge of the different 'phases' (
on_http_request.. on_grpc_call_response..
), and simply just performsOperations
based on it's current state and what it is being asked to do. The configuration itself remains unchanged, and the concerns of building and consuming of the specialised message types is delegated to the owner (auth_action/rl_action
). The filter has no knowledge of the individualactions
but instead uses theRuntimeActionSet
to initiate the flow, and from then on theOperations
to determine what to do next.Each of the operations tell the filter it must do something (that the layers below should not and do not know about):
SendGrpcRequest
: This informs the filter it needs to make a GRPC call and contains all of the the information it requires to make the request - the filter does not need to know which action/service this relates toAwaitGrpcResponse
: This tells the filter that there is nothing left to do within the current method and it must pause to await a GRPC responseAddHeaders
: This tells the filter it must add headers to the response in the required phaseDie
: This informs the filter that it is finished due to an error and must send a response before it finishes - this may not be an "error" due to a failure, but is also used for the case where we must return an error code to the caller (i.e. 401 Forbidden, 429 Too Many Requests..)Done
: This informs the filter that it has successfully finished operating and the request may be resumedThe specialised actions currently handle both the building of messages to the transfer type, and conversion to the message they expect. I have also made some decisions on how these actions return information to the layers above, based on the different operations the filter may have to perform.
Outstanding
There are several outstanding things to address (in follow up work):
set/get_property
calls, this would ideally be replaced with some kind of resolver layer with memoizationKuadrantFilter
,Operations
, andRuntimeActions
there was a need to retain the index of the current activeRuntimeAction
within someOperations
(to progress the flow). I would like to investigate eliminating this, potentially by building the chain ofOperations
up front (where each contains self + next). Another alternative might be implementing the iterator trait so we can just call.next()
to go through each