Skip to content

Commit 515f556

Browse files
committed
fixes for routes regex
1 parent 0ae3158 commit 515f556

6 files changed

Lines changed: 165 additions & 56 deletions

File tree

charts/synapse/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v2
22
appVersion: 1.151.0
33
description: matrix synapse kubernetes deployment
44
name: synapse
5-
version: 2.4.11
5+
version: 2.4.12

charts/synapse/tests/golden/fixtures/test-envoy-configmap-msc4306.golden.yaml

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ data:
104104
cluster: httpd-master
105105
- match:
106106
safe_regex:
107-
regex: '^/_matrix/client/(unstable|v1)/org.matrix.msc4108/rendezvous$'
107+
regex: '^/_matrix/client/(unstable|v1)/org\.matrix\.msc4108/rendezvous$'
108108
route:
109109
timeout: 300s
110110
auto_host_rewrite: true
@@ -118,35 +118,35 @@ data:
118118
cluster: httpd-master
119119
- match:
120120
safe_regex:
121-
regex: '^/_matrix/client/(r0|v3|unstable)/rooms/[^/]+/receipt.*'
121+
regex: '^/_matrix/client/(r0|v3|unstable)/rooms/[^/]+/receipt/[^/]+/[^/]+$'
122122
route:
123123
timeout: 300s
124124
auto_host_rewrite: true
125125
cluster: httpd-receipts
126126
- match:
127127
safe_regex:
128-
regex: '^/_matrix/client/(r0|v3|unstable)/rooms/[^/]+/read_markers.*'
128+
regex: '^/_matrix/client/(r0|v3|unstable)/rooms/[^/]+/read_markers$'
129129
route:
130130
timeout: 300s
131131
auto_host_rewrite: true
132132
cluster: httpd-receipts
133133
- match:
134134
safe_regex:
135-
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/[^/]+/typing.*'
135+
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/[^/]+/typing/[^/]+$'
136136
route:
137137
timeout: 300s
138138
auto_host_rewrite: true
139139
cluster: httpd-typing
140140
- match:
141141
safe_regex:
142-
regex: '^/_matrix/client/unstable/io.element.msc4306/rooms/.*/thread/.*/subscription$'
142+
regex: '^/_matrix/client/unstable/io\.element\.msc4306/rooms/.*/thread/.*/subscription$'
143143
route:
144144
timeout: 300s
145145
auto_host_rewrite: true
146146
cluster: httpd-thread-subscriptions
147147
- match:
148148
safe_regex:
149-
regex: '^/_matrix/client/unstable/io.element.msc4308/thread_subscriptions$'
149+
regex: '^/_matrix/client/unstable/io\.element\.msc4308/thread_subscriptions$'
150150
route:
151151
timeout: 300s
152152
auto_host_rewrite: true
@@ -209,7 +209,7 @@ data:
209209
name: whoami_hash
210210
- match:
211211
safe_regex:
212-
regex: '^/_matrix/client/unstable/org.matrix.simplified_msc3575/sync$'
212+
regex: '^/_matrix/client/unstable/org\.matrix\.simplified_msc3575/sync$'
213213
route:
214214
timeout: 300s
215215
auto_host_rewrite: true
@@ -223,7 +223,21 @@ data:
223223
name: whoami_hash
224224
- match:
225225
safe_regex:
226-
regex: '^/_matrix/client/(r0|v3|unstable)/room_keys/.*'
226+
regex: '^/_matrix/client/(r0|v3|unstable)/room_keys/keys(/[^/]+)?(/[^/]+)?$'
227+
route:
228+
timeout: 300s
229+
auto_host_rewrite: true
230+
cluster: httpd-user-hash
231+
hash_policy:
232+
- header:
233+
header_name: X-Hash-Key
234+
typed_per_filter_config:
235+
envoy.filters.http.lua:
236+
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute
237+
name: whoami_hash
238+
- match:
239+
safe_regex:
240+
regex: '^/_matrix/client/(r0|v3|unstable)/room_keys/version(/[^/]+)?$'
227241
route:
228242
timeout: 300s
229243
auto_host_rewrite: true
@@ -307,49 +321,63 @@ data:
307321
cluster: httpd-to-device
308322
- match:
309323
safe_regex:
310-
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/rooms/[^/]+/tags(/.*)?$'
324+
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/rooms/[^/]+/tags$'
311325
route:
312326
timeout: 300s
313327
auto_host_rewrite: true
314328
cluster: httpd-account-data
315329
- match:
316330
safe_regex:
317-
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+(/rooms/[^/]+)?/account_data(/.*)?$'
331+
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/rooms/[^/]+/tags/[^/]+$'
318332
route:
319333
timeout: 300s
320334
auto_host_rewrite: true
321335
cluster: httpd-account-data
322336
- match:
323337
safe_regex:
324-
regex: '^/_matrix/client/(r0|v3|unstable)/delete_devices$'
338+
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/account_data/[^/]+$'
339+
route:
340+
timeout: 300s
341+
auto_host_rewrite: true
342+
cluster: httpd-account-data
343+
- match:
344+
safe_regex:
345+
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/rooms/[^/]+/account_data/[^/]+$'
346+
route:
347+
timeout: 300s
348+
auto_host_rewrite: true
349+
cluster: httpd-account-data
350+
- match:
351+
safe_regex:
352+
regex: '^/_matrix/client/(r0|v3)/delete_devices$'
325353
route:
326354
timeout: 300s
327355
auto_host_rewrite: true
328356
cluster: httpd-device-lists
329357
- match:
330358
safe_regex:
331-
regex: '^/_matrix/client/(r0|v3|unstable)/devices(/.*)?$'
359+
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/.*)?$'
332360
route:
333361
timeout: 300s
334362
auto_host_rewrite: true
335363
cluster: httpd-device-lists
336364
- match:
337365
safe_regex:
338-
regex: '^/_matrix/client/(r0|v3|unstable)/keys/upload$'
366+
regex: '^/_matrix/client/(r0|v3|unstable)/keys/upload(/.*)?$'
339367
route:
340368
timeout: 300s
341369
auto_host_rewrite: true
342370
cluster: httpd-device-lists
343371
- match:
344372
safe_regex:
345-
regex: '^/_matrix/client/(v3|unstable)/keys/device_signing/upload$'
373+
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$'
346374
route:
347375
timeout: 300s
348376
auto_host_rewrite: true
349377
cluster: httpd-device-lists
350378
- match:
351379
safe_regex:
352-
regex: '^/_matrix/client/(r0|v3|unstable)/keys/signatures/upload$'
380+
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$'
353381
route:
354382
timeout: 300s
355383
auto_host_rewrite: true
@@ -651,6 +679,13 @@ data:
651679
timeout: 300s
652680
auto_host_rewrite: true
653681
cluster: httpd-client-reader
682+
- match:
683+
safe_regex:
684+
regex: '^/_matrix/client/unstable/org\.matrix\.msc3983/keys/claim$'
685+
route:
686+
timeout: 300s
687+
auto_host_rewrite: true
688+
cluster: httpd-client-reader
654689
- match:
655690
safe_regex:
656691
regex: '^/_matrix/client/(r0|v3|unstable)/keys/query$'

