Closed austencollins closed 7 years ago
IMHO for mentioned use cases, we need two different things: plugins & middlewares.
Plugins: something that extends the gateway on a low-level, giving access to internal structures, and many integration points. It's a low-level access that's why it's fast and might be used without heavily influencing overall perf (Tyler will kill me for that statement :D). Implementation options:
Serverless function that runs before some other function and has the ability to change parameters/context or result. Simple to implement: during function registration, a user can specify pre/post middleware/hook. A middleware/hook is a function from the discovery:
Example register function payload:
{
"functionId": "grapqh",
"awsLambda": {
...
},
"middlewares": {
"pre": "auth"
}
}
Maybe "hooks" is not the best name, maybe middleware
Many API Gateway implementations have extendable middleware (e.g., Kong Plug-ins). How could we add this to the current implementation?
Example Use-Cases: