Skip to content

Commit be5c566

Browse files
committed
Version all appservice endpoints and provide a fallback
Fixes #1616
1 parent ab14f33 commit be5c566

File tree

5 files changed

+37
-9
lines changed

5 files changed

+37
-9
lines changed

api/application-service/protocols.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ host: localhost:8008
1919
schemes:
2020
- https
2121
- http
22-
basePath: "/"
22+
basePath: /_matrix/app/v1
2323
consumes:
2424
- application/json
2525
produces:
2626
- application/json
2727
paths:
28-
"/_matrix/app/unstable/thirdparty/protocol/{protocol}":
28+
"/thirdparty/protocol/{protocol}":
2929
get:
3030
summary: Retrieve metadata about a specific protocol that the application service supports.
3131
description: |-
@@ -72,7 +72,7 @@ paths:
7272
}
7373
schema:
7474
$ref: ../client-server/definitions/errors/error.yaml
75-
"/_matrix/app/unstable/thirdparty/user/{protocol}":
75+
"/thirdparty/user/{protocol}":
7676
get:
7777
summary: Retrieve the Matrix User ID of a corresponding third party user.
7878
description: |-
@@ -125,7 +125,7 @@ paths:
125125
}
126126
schema:
127127
$ref: ../client-server/definitions/errors/error.yaml
128-
"/_matrix/app/unstable/thirdparty/location/{protocol}":
128+
"/thirdparty/location/{protocol}":
129129
get:
130130
summary: Retrieve Matrix-side portal rooms leading to a third party location.
131131
description: |-
@@ -176,7 +176,7 @@ paths:
176176
}
177177
schema:
178178
$ref: ../client-server/definitions/errors/error.yaml
179-
"/_matrix/app/unstable/thirdparty/location":
179+
"/thirdparty/location":
180180
get:
181181
summary: Reverse-lookup third party locations given a Matrix room alias.
182182
description: |-
@@ -221,7 +221,7 @@ paths:
221221
}
222222
schema:
223223
$ref: ../client-server/definitions/errors/error.yaml
224-
"/_matrix/app/unstable/thirdparty/user":
224+
"/thirdparty/user":
225225
get:
226226
summary: Reverse-lookup third party users given a Matrix User ID.
227227
description: |-

api/application-service/query_room.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ host: localhost:8008
2020
schemes:
2121
- https
2222
- http
23-
basePath: "/"
23+
basePath: /_matrix/app/v1
2424
consumes:
2525
- application/json
2626
produces:

api/application-service/query_user.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ host: localhost:8008
2020
schemes:
2121
- https
2222
- http
23-
basePath: "/"
23+
basePath: /_matrix/app/v1
2424
consumes:
2525
- application/json
2626
produces:

api/application-service/transactions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ host: localhost:8008
2020
schemes:
2121
- https
2222
- http
23-
basePath: "/"
23+
basePath: /_matrix/app/v1
2424
produces:
2525
- application/json
2626
paths:

specification/application_service_api.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,34 @@ An example registration file for an IRC-bridging application service is below:
169169
Homeserver -> Application Service API
170170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171171

172+
Legacy routes
173+
+++++++++++++
174+
175+
Previous drafts of the application service specification had a mix of endpoints
176+
that have been used in the wild for a significant amount of time. The application
177+
service specification now defines a version on all endpoints to be more compatible
178+
with the rest of the Matrix specification and the future.
179+
180+
Homeservers should attempt to use the specified endpoints first when communicating
181+
with application services. However, if the application service receives an http status
182+
code that does not indicate success (ie: 404, 500, 501, etc) then the homeserver
183+
should fall back to the older endpoints for the application service.
184+
185+
The older endpoints have the exact same request body and response format, they
186+
just belong at a different path. The equivalent path for each is as follows:
187+
188+
* ``/_matrix/app/v1/transactions/{txnId}`` becomes ``/transactions/{txnId}``
189+
* ``/_matrix/app/v1/users/{userId}`` becomes ``/users/{userId}``
190+
* ``/_matrix/app/v1/rooms/{roomAlias}`` becomes ``/rooms/{roomAlias}``
191+
* ``/_matrix/app/v1/thirdparty/protocol/{protocol}`` becomes ``/_matrix/app/unstable/thirdparty/protocol/{protocol}``
192+
* ``/_matrix/app/v1/thirdparty/user/{user}`` becomes ``/_matrix/app/unstable/thirdparty/user/{user}``
193+
* ``/_matrix/app/v1/thirdparty/location/{location}`` becomes ``/_matrix/app/unstable/thirdparty/location/{location}``
194+
* ``/_matrix/app/v1/thirdparty/user`` becomes ``/_matrix/app/unstable/thirdparty/user``
195+
* ``/_matrix/app/v1/thirdparty/location`` becomes ``/_matrix/app/unstable/thirdparty/location``
196+
197+
Homeservers should periodically try again for the newer endpoints because the
198+
application service may have been updated.
199+
172200
Pushing events
173201
++++++++++++++
174202

0 commit comments

Comments
 (0)