You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the nginx configuration is global and can't be controlled in runtime this has to be build time customization.
A plugin when being installed (or later being available on the LUA_PATH) exposes some file, that provides templates for nginx configuration customization.
This requires templating the nginx configuration by some preprocessor. We could use the APIcast CLI preprocessor. One alternative would be to define nginx configuration as lua code and serialize it.
Modify request/response
Sometimes it is needed to run some code in the request phase. For that we have a apicast module object. Right now there can be only one module.
We need to have a chain of those modules that are executed in order. This order and chain is defined per service (by configuration). All modules/plugins available would get init/init_worker phase the same way as they'd get an option to extend nginx configuration. Later phases would be executed only when the module was enabled for that service that received requests.
This will be a breaking change for existing custom modules as the modules will be required not to call other modules explicitly (now they call apicast).
Change APIcast objects
APIcast has some internal configurations that could be customized. For this purpose would be possible to introduce a registry (per plugin?) that holds all the configuration values and can be replaced from outside. There should be some kind of verification (like a type) the objects have expected interface.
Dependencies
Custom code might require external dependencies on other libraries. This can be solved either on publish time by vendoring all the dependencies in the package itself or by having a way to install dependencies on build time. There is no package manager with transitive dependency locking in lua.
Installation
Some modules/plugins could have dependencies that have to be installed on the system.
In the first phase all modules have to be installed before they can be used. No runtime installation.
If APIcast gets configuration for a plugin that it does not have it should warn/error.
Tooling
Module/plugin creators should have clear way to create/test/build/publish their modules.
A CLI should be available to those needs. APIcast CLI prototype already has some components.
The text was updated successfully, but these errors were encountered:
We would like to introduce a way to have some custom code in the gateway.
What this custom code might want to do:
Those requirements are different enough that have to be supported by different features.
Extending nginx configuration (#477)
Because the nginx configuration is global and can't be controlled in runtime this has to be build time customization.
A plugin when being installed (or later being available on the LUA_PATH) exposes some file, that provides templates for nginx configuration customization.
This requires templating the nginx configuration by some preprocessor. We could use the APIcast CLI preprocessor. One alternative would be to define nginx configuration as lua code and serialize it.
Modify request/response
Sometimes it is needed to run some code in the request phase. For that we have a apicast module object. Right now there can be only one module.
We need to have a chain of those modules that are executed in order. This order and chain is defined per service (by configuration). All modules/plugins available would get init/init_worker phase the same way as they'd get an option to extend nginx configuration. Later phases would be executed only when the module was enabled for that service that received requests.
This will be a breaking change for existing custom modules as the modules will be required not to call other modules explicitly (now they call apicast).
Change APIcast objects
APIcast has some internal configurations that could be customized. For this purpose would be possible to introduce a registry (per plugin?) that holds all the configuration values and can be replaced from outside. There should be some kind of verification (like a type) the objects have expected interface.
Dependencies
Custom code might require external dependencies on other libraries. This can be solved either on publish time by vendoring all the dependencies in the package itself or by having a way to install dependencies on build time. There is no package manager with transitive dependency locking in lua.
Installation
Some modules/plugins could have dependencies that have to be installed on the system.
In the first phase all modules have to be installed before they can be used. No runtime installation.
If APIcast gets configuration for a plugin that it does not have it should warn/error.
Tooling
Module/plugin creators should have clear way to create/test/build/publish their modules.
A CLI should be available to those needs. APIcast CLI prototype already has some components.
The text was updated successfully, but these errors were encountered: