zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
20.91k stars 639 forks source link

Send an event to plugin if they use a function without requesting the rights #3366

Open Zykino opened 4 months ago

Zykino commented 4 months ago

I was thinking on having a new Event (sent through Update). So if the plugin dev want to, they can be notified, request permissions incrementally, and implement a back and forth to request new permission themself. The flow would be like:

Plugin: Call web_request that require the WebRequestResult permission, but you did not asked for it. Plugin: Happily continue its work, then return. Core: Forbid the request, log the issue & send MissingPermission{ Permission: WebRequestResult, Function: web_request, Arguments: Vec["http…"]} Plugin: Catch the event, know their call was blocked, and can react about it (requesting perm and retrying, doing nothing, logging, …)