Skip to content

Commit 271eb6a

Browse files
JohnMcLearclaude
andauthored
ci: swap deprecated ep_readonly_guest for ep_guest in plugin matrix (#7808)
ep_readonly_guest is archived (read-only on GitHub) and its authenticate hook unconditionally swaps req.session.user with a read-only guest, even when the request carries an HTTP Authorization header. That silently demoted admin login attempts and stalled the anonymizeAuthorSocket tests for 14 min/run on every with-plugins CI matrix (#7795). The pre-fix theory blamed ep_hash_auth.handleMessage; the actual hook trace is a red herring — handleMessage only fires on the /pad namespace and never on /settings. ep_guest is the maintained successor (same authors, same purpose). 1.0.72 on npm already includes the "defer to basic auth / admin paths" fix backported to ep_readonly_guest by intent here. Swapping the matrix unblocks the anonymizeAuthorSocket suite on Linux, Windows, and the upgrade-from-latest-release workflow. The runtime probe added in #7796 stays — it still catches any other authenticate-hook plugin that rejects the test's plain-text credentials (e.g. a future ep_hash_auth-style hashed-only plugin). Reattribute its comment so future readers don't chase ep_hash_auth. Closes #7795. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4d94b1b commit 271eb6a

5 files changed

Lines changed: 20 additions & 15 deletions

File tree

.github/workflows/backend-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
ep_hash_auth
147147
ep_headings2
148148
ep_markdown
149-
ep_readonly_guest
149+
ep_guest
150150
ep_set_title_on_pad
151151
ep_spellcheck
152152
ep_subscript_and_superscript
@@ -289,7 +289,7 @@ jobs:
289289
ep_hash_auth
290290
ep_headings2
291291
ep_markdown
292-
ep_readonly_guest
292+
ep_guest
293293
ep_set_title_on_pad
294294
ep_spellcheck
295295
ep_subscript_and_superscript

.github/workflows/frontend-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ jobs:
219219
ep_hash_auth
220220
ep_headings2
221221
ep_markdown
222-
ep_readonly_guest
222+
ep_guest
223223
ep_set_title_on_pad
224224
ep_spellcheck
225225
ep_subscript_and_superscript
@@ -308,7 +308,7 @@ jobs:
308308
ep_hash_auth
309309
ep_headings2
310310
ep_markdown
311-
ep_readonly_guest
311+
ep_guest
312312
ep_set_title_on_pad
313313
ep_spellcheck
314314
ep_subscript_and_superscript

.github/workflows/load-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
ep_hash_auth
9494
ep_headings2
9595
ep_markdown
96-
ep_readonly_guest
96+
ep_guest
9797
ep_set_title_on_pad
9898
ep_spellcheck
9999
ep_subscript_and_superscript

.github/workflows/upgrade-from-latest-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
ep_hash_auth
7777
ep_headings2
7878
ep_markdown
79-
ep_readonly_guest
79+
ep_guest
8080
ep_set_title_on_pad
8181
ep_spellcheck
8282
ep_subscript_and_superscript

src/tests/backend/specs/admin/anonymizeAuthorSocket.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,21 @@ const ask = (socket: any, evt: string, payload: any, replyEvt: string) =>
6262
});
6363

6464
// adminSocket() depends on Etherpad's default plain-text password check for
65-
// settings.users[name].password. Plugins like ep_hash_auth replace the
66-
// authenticate hook to expect hashed credentials, so the basic-auth probe
67-
// returns no admin session, /settings's connection handler returns without
65+
// settings.users[name].password. Any authenticate-hook plugin that claims
66+
// the request before the built-in basic-auth fallback can block this:
67+
// the historical offender was ep_readonly_guest, whose authenticate hook
68+
// sorts itself first and silently swaps req.session.user with a guest
69+
// (#7795); ep_hash_auth-style plugins that expect hashed credentials
70+
// would do the same. When that happens the basic-auth probe returns no
71+
// admin session, /settings's connection handler returns without
6872
// registering listeners (see src/node/hooks/express/adminsettings.ts:25),
6973
// and every socket.emit() afterwards waits forever for a reply that
7074
// nothing will ever send. The socket itself still connects when admin
7175
// session is missing, so the probe has to run at the application layer:
72-
// emit a known `/settings` event (`load`) and wait for the matching reply
73-
// (`settings`). If it doesn't arrive within the budget, skip — much
74-
// cheaper than letting mocha's 120s per-test timeout absorb 7 stalled
75-
// tests. Tracked in #7795.
76+
// emit a known `/settings` event (`authorLoad`) and wait for the matching
77+
// reply (`results:authorLoad`). If it doesn't arrive within the budget,
78+
// skip — much cheaper than letting mocha's 120s per-test timeout absorb
79+
// 7 stalled tests.
7680
const PROBE_BUDGET_MS = 15000;
7781
const adminSocketWithProbe = async (budgetMs: number): Promise<{
7882
ok: true; socket: any;
@@ -135,8 +139,9 @@ describe(__filename, function () {
135139
if (!probe.ok) {
136140
console.warn(
137141
`[anonymizeAuthorSocket] admin socket probe failed (${probe.reason}); ` +
138-
'skipping suite — likely an authenticate-hook plugin (e.g. ep_hash_auth) ' +
139-
'rejecting the test\'s plain-text admin credentials. Tracked in #7795.');
142+
'skipping suite — an authenticate-hook plugin (e.g. ep_readonly_guest, ' +
143+
'or an ep_hash_auth-style plugin requiring hashed credentials) is ' +
144+
'rejecting the test\'s plain-text admin credentials.');
140145
this.skip();
141146
return;
142147
}

0 commit comments

Comments
 (0)