Skip to content

Commit c89b5ac

Browse files
committed
tests: use stable MAS integration in Synapse
1 parent 30e7567 commit c89b5ac

File tree

2 files changed

+5
-43
lines changed

2 files changed

+5
-43
lines changed

playwright/e2e/oidc/oidc-native.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
9595
const result = await mas.manage("kill-sessions", userId);
9696
expect(result.output).toContain("Ended 1 active OAuth 2.0 session");
9797

98-
// Workaround for Synapse's 2 minute cache on MAS token validity
99-
// (https://github.com/element-hq/synapse/pull/18231)
100-
await homeserver.restart();
101-
10298
await page.goto("http://localhost:8080");
10399
await expect(
104100
page.getByText("For security, this session has been signed out. Please sign in again."),

playwright/plugins/homeserver/synapse/masHomeserver.ts

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@ export const masHomeserver: Fixtures = {
1414
mas: [
1515
async ({ _homeserver: homeserver, logger, network, postgres, mailpit }, use) => {
1616
const config = {
17-
clients: [
18-
{
19-
client_id: "0000000000000000000SYNAPSE",
20-
client_auth_method: "client_secret_basic",
21-
client_secret: "SomeRandomSecret",
22-
},
23-
],
2417
matrix: {
18+
kind: "synapse",
2519
homeserver: "localhost",
2620
secret: "AnotherRandomSecret",
2721
endpoint: "http://homeserver:8008",
@@ -40,16 +34,10 @@ export const masHomeserver: Fixtures = {
4034
enable_registration_without_verification: undefined,
4135
disable_msisdn_registration: undefined,
4236
password_config: undefined,
43-
experimental_features: {
44-
msc3861: {
45-
enabled: true,
46-
issuer: `http://mas:8080/`,
47-
introspection_endpoint: "http://mas:8080/oauth2/introspect",
48-
client_id: config.clients[0].client_id,
49-
client_auth_method: config.clients[0].client_auth_method,
50-
client_secret: config.clients[0].client_secret,
51-
admin_token: config.matrix.secret,
52-
},
37+
matrix_authentication_service: {
38+
enabled: true,
39+
endpoint: "http://mas:8080/",
40+
secret: config.matrix.secret,
5341
},
5442
});
5543

@@ -59,28 +47,6 @@ export const masHomeserver: Fixtures = {
5947
{ scope: "worker" },
6048
],
6149

62-
config: async ({ homeserver, context, mas }, use) => {
63-
const issuer = `${mas.baseUrl}/`;
64-
const wellKnown = {
65-
"m.homeserver": {
66-
base_url: homeserver.baseUrl,
67-
},
68-
"org.matrix.msc2965.authentication": {
69-
issuer,
70-
account: `${issuer}account`,
71-
},
72-
};
73-
74-
// Ensure org.matrix.msc2965.authentication is in well-known
75-
await context.route("https://localhost/.well-known/matrix/client", async (route) => {
76-
await route.fulfill({ json: wellKnown });
77-
});
78-
79-
await use({
80-
default_server_config: wellKnown,
81-
});
82-
},
83-
8450
context: async ({ homeserverType, context }, use, testInfo) => {
8551
testInfo.skip(homeserverType !== "synapse", "does not yet support MAS");
8652
await use(context);

0 commit comments

Comments
 (0)