Description
Describe the feature
Hey I want to create middleware or filter pipeline for lambda function
There is note about middleware in design doc but no information when it will happen
There are old PR without CR like this and idk if I should contribute
Use Case
global error handling, extracting standard headers like trace-id
Proposed Solution
I have workaround with more generated code and castle.core for intercepting calls
For class FunctionHandler I can generate IFunctionHandler and FunctionHandlerWrapper.
Next I can call FunctionHandler from FunctionHandlerWrapper.
Also need to register FunctionHandler as TryAddSingleton<IFunctionHandler, FunctionHandler> so it is interceptable.
Maybe before full middleware pipeline implementation can we add option to generate IFunctionHandler by the annotation framework and resolve it from DI by interface in generated code?
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
AWS .NET SDK and/or Package version used
Amazon.Lambda.Annotations --version 1.2.0
Targeted .NET Platform
.NET 6
Operating System and version
AmazonLinux