Module update to configure widget permissions#9
Module update to configure widget permissions#9maheichyk wants to merge 2 commits intomatrix-org:mainfrom
Conversation
…issions preapproval from the module. Signed-off-by: Mikhail Aheichyk mikhail.aheichyk@nordeck.net
|
This change looks reasonably sensible from my limited knowledge. Some questions:
|
|
I've arranged to meet @turt2live on Mon 6th Feb to learn enough about this to be able to review it. |
Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
|
@andybalaam I have added a simple test to check |
|
Hi @maheichyk , thank you for your work on this. Yesterday I learned a lot from @turt2live about what the module API is, and how it should work, so I'm ready to give you some feedback on this PR. The main feedback is that we want the module API to work mainly via Generally, calls to Here are my notes on how we think this would work: For In matrix-react-sdk: In module API: Then for
In all 3 cases, the Does this make sense? Do ask questions if you need clarification. |
|
Hi @andybalaam thanks a lot for the explanations and details regarding module API, that is very helpful. I created another PR to module API: #11 that is based on your input and a draft PR to matrix react sdk matrix-org/matrix-react-sdk#10121 that shows how these module API changes could be used. Locally I implemented a simple module that is called and approves permissions via these API changes as a proof of concept. I have slightly modified your suggestions basically to use a single listener type Maybe a small remark about the API usage, for example to request capabilities: then it is quite easy to write a code that calls invoke with wrong params because types are not checked for invoke to match actual listener type. Maybe this could be improved. |
|
Closing in favour of #11 |
We would like to have a possibility to configure widget permissions in custom fork deployments.
These PRs: matrix-org/matrix-react-sdk#9931, matrix-org/matrix-react-sdk#9910 were used to try to update already existing API from matrix-react-sdk but it was agreed that module system should be used for that.
There doesn't seem to be an API currently in the module system that could be used to directly customize this behavior.
This PR suggests to update
RuntimeModulewithWidgetPermissionsthat will allow to specify widget permissions behavior in the module implementation.In this case it will be possible to create a PR to matrix-react-sdk to:
WidgetPermissionsfrom the modules and expose it viagetWidgetPermissions(), if several modules defineWidgetPermissionsthen the decision which one to use (or maybe to fail) should be made.getWidgetPermissions()from theModuleRunner.