Skip to content
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

Module/Plugin/Policy definition #427

Closed
mikz opened this issue Sep 15, 2017 · 1 comment
Closed

Module/Plugin/Policy definition #427

mikz opened this issue Sep 15, 2017 · 1 comment

Comments

@mikz
Copy link
Contributor

mikz commented Sep 15, 2017

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.

@mikz
Copy link
Contributor Author

mikz commented Jun 11, 2018

Done by the new policy system. #450

@mikz mikz closed this as completed Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant