Skip to content

Commit 40cc249

Browse files
committed
Remove support for /.well-known/element/element.json
1 parent 7f027ef commit 40cc249

File tree

10 files changed

+15
-45
lines changed

10 files changed

+15
-45
lines changed

charts/matrix-stack/configs/well-known/partial-haproxy.cfg.tpl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ frontend well-known-in
1919
acl well-known path /.well-known/matrix/server
2020
acl well-known path /.well-known/matrix/client
2121
acl well-known path /.well-known/matrix/support
22-
acl well-known path /.well-known/element/element.json
2322

2423
{{ if .baseDomainRedirect.enabled }}
2524
{{- if $root.Values.elementWeb.enabled }}
@@ -33,6 +32,7 @@ frontend well-known-in
3332
{{- end }}
3433

3534
use_backend well-known-static if well-known
35+
default_backend well-known-no-match
3636

3737
backend well-known-static
3838
mode http
@@ -50,6 +50,10 @@ backend well-known-static
5050
http-request return status 200 content-type "application/json" file "/well-known/server" if { path /.well-known/matrix/server }
5151
http-request return status 200 content-type "application/json" file "/well-known/client" if { path /.well-known/matrix/client }
5252
http-request return status 200 content-type "application/json" file "/well-known/support" if { path /.well-known/matrix/support }
53-
http-request return status 200 content-type "application/json" file "/well-known/element.json" if { path /.well-known/element/element.json }
53+
54+
backend well-known-no-match
55+
mode http
56+
57+
http-request deny status 404
5458

5559
{{- end -}}

charts/matrix-stack/source/wellKnownDelegation.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
"client": {
3030
"type": "string"
3131
},
32-
"element": {
33-
"type": "string"
34-
},
3532
"server": {
3633
"type": "string"
3734
},

