You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
matrix: self-reserve the /_matrix root via api.reservePath (#602)
The fourth shim consumer of the seam, consumed as of JSS 0.0.219 — no
operator appPaths. Widened to POST (login, createRoom) and PUT (room
send) only; DELETE/PATCH stay gated so nothing falls through to LDP's
write wildcards. 12/12 tests green with the hand-widening removed.
Copy file name to clipboardExpand all lines: matrix/README.md
+34-25Lines changed: 34 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,8 @@ timeline is the events you appended to it.
10
10
This is the **chat-protocol** entry in the API-shim family — after the two
11
11
microblog shims (`mastodon/`, `bluesky/`) it confirms the same two seams a
12
12
third time, now against a fixed `/_matrix` root: the reserved-path/`appPaths`
13
-
gap and the `/idp/credentials` token bridge.
13
+
gap (since **closed** by `api.reservePath()`, JSS 0.0.219) and the
14
+
`/idp/credentials` token bridge.
14
15
15
16
```
16
17
plugins: [{
@@ -22,15 +23,11 @@ plugins: [{
22
23
}]
23
24
```
24
25
25
-
…**and** — the load-bearing caveat — the operator must WAC-exempt the fixed
26
-
Matrix root, because a plugin cannot do it itself (see [Findings](#findings)):
27
-
28
-
```
29
-
createServer({
30
-
appPaths: ['/_matrix'], // REQUIRED: or WAC 401s every client call
31
-
plugins: [ … ],
32
-
})
33
-
```
26
+
That's the whole setup. As of JSS 0.0.219 the plugin claims and WAC-exempts
27
+
the fixed `/_matrix` root itself via `api.reservePath()` at activate time
28
+
(#602) — no `appPaths` widening required. (Before 0.0.219 the operator had to
29
+
pass `appPaths: ['/_matrix']` by hand or WAC 401'd every client call — see
30
+
[Findings](#findings).)
34
31
35
32
## Pointing a client at it
36
33
@@ -123,7 +120,7 @@ that require the field.
123
120
124
121
## Findings
125
122
126
-
### 1. Matrix's fixed `/_matrix` root doesn't fit the one-prefix plugin model — the Nth confirmation, now for a chat protocol
123
+
### 1. Matrix's fixed `/_matrix` root doesn't fit the one-prefix plugin model — the Nth confirmation, now for a chat protocol (CLOSED: `api.reservePath`, JSS 0.0.219)
127
124
128
125
The same seam `mastodon/` (`/api`+`/oauth`) and `bluesky/` (`/xrpc`) found,
129
126
confirmed a **third** time and for a **different protocol family** (real-time
@@ -135,20 +132,32 @@ chat, not microblogging). A Matrix client hits **fixed absolute paths** under
135
132
prefix (`api.fastify` is the real scoped instance), and these static/param
136
133
routes outrank core's LDP `GET /*` wildcard on Fastify's specificity
137
134
ordering. Registration is fine.
138
-
-**Authorization does not.**`/_matrix` is an ordinary pod path, not
139
-
`/.well-known/*` (which core blanket-exempts). The WAC hook skips only paths
140
-
in `appPaths`, and the loader pushes a plugin's **single `prefix`** there.
141
-
A plugin has no way to push more roots — there is no `api.reservePath()` /
142
-
`api.appPaths.add()` — so it **cannot self-exempt its own surface**, and
143
-
every unexempted client call is 401'd by WAC before the handler runs.
144
-
145
-
The honest consequence: this shim is only usable if the **operator** widens
146
-
`appPaths` by hand (`appPaths: ['/_matrix']`). That the finding now holds
147
-
across **social (`activitypub`) → microblog (`mastodon`, `bluesky`) → chat
148
-
(`matrix`)** is the point: the one-prefix model can't express *any* app whose
149
-
routes are dictated by an external protocol at a fixed absolute root,
150
-
regardless of protocol family. An `api.reservePath()` surface would close it
151
-
uniformly.
135
+
-**Authorization did not (before 0.0.219).**`/_matrix` is an ordinary pod
136
+
path, not `/.well-known/*` (which core blanket-exempts). The WAC hook skips
137
+
only paths in `appPaths`, and the loader pushes a plugin's **single
138
+
`prefix`** there. A plugin had no way to push more roots — there was no
139
+
`api.reservePath()` / `api.appPaths.add()` — so it **could not self-exempt
140
+
its own surface**, and every unexempted client call was 401'd by WAC before
141
+
the handler ran.
142
+
143
+
The honest consequence, at the time: the shim was only usable if the
144
+
**operator** widened `appPaths` by hand (`appPaths: ['/_matrix']`). That the
145
+
finding held across **social (`activitypub`) → microblog (`mastodon`,
146
+
`bluesky`) → chat (`matrix`)** was the point: the one-prefix model couldn't
147
+
express *any* app whose routes are dictated by an external protocol at a
148
+
fixed absolute root, regardless of protocol family — an `api.reservePath()`
0 commit comments