charts/synapse/tests/golden/fixtures/test-envoy-configmap-no-mas.golden.yaml

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ data:
104104
cluster: httpd-master
105105
- match:
106106
safe_regex:
107-
regex: '^/_matrix/client/(unstable|v1)/org.matrix.msc4108/rendezvous$'
107+
regex: '^/_matrix/client/(unstable|v1)/org\.matrix\.msc4108/rendezvous$'
108108
route:
109109
timeout: 300s
110110
auto_host_rewrite: true
@@ -139,7 +139,7 @@ data:
139139
cluster: httpd-client-reader
140140
- match:
141141
safe_regex:
142-
regex: '^/_matrix/client/v1/register/m.login.registration_token/validity$'
142+
regex: '^/_matrix/client/v1/register/m\.login\.registration_token/validity$'
143143
route:
144144
timeout: 300s
145145
auto_host_rewrite: true
@@ -153,21 +153,21 @@ data:
153153
cluster: httpd-client-reader
154154
- match:
155155
safe_regex:
156-
regex: '^/_matrix/client/(r0|v3|unstable)/rooms/[^/]+/receipt.*'
156+
regex: '^/_matrix/client/(r0|v3|unstable)/rooms/[^/]+/receipt/[^/]+/[^/]+$'
157157
route:
158158
timeout: 300s
159159
auto_host_rewrite: true
160160
cluster: httpd-receipts
161161
- match:
162162
safe_regex:
163-
regex: '^/_matrix/client/(r0|v3|unstable)/rooms/[^/]+/read_markers.*'
163+
regex: '^/_matrix/client/(r0|v3|unstable)/rooms/[^/]+/read_markers$'
164164
route:
165165
timeout: 300s
166166
auto_host_rewrite: true
167167
cluster: httpd-receipts
168168
- match:
169169
safe_regex:
170-
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/[^/]+/typing.*'
170+
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/[^/]+/typing/[^/]+$'
171171
route:
172172
timeout: 300s
173173
auto_host_rewrite: true
@@ -230,7 +230,7 @@ data:
230230
name: whoami_hash
231231
- match:
232232
safe_regex:
233-
regex: '^/_matrix/client/unstable/org.matrix.simplified_msc3575/sync$'
233+
regex: '^/_matrix/client/unstable/org\.matrix\.simplified_msc3575/sync$'
234234
route:
235235
timeout: 300s
236236
auto_host_rewrite: true
@@ -244,7 +244,21 @@ data:
244244
name: whoami_hash
245245
- match:
246246
safe_regex:
247-
regex: '^/_matrix/client/(r0|v3|unstable)/room_keys/.*'
247+
regex: '^/_matrix/client/(r0|v3|unstable)/room_keys/keys(/[^/]+)?(/[^/]+)?$'
248+
route:
249+
timeout: 300s
250+
auto_host_rewrite: true
251+
cluster: httpd-user-hash
252+
hash_policy:
253+
- header:
254+
header_name: X-Hash-Key
255+
typed_per_filter_config:
256+
envoy.filters.http.lua:
257+
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute
258+
name: whoami_hash
259+
- match:
260+
safe_regex:
261+
regex: '^/_matrix/client/(r0|v3|unstable)/room_keys/version(/[^/]+)?$'
248262
route:
249263
timeout: 300s
250264
auto_host_rewrite: true
@@ -328,49 +342,63 @@ data:
328342
cluster: httpd-to-device
329343
- match:
330344
safe_regex:
331-
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/rooms/[^/]+/tags(/.*)?$'
345+
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/rooms/[^/]+/tags$'
332346
route:
333347
timeout: 300s
334348
auto_host_rewrite: true
335349
cluster: httpd-account-data
336350
- match:
337351
safe_regex:
338-
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+(/rooms/[^/]+)?/account_data(/.*)?$'
352+
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/rooms/[^/]+/tags/[^/]+$'
339353
route:
340354
timeout: 300s
341355
auto_host_rewrite: true
342356
cluster: httpd-account-data
343357
- match:
344358
safe_regex:
345-
regex: '^/_matrix/client/(r0|v3|unstable)/delete_devices$'
359+
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/account_data/[^/]+$'
360+
route:
361+
timeout: 300s
362+
auto_host_rewrite: true
363+
cluster: httpd-account-data
364+
- match:
365+
safe_regex:
366+
regex: '^/_matrix/client/(r0|v3|unstable)/user/[^/]+/rooms/[^/]+/account_data/[^/]+$'
367+
route:
368+
timeout: 300s
369+
auto_host_rewrite: true
370+
cluster: httpd-account-data
371+
- match:
372+
safe_regex:
373+
regex: '^/_matrix/client/(r0|v3)/delete_devices$'
346374
route:
347375
timeout: 300s
348376
auto_host_rewrite: true
349377
cluster: httpd-device-lists
350378
- match:
351379
safe_regex:
352-
regex: '^/_matrix/client/(r0|v3|unstable)/devices(/.*)?$'
380+
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/.*)?$'
353381
route:
354382
timeout: 300s
355383
auto_host_rewrite: true
356384
cluster: httpd-device-lists
357385
- match:
358386
safe_regex:
359-
regex: '^/_matrix/client/(r0|v3|unstable)/keys/upload$'
387+
regex: '^/_matrix/client/(r0|v3|unstable)/keys/upload(/.*)?$'
360388
route:
361389
timeout: 300s
362390
auto_host_rewrite: true
363391
cluster: httpd-device-lists
364392
- match:
365393
safe_regex:
366-
regex: '^/_matrix/client/(v3|unstable)/keys/device_signing/upload$'
394+
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$'
367395
route:
368396
timeout: 300s
369397
auto_host_rewrite: true
370398
cluster: httpd-device-lists
371399
- match:
372400
safe_regex:
373-
regex: '^/_matrix/client/(r0|v3|unstable)/keys/signatures/upload$'
401+
regex: '^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$'
374402
route:
375403
timeout: 300s
376404
auto_host_rewrite: true
@@ -644,6 +672,13 @@ data:
644672
timeout: 300s
645673
auto_host_rewrite: true
646674
cluster: httpd-client-reader
675+
- match:
676+
safe_regex:
677+
regex: '^/_matrix/client/unstable/org\.matrix\.msc3983/keys/claim$'
678+
route:
679+
timeout: 300s
680+
auto_host_rewrite: true
681+
cluster: httpd-client-reader
647682
- match:
648683
safe_regex:
649684
regex: '^/_matrix/client/(r0|v3|unstable)/keys/query$'

0 commit comments

Comments
 (0)