various minor fixes

- formatting fixes
- add examples to homeserver/identity server discovery schema
- replace DNS name with hostname
This commit is contained in:
Hubert Chathi 2018-08-14 17:58:57 -04:00
parent 6a3cf10be9
commit fcca80dad8
4 changed files with 19 additions and 17 deletions

View file

@ -16,8 +16,9 @@ description: |-
Used by clients to discover homeserver information. Used by clients to discover homeserver information.
type: object type: object
properties: properties:
base_url: base_url:
type: string type: string
description: The base URL for the homeserver for client-server connections. description: The base URL for the homeserver for client-server connections.
example: https://matrix.example.com
required: required:
- base_url - base_url

View file

@ -16,8 +16,9 @@ description: |-
Used by clients to discover identity server information. Used by clients to discover identity server information.
type: object type: object
properties: properties:
base_url: base_url:
type: string type: string
description: The base URL for the identity server for client-server connections. description: The base URL for the identity server for client-server connections.
example: https://identity.example.com
required: required:
- base_url - base_url

View file

@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
swagger: '2.0' swagger: '2.0'
info: info:
title: "Matrix Client-Server server discovery API" title: "Matrix Client-Server Server Discovery API"
version: "1.0.0" version: "1.0.0"
host: localhost:8008 host: localhost:8008
schemes: schemes:
@ -26,7 +26,7 @@ paths:
get: get:
summary: Gets Matrix server discovery information about the domain. summary: Gets Matrix server discovery information about the domain.
description: |- description: |-
Gets discovery information about the domain. The file may include Gets discovery information about the domain. The file may include
additional keys, which MUST follow the Java package naming convention, additional keys, which MUST follow the Java package naming convention,
e.g. ``com.example.myapp.property``. This ensures property names are e.g. ``com.example.myapp.property``. This ensures property names are
suitably namespaced for each application and reduces the risk of suitably namespaced for each application and reduces the risk of
@ -37,7 +37,7 @@ paths:
operationId: getWellknown operationId: getWellknown
responses: responses:
200: 200:
description: Server discovery information description: Server discovery information.
examples: examples:
application/json: { application/json: {
"m.homeserver": { "m.homeserver": {
@ -61,6 +61,6 @@ paths:
required: required:
- m.homeserver - m.homeserver
404: 404:
description: No server discovery information available description: No server discovery information available.
tags: tags:
- Server administration - Server administration

View file

@ -219,12 +219,12 @@ Well-known URI
++++++++++++++ ++++++++++++++
The ``.well-known`` method uses a JSON file at a predetermined location to The ``.well-known`` method uses a JSON file at a predetermined location to
specify parameter values. The flow for this method is as follows: specify parameter values. The flow for this method is as follows:
1. Extract the server name from the user's Matrix ID by splitting the Matrix ID 1. Extract the server name from the user's Matrix ID by splitting the Matrix ID
at the first colon. at the first colon.
2. Extract the DNS name from the server name. 2. Extract the hostname from the server name.
3. Make a GET request to ``https://dns_name/.well-known/matrix/client``. 3. Make a GET request to ``https://hostname/.well-known/matrix/client``.
a. If the returned status code is 404, then ``IGNORE``. a. If the returned status code is 404, then ``IGNORE``.
b. If the returned status code is not 200, or the response body is empty, b. If the returned status code is not 200, or the response body is empty,
@ -233,17 +233,17 @@ specify parameter values. The flow for this method is as follows:
i. If the content cannot be parsed, then ``FAIL_PROMPT``. i. If the content cannot be parsed, then ``FAIL_PROMPT``.
d. Extract the ``base_url`` value from the ``m.homeserver`` property. This d. Extract the ``base_url`` value from the ``m.homeserver`` property. This
value is to be used as the base URL of the homeserver. value is to be used as the base URL of the homeserver.
i. If this value is not provided, then ``FAIL_PROMPT``. i. If this value is not provided, then ``FAIL_PROMPT``.
e. Validate the homeserver base URL: e. Validate the homeserver base URL:
i. Parse it as a URL. If it is not a URL, then ``FAIL_ERROR``. i. Parse it as a URL. If it is not a URL, then ``FAIL_ERROR``.
ii. Clients SHOULD validate that the URL points to a valid homeserver ii. Clients SHOULD validate that the URL points to a valid homeserver
before accepting it by connecting to the ``/_matrix/client/versions`` before accepting it by connecting to the ``/_matrix/client/versions``
endpoint, and parsing and validating the data. If any step in the endpoint, and parsing and validating the data. If any step in the
validation fails, then ``FAIL_ERROR``. Validation is done as a simple validation fails, then ``FAIL_ERROR``. Validation is done as a simple
check against configuration errors, before sending sensitive check against configuration errors, before sending sensitive
information such as a user's password to the server. information such as a user's password to the server.
@ -251,7 +251,7 @@ specify parameter values. The flow for this method is as follows:
f. If the ``m.identity_server`` property is present, extract the f. If the ``m.identity_server`` property is present, extract the
``base_url`` value for use as the base URL of the identity server. ``base_url`` value for use as the base URL of the identity server.
Validation for this URL is done as in the step above, but using Validation for this URL is done as in the step above, but using
``/_matrix/identity/api/v1`` as the endpoint to connect to. If the ``/_matrix/identity/api/v1`` as the endpoint to connect to. If the
``m.identity_server`` property is present, but does not have a ``m.identity_server`` property is present, but does not have a
``base_url`` value, then ``FAIL_ERROR``. ``base_url`` value, then ``FAIL_ERROR``.