charts/matrix-stack/source/wellKnownDelegation.yaml.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{#
2-
Copyright 2024 New Vector Ltd
2+
Copyright 2024-2025 New Vector Ltd
33
44
SPDX-License-Identifier: AGPL-3.0-only
55
#}
@@ -22,5 +22,4 @@ baseDomainRedirect:
2222
additional:
2323
client: "{}"
2424
server: "{}"
25-
element: "{}"
2625
support: "{}"

charts/matrix-stack/templates/well-known/_helpers.tpl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,6 @@ k8s.element.io/target-instance: {{ $root.Release.Name }}-haproxy
8080
{{- end -}}
8181
{{- end }}
8282

83-
{{- define "element-io.well-known-delegation.element" }}
84-
{{- $root := .root -}}
85-
{{- with required "element-io.well-known-delegation.element missing context" .context -}}
86-
{{- $config := dict -}}
87-
{{- $additional := .additional.element | fromJson -}}
88-
{{- tpl (toPrettyJson (mustMergeOverwrite $additional $config)) $root -}}
89-
{{- end -}}
90-
{{- end }}
91-
9283
{{- define "element-io.well-known-delegation.support" }}
9384
{{- $root := .root -}}
9485
{{- with required "element-io.well-known-delegation.support missing context" .context -}}
@@ -107,7 +98,5 @@ server: |
10798
{{- (tpl (include "element-io.well-known-delegation.server" (dict "root" $root "context" .)) $root) | nindent 2 }}
10899
support: |
109100
{{- (tpl (include "element-io.well-known-delegation.support" (dict "root" $root "context" .)) $root) | nindent 2 }}
110-
element.json: |
111-
{{- (tpl (include "element-io.well-known-delegation.element" (dict "root" $root "context" .)) $root) | nindent 2 }}
112101
{{- end -}}
113102
{{- end -}}

charts/matrix-stack/templates/well-known/ingress.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ spec:
3737
name: "{{ $.Release.Name }}-well-known"
3838
port:
3939
name: haproxy-wkd
40-
- path: /.well-known/element
41-
pathType: {{ include "element-io.ess-library.ingress.ingress-nginx-dot-path-type" (dict "root" $ "context" .ingress.controllerType) }}
42-
backend:
43-
service:
44-
name: "{{ $.Release.Name }}-well-known"
45-
port:
46-
name: haproxy-wkd
4740
{{- end -}}
4841
{{- end -}}
4942
{{- end -}}

charts/matrix-stack/values.schema.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11549,9 +11549,6 @@
1154911549
"client": {
1155011550
"type": "string"
1155111551
},
11552-
"element": {
11553-
"type": "string"
11554-
},
1155511552
"server": {
1155611553
"type": "string"
1155711554
},

charts/matrix-stack/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4142,5 +4142,4 @@ wellKnownDelegation:
41424142
additional:
41434143
client: "{}"
41444144
server: "{}"
4145-
element: "{}"
41464145
support: "{}"

newsfragments/641.changed.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Remove support for `/.well-known/element/element.json`.
2+
3+
It isn't used by clients of ESS Community.
4+
5+
If you've set it, please remove `wellKnownDelegation.additional.element` from your values files.

tests/integration/test_well_known_delegation.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 New Vector Ltd
1+
# Copyright 2024-2025 New Vector Ltd
22
#
33
# SPDX-License-Identifier: AGPL-3.0-only
44

@@ -42,11 +42,6 @@ async def test_well_known_files_can_be_accessed(
4242
)
4343
assert json_content == {}
4444

45-
json_content = await aiohttp_get_json(
46-
f"https://{generated_data.server_name}/.well-known/element/element.json", ssl_context
47-
)
48-
assert json_content == {}
49-
5045

5146
@pytest.mark.skipif(value_file_has("wellKnownDelegation.enabled", False), reason="WellKnownDelegation not deployed")
5247
@pytest.mark.asyncio_cooperative

tests/manifests/test_well_known_delegation.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,10 @@ async def assert_well_known_files(
2626
make_templates,
2727
expected_client=None,
2828
expected_server=None,
29-
expected_element=None,
3029
client_config=None,
3130
server_config=None,
32-
element_config=None,
3331
support_config=None,
3432
):
35-
if expected_element is None:
36-
expected_element = {}
3733
if expected_server is None:
3834
expected_server = {}
3935
if expected_client is None:
@@ -43,14 +39,11 @@ async def assert_well_known_files(
4339
client_config = {"testclientkey": {"testsubkey": "testvalue"}}
4440
if server_config is None:
4541
server_config = {"testserverkey": {"testsubkey": "testvalue"}}
46-
if element_config is None:
47-
element_config = {"testelementkey": {"testsubkey": "testvalue"}}
4842
if support_config is None:
4943
support_config = {"testsupportkey": {"testsubkey": "testvalue"}}
5044

5145
values["wellKnownDelegation"].setdefault("additional", {})["client"] = json.dumps(client_config)
5246
values["wellKnownDelegation"].setdefault("additional", {})["server"] = json.dumps(server_config)
53-
values["wellKnownDelegation"].setdefault("additional", {})["element"] = json.dumps(element_config)
5447
values["wellKnownDelegation"].setdefault("additional", {})["support"] = json.dumps(support_config)
5548
for template in await make_templates(values):
5649
if template["kind"] == "ConfigMap" and template["metadata"]["name"] == f"{release_name}-well-known-haproxy":
@@ -60,12 +53,11 @@ async def assert_well_known_files(
6053
server_from_json = json.loads(template["data"]["server"])
6154
assert server_from_json == server_config | expected_server
6255

63-
element_from_json = json.loads(template["data"]["element.json"])
64-
assert element_from_json == element_config | expected_element
65-
6656
support_config_from_json = json.loads(template["data"]["support"])
6757
assert support_config == support_config_from_json
6858

59+
assert "element.json" not in template["data"]
60+
6961
break
7062
else:
7163
raise AssertionError("Unable to find WellKnownDelegationConfigMap")

0 commit comments

Comments
 (0)