aixigo / PREvant

Composing Microservices into Reviewable and Testable Applications
MIT License
13 stars 10 forks source link

Hooks for Advanced Skripting #41

Closed schrieveslaach closed 3 years ago

schrieveslaach commented 4 years ago

This issue is currently just an idea.

Users of PREvant want to extend configurations of services dynamically. This custom configuration might be based on some team-specific development processes and potentially on some state that needs to be persisted.

Therefore, PREvant could make use of the scripting engine rhai:

In the configuration PREvant could offer a hooks section:

[hooks.preDeployment]
script = '/path/to/preDeployment.rhai'
stateful = true

[hooks.postDeletion]
script = '/path/to/postDeletion.rhai'
stateful = true

Based on this example PREvant would execute /path/to/preDeployment.rhai with app name, service configurations, state, etc. and the script could modify, fitler, the service configurtions and state, before the actual deployment happens.

This could replace the secrets eventually.

schrieveslaach commented 3 years ago

I'm rethinking this approach of using rhai and use a more common scripting language such as Javascript. So boa could be an option as well.

Further, I don't like the idea of stateful = true anymore. This could become an security issue in the future.