introduce Rhai script module for request/response handling#335
introduce Rhai script module for request/response handling#335jimbirthday wants to merge 7 commits intoferronweb:develop-2.xfrom
Conversation
This commit adds a new `ferron-script` module that allows users to define and execute Rhai scripts within the Ferron server. The module supports various triggers such as `on_request_start` and `on_response_ready`, enabling dynamic request handling and response modification. Additionally, it includes configuration options for script limits and failure policies, enhancing the server's extensibility and flexibility. New files include: - `ferron-script` crate with core functionality - Example scripts for authentication and response modification - Documentation for the script module and testing guidelines Also updated `.gitignore` to exclude build artifacts and added `AGENTS.md` for repository guidelines.
468f0ae to
61c6c93
Compare
|
@DorianNiemiecSVRJS Can you review the code? |
This commit updates the `Cargo.lock` to include the `const-hex` package and removes the previously defined `const-hex` entry. Additionally, it cleans up the `Cargo.toml` by removing the `tokio-test` dependency from the `ferron-script` module and deletes the unused `build_with_modules.rs` file, streamlining the project structure.
ac9ff54 to
c4b490d
Compare
1d7612c to
159c883
Compare
|
What do I need to do next? @DorianNiemiecSVRJS |
|
Thank you for creating the pull request! And apologies for a bit late response... I actually had a similar idea with a scripting module when I was working on Ferron 2 when it was still beta - except I thought of using a different scripting language (Lua). But I ended up putting off the implementation of the concept to what it would be some later version after the Ferron 2 launch...
Yes, I'm going to review your PR after I release a next version of Ferron (2.2.2), hopefully soon. The Rhai scripting functionality will probably be in Ferron 2.3.0, after I merge your PR. |
|
So, I have released the new version of Ferron (which turned out to be 2.3.x, because I made quite some changes), and I'm going to review your PR soon. If it gets merged, the change is going to land in Ferron 2.4.0 (probably)! 🎉 |
feat(script): introduce Rhai script module for request/response handling
This commit adds a new
ferron-scriptmodule that allows users to define and execute Rhai scripts within the Ferron server. The module supports various triggers such ason_request_startandon_response_ready, enabling dynamic request handling and response modification. Additionally, it includes configuration options for script limits and failure policies, enhancing the server's extensibility and flexibility.New files include:
ferron-scriptcrate with core functionality#317