Commit Graph

177 Commits

Author SHA1 Message Date
Michael Telatynski 5223383698 Update screenshots 2026-04-02 15:26:26 +01:00
Michael Telatynski efb697fc56 Merge pull request #232 from element-hq/t3chguy/banner-h2 2026-04-02 10:04:11 +01:00
renovate[bot] 60698a2b78 Update dependency @vector-im/compound-design-tokens to v8 2026-03-31 14:34:08 +00:00
Michael Telatynski 0607a32595 Stabilise banner h2 2026-03-31 09:43:09 +01:00
David Langley 663754989e Merge pull request #199 from element-hq/langleyd/widget-lifecycle-module
Widget lifecycle module
2026-03-23 23:52:16 +00:00
David Langley 5d25bd08a1 Trigger build 2026-03-23 23:46:48 +00:00
David Langley af0725b33f Merge branch 'main' into langleyd/widget-lifecycle-module 2026-03-23 11:38:44 +00:00
David Langley 617978e436 update moduleApiVersion to enforce module is actually present. 2026-03-23 11:38:04 +00:00
R Midhun Suresh 242d04cef6 Update screenshots 2026-03-23 12:41:34 +05:30
David Baker 1b89d9ac7e Merge pull request #224 from element-hq/dbkr/pin_react_deps 2026-03-17 14:06:04 +00:00
David Baker 055a127841 Pin react deps to exact version in package.json
Yarn had somehow confused itself and got into a state where it refused
to install react 19.2.4, so much so that even renovate thought it had
upgraded the package (https://github.com/element-hq/element-modules/pull/208)
when it hadn't.

Until we switch to pnom and can use catalog:, pin them to exact version which
seems to make yarn play ball again.
2026-03-16 17:58:23 +00:00
David Langley c058c187c4 Tidy up 2026-03-13 16:19:27 +00:00
David Langley 610a9494d1 Fix coverage paths 2026-03-13 15:43:25 +00:00
David Langley 75464c1634 Make sonar happy 2026-03-13 15:43:25 +00:00
David Langley 7d183ed15b Fix coverage reporting 2026-03-13 15:43:25 +00:00
David Langley c2da26542e Remove double export 2026-03-13 15:43:25 +00:00
David Langley 782b008b54 Fix e2e
We need wildcard to match query params etc
2026-03-13 15:43:25 +00:00
David Langley 5d091e91c3 Update e2e tests and header
Don't add normalisation of widget headers either
2026-03-13 15:43:25 +00:00
David Langley 6aa454c646 Add widget lifecycle module 2026-03-13 15:43:25 +00:00
David Langley fee5f0633c Merge pull request #216 from element-hq/langleyd/playwright-e2e-convention
Add per module playwright projects with /e2e convention for auto-discovery of playwright test
2026-03-05 20:57:42 +00:00
David Langley 64d5bef3e7 Migrate playwright tests from tests/ to e2e/ convention
All modules now use e2e/ for playwright tests, consistent with
element-modules-private. This avoids conflicts between vitest (which
uses tests/) and playwright project discovery.
2026-03-04 15:55:57 +00:00
Michael Telatynski 5bc64a19da Update services.ts 2026-03-02 13:08:52 +00:00
renovate[bot] 1d9664ef10 Update npm non-major dependencies 2026-03-01 16:05:52 +00:00
Andrew Morgan 9a8ef99b8c Disable local registration when using MAS 2026-02-05 14:04:45 +00:00
Andrew Morgan 1b3243cb00 Disable local passwords in MAS Synapse
Otherwise we'll get the following error upon Synapse startup: Password auth cannot be enabled while OAuth delegation is enabled.
2026-02-05 14:04:37 +00:00
Andrew Morgan 7c62578252 Create MAS container and tests for restricted guests testing
Add a new container that both:

- Spins up a MAS instance.
- Loads the restricted guests module into Synapse, and configures it
  accordingly.

Then extend restricted guests spec to include MAS tests.

This requires setting up MAS' config to recognise the module as an
automated client (so that it can request Admin perms to
create/deactivate users).
2026-02-05 14:04:33 +00:00
Ben Banfield-Zanin 306e21331b Merge pull request #177 from anoadragon453/anoa/synapse_guest_module_mas
Make the Synapse Restricted Guests module compatible with MAS
2026-02-05 11:12:15 +00:00
Andrew Morgan ab8a307d5d Make {mas_,}user_id DB tables NOT NULL 2026-02-04 16:31:19 +00:00
Andrew Morgan e1b42da345 lint 2026-01-23 17:05:56 +00:00
Andrew Morgan 85ef24f917 Remove test runtime checks for AsyncMock vs. Mock
Turns out they're always AsyncMock.
2026-01-23 16:52:21 +00:00
Andrew Morgan c6dabf052b Remove fallback wrapper for post_urlencoded_get_json 2026-01-23 16:36:59 +00:00
Andrew Morgan 7abb63f1f2 Don't be cryptographically random!
That's what you get for generating a random string function.
2026-01-23 15:18:55 +00:00
Andrew Morgan ecd25faec8 Add docstring for request_admin_token 2026-01-23 15:16:39 +00:00
Andrew Morgan a4173bb1dd expires_in -> expires_in_sec + docstring 2026-01-23 14:55:17 +00:00
Andrew Morgan e0304c627b created_at -> created_at_sec 2026-01-23 14:41:06 +00:00
Andrew Morgan 2e71abdfda Add user_id field to guest_module_mas_users
Currently unused, but may be useful in future.
2026-01-23 14:38:19 +00:00
Andrew Morgan 514c6957f7 Log MXID and MAS ID when registering guest user 2026-01-23 14:02:00 +00:00
Andrew Morgan f88a280b8b Correct typo in comment 2026-01-23 13:52:19 +00:00
Andrew Morgan 2a9c384213 Update tests for randomly generated device IDs
Pin the device ID in tests by mocking the generation function.
And test said generation function.
2026-01-19 14:34:03 +00:00
Andrew Morgan 3f53333448 Return the correct device ID
Turns out the client needs to generate it, and pass it as a scope. Clever!
2026-01-19 13:56:57 +00:00
Andrew Morgan b8fda8acdf lint 2026-01-19 13:04:31 +00:00
Andrew Morgan 41922415ba Update tests to run with MAS module variant
We now run the standard battery of tests with a MAS-enabled module. Some
minimal adjustment was needed to check MAS-specific outputs.
2026-01-16 19:21:38 +00:00
Andrew Morgan 55ca2be0f6 Update unit tests to check MAS config, deactivation works 2026-01-16 19:20:35 +00:00
Andrew Morgan 2aa16a8222 lint 2026-01-16 18:49:43 +00:00
Andrew Morgan d45fd845b3 Add client_secret_filepath option
To allow supplying the `client_secret` in a file, instead of directly in the configuration. I've found that ESS prefer this method in the past, so the entire config does not need to be a secret.
2026-01-16 18:05:33 +00:00
Andrew Morgan 9f4ca6f7e6 Store registered users in a namespaced table, deactivate upon expiry
To deactivate users, we need their `actor_user_id` (MAS-specific). I don't believe there's a way to get this from Synapse. So, we store user's detailed in a namespaced table upon registering them, along with the creation timestamp, and deactivate them once they're considered expired.
2026-01-16 18:05:33 +00:00
Andrew Morgan d0e17ae274 Add the ability to deactivate users in the MAS client
As we won't be able to deactivate them using the Synapse module API
2026-01-16 18:05:33 +00:00
Andrew Morgan 801d28f3ca Create a personal session on MAS
In order to get an access token for a user, one needs to create a personal session on MAS.

We now do so, and extract the access token and device ID from the response.

TODO: We're handing back the MAS user ID as the device ID. Is that correct?
2026-01-16 18:05:33 +00:00
Andrew Morgan 9c2b9463a9 Wire the new MasAdminClient in
If `mas` is defined in the config, then use it to create users instead
of Synapse's module API.
2026-01-16 18:05:33 +00:00
Andrew Morgan 04414e06a9 Add MasAdminClient class
A class to request OAuth2 tokens from MAS, and create users using them.

Requires data from the config options we defined.
2026-01-16 18:05:33 +00:00