Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Synapse uses an unstable prefix for thirdparty application service requests #11158

Closed
babolivier opened this issue Oct 22, 2021 · 4 comments · Fixed by #15317
Closed

Synapse uses an unstable prefix for thirdparty application service requests #11158

babolivier opened this issue Oct 22, 2021 · 4 comments · Fixed by #15317
Assignees
Labels
A-Spec-Compliance places where synapse does not conform to the spec O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution

Comments

@babolivier
Copy link
Contributor

The appservice code has an APP_SERVICE_PREFIX constant:

APP_SERVICE_PREFIX = "/_matrix/app/unstable"

Which it then uses for any .../thirdparty/... request:

uri = "%s%s/thirdparty/%s/%s" % (
service.url,
APP_SERVICE_PREFIX,
kind,
urllib.parse.quote(protocol),
)

uri = "%s%s/thirdparty/protocol/%s" % (
service.url,
APP_SERVICE_PREFIX,
urllib.parse.quote(protocol),
)

However, the spec says that these endpoints should have the prefix /_matrix/app/v1, not /_matrix/app/unstable. This means that if an application service correctly implements the spec, Synapse will 404 when trying to contact it on these endpoints (when e.g. looking up which third-party protocol an application service uses).

@babolivier babolivier added A-Spec-Compliance places where synapse does not conform to the spec T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels Oct 22, 2021
@babolivier
Copy link
Contributor Author

According to the bridges team, https://github.com/matrix-org/matrix-appservice-bridge supports both endpoints so won't be impacted when we fix this.

https://github.com/mautrix/go and https://github.com/mautrix/python don't seem to support either version of this endpoint.

These are all the appservice frameworks I know, but I don't claim to know all of them, though, so just to be sure we can always implement a temporary fallback to /unstable if the /v1 request fails, with a deprecation notice in the changelog and upgrade notes.

@Half-Shot
Copy link
Collaborator

Half-Shot commented Oct 22, 2021

The matrix-bot-sdk is also fine

@S7evinK
Copy link
Contributor

S7evinK commented Oct 26, 2022

Stumbled over this while trying to update Sytest - matrix-org/sytest#1310

@DMRobertson
Copy link
Contributor

We should Just Do This.

@clokep clokep added Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution S-Minor Blocks non-critical functionality, workarounds exist. O-Occasional Affects or can be seen by some users regularly or most users rarely labels Nov 7, 2022
@H-Shay H-Shay self-assigned this Feb 14, 2023
@clokep clokep assigned clokep and unassigned H-Shay Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Spec-Compliance places where synapse does not conform to the spec O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants