Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Generic Webhooks Widget interface #140

Merged
merged 32 commits into from Apr 8, 2022
Merged

Add Generic Webhooks Widget interface #140

merged 32 commits into from Apr 8, 2022

Conversation

Half-Shot
Copy link
Contributor

@Half-Shot Half-Shot commented Jan 10, 2022

This PR improves the general interface around admin room controls for widgets. The outcome will hopefully be mapping the complete set of configuration options and tools to the widget web app.

Previously, this PR demoed an experiment to show invite widgets (that eventually became the Slack invite widget experiment). However, invite UI in hookshot isn't particularly useful so it was removed from this PR. This PR now does other things.

  • When inviting hookshot into a room, it will optionally spawn a room configuration widget.
  • The room configuration widget can be used to create, update and delete generic widgets.
  • There is a lot of room in the code for other service types to be added, but this PR is constrained to just webhooks for now.
  • This PR also refactors the widget API to use matrix-appservice-bridge's ProvisioningAPI.
  • This now means that widgets no longer use the archaic access-token-stored-in-state logic we had in admin rooms, instead using short lived tokens.

Video

TODO:

  • Documentation

@Half-Shot Half-Shot changed the title Improved widget interface for admin room Add Generic Webhooks Widget interface Apr 5, 2022
@Half-Shot Half-Shot marked this pull request as ready for review April 5, 2022 11:05
@HarHarLinks
Copy link
Contributor

HarHarLinks commented Apr 5, 2022

video demo looks quite excellent.

Q: (how) do you prevent leaking the webhook url to anyone in the room besides the admin? can't anyone use the widget? => is this what the admin room setting is supposed to solve?

@Half-Shot
Copy link
Contributor Author

video demo looks quite excellent.

Q: (how) do you prevent leaking the webhook url to anyone in the room besides the admin? can't anyone use the widget? => is this what the admin room setting is supposed to solve?

URLs are "secret", so non-admins basically can see the code and the name (i.e. what you can see from the state event).

@Half-Shot Half-Shot requested a review from a team April 5, 2022 16:45
Copy link
Contributor

@tadzik tadzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Admittedly, I've only skimmed the React bits – having them in scope of all this feels a bit overwhelming, but I'm not sure if it makes practical sense to separate it.

src/AdminRoom.ts Outdated Show resolved Hide resolved
src/AdminRoom.ts Outdated Show resolved Hide resolved
src/App/BridgeApp.ts Outdated Show resolved Hide resolved
src/Bridge.ts Show resolved Hide resolved
src/Bridge.ts Outdated Show resolved Hide resolved
src/Widgets/BridgeWidgetApi.ts Outdated Show resolved Hide resolved
src/Widgets/SetupWidget.ts Outdated Show resolved Hide resolved
src/provisioning/provisioner.ts Outdated Show resolved Hide resolved
web/BridgeAPI.ts Outdated Show resolved Hide resolved
web/BridgeAPI.ts Outdated Show resolved Hide resolved
@Half-Shot Half-Shot enabled auto-merge (squash) April 8, 2022 15:16
@Half-Shot Half-Shot merged commit aa9e066 into main Apr 8, 2022
@Half-Shot Half-Shot deleted the hs/widget-work branch April 8, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants