-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add server support discovery endpoint #1733
Changes from 3 commits
b819299
4b8a285
6ca233c
a9ae4c2
a88d3a3
fc5b7f0
ce44a39
5571635
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add server support discovery endpoint, as per [MSC1929](https://github.com/matrix-org/matrix-spec-proposals/pull/1929). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# Copyright 2018 New Vector Ltd | ||
zecakeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
openapi: 3.1.0 | ||
info: | ||
title: Matrix Client-Server Support Discovery API | ||
version: 1.0.0 | ||
paths: | ||
/matrix/support: | ||
get: | ||
summary: Gets Matrix server admin contact and support page of the domain. | ||
zecakeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
description: |- | ||
Gets server admin contact and support page of the domain. | ||
|
||
Like the [well-known discovery URI](/client-server-api/#well-known-uri), | ||
this should be accessed with the hostname of the homeserver, by making a | ||
zecakeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
GET request to `https://hostname/.well-known/matrix/support`. | ||
|
||
Note that this endpoint is not necessarily handled by the homeserver, | ||
but by another webserver, to be used for discovering support information | ||
for the homeserver. | ||
zecakeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
operationId: getWellknownSupport | ||
x-addedInMatrixVersion: "1.10" | ||
responses: | ||
"200": | ||
description: Server support information. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
contacts: | ||
type: array | ||
description: |- | ||
Ways to contact the server administrator. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should define "administrator" somewhere here. I believe the MSC had some notion of what the admin's contact could be used for - can we incorporate that into the schema somewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see anything on the MSC about why the admins would be contacted, other than the description of the |
||
|
||
At least one of `contacts` or `support_page` is required. | ||
If only this is set, it must contain at least one item. | ||
zecakeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
items: | ||
type: object | ||
title: Contact | ||
description: A way to contact the server administrator. | ||
properties: | ||
matrix_id: | ||
type: string | ||
description: |- | ||
A Matrix User ID allowing to contact the | ||
administrator. | ||
zecakeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
It could be an account registered on a different | ||
homeserver so the administrator can be contacted | ||
when the homeserver is down. | ||
|
||
At least one of `matrix_id` or `email_address` is | ||
required. | ||
email_address: | ||
type: string | ||
description: |- | ||
An email address allowing to contact the | ||
administrator. | ||
zecakeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
At least one of `matrix_id` or `email_address` is | ||
required. | ||
role: | ||
type: string | ||
enum: | ||
- "m.role.admin" | ||
- "m.role.security" | ||
description: |- | ||
An informal description of what the contact methods | ||
are used for. | ||
|
||
`m.role.admin` is a catch-all user for any queries | ||
zecakeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
and `m.role.security` is intended for sensitive | ||
requests. | ||
|
||
Unspecified roles are permitted through the use of | ||
[Namespaced Identifiers](/appendices/#common-namespaced-identifier-grammar). | ||
required: | ||
- role | ||
example: { | ||
"matrix_id": "@admin:example.org", | ||
"email_address": "[email protected]", | ||
"role": "m.role.admin" | ||
} | ||
support_page: | ||
type: string | ||
description: |- | ||
The URL of a page to give users help specific to the | ||
homeserver, like extra login/registration steps. | ||
|
||
At least one of `contacts` or `support_page` is required. | ||
example: "https://example.org/support.html" | ||
examples: | ||
response: | ||
value: | ||
{ | ||
"contacts": [ | ||
{ | ||
"matrix_id": "@admin:example.org", | ||
"email_address": "[email protected]", | ||
"role": "m.role.admin" | ||
}, | ||
{ | ||
"email_address": "[email protected]", | ||
"role": "m.role.security" | ||
} | ||
], | ||
"support_page": "https://example.org/support.html" | ||
} | ||
"404": | ||
description: No server support information available. | ||
tags: | ||
- Server administration | ||
servers: | ||
- url: "{protocol}://{hostname}{basePath}" | ||
variables: | ||
protocol: | ||
enum: | ||
- http | ||
zecakeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- https | ||
default: https | ||
hostname: | ||
default: localhost:8008 | ||
basePath: | ||
default: /.well-known |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced this belongs under "Server discovery". I'd be inclined to put it in a new "Module", but I'm open to other suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rationale behind the suggestion to put it here is you're discovering information about the server without necessarily needing to speak the rest of Matrix. Both authenticated and unauthenticated clients can use this, and it's "before" the homeserver APIs really start to do anything.
Arguably though, we should rename or introduce a section for
.well-known
stuff. I think this is best left to a future PR at this stage.