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
Builds on top of the
GrpcServiceHandler
added previously to configure these at the plugin configuration stage:Most of the fields in the
GrpcServiceHandler
had a lifetime that was for the duration of the wasm filter (the stuff read from configuration), but the lifetime of the header resolver is only for each http request. I've moved these fields out to a newGrpcService
.GrpcService
method
andname
currently come from a static variable, so I'm using&'static str
for these instead ofString
as I didn't want to create copies of these just to convert them back to references insend
GrpcService
currently also contains thefailure_mode
now instead of storing this config-wideUpdate Configuration
extensions
field has been added to thePluginConfiguration
that is defined as follows:GrpcServices
from the extensions deserialised in the initial step of theTryFrom
- for now I'm storing them as anRc<HashMap<String,Rc<GrpcService>>>
- theString
being the key of the extension that can be used to reference which service from the actions.Rc
for theHashMap
so that it can be re-used across all http requests as these are configured from the plugin config. However I also chose to have theGrpcServices
as anRc
so that the ref can be cloned to each of theGrpcServiceHandler
GrpcService
and using that as the service. Once we have an idea of how the actions will be defined we could retrieve the correct service for the action