Add a customisation point for widget permissions to preapprove embedding#9931
Conversation
|
Signed-off-by: Mikhail Aheichyk mikhail.aheichyk@nordeck.net |
dbkr
left a comment
There was a problem hiding this comment.
Otherwise I think this looks plausible, although I'd like to check with someone who knows this area of the codebase as obviously the price of getting this wrong is spectacular. Speaking of which, a unit test or something seems important here.
| import { Container, WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore"; | ||
| import { getConfigLivestreamUrl, startJitsiAudioLivestream } from "../../../Livestream"; | ||
| import { WidgetPermissionCustomisations } from "../../../customisations/WidgetPermissions"; | ||
| import { ElementWidget } from "../../../stores/widgets/StopGapWidget"; |
There was a problem hiding this comment.
This class has a comment saying, // TODO: Don't use this because it's wrong, so I'm not not sure this is what we want. Could we not just pass the json object into the customisation function? Why do we need to construct a Widget object from it first?
There was a problem hiding this comment.
(the comment is trying to say that "StopGap" is temporary, but that was years ago)
|
Having checked, it seems like this interface (customisation endpoints) has mostly been deprecated in favour of the modules system: https://github.com/matrix-org/matrix-react-sdk-module-api and https://github.com/vector-im/element-web-ilag-module for an example, so the intention would be to remove this API at some point. You may want to consider making this interface available via the modules system rather than have to do the migration in the future. |
|
Okay, thanks for feedback, then the plan is to try to use the module system. |
|
Closing this PR in favor of #10121 |
A new customization point for widget permissions to allow preapproval of embeddings for the widgets.
This will allow forks customization and consistent with #9910, #5439
Checklist
Here's what your changelog entry will look like:
✨ Features