Move raw API and event schemas into /data directory
Historical note: this was originally a series of several commits, spread out over several weeks. They have been squashed together to make `git annotate` work properly. The original commits were: * 91ab3934 <Will> 2021-01-25 21:16:42 -0800 Add raw API end event schemas into /data directory * aae22f47 <Will> 2021-01-25 21:33:06 -0800 Remove non-data files * 1092d4ca <Will> 2021-01-26 20:41:33 -0800 Add data-compatiuble extension (.yaml) to all data files that currently omit one * 21060109 <Will> 2021-01-26 20:57:28 -0800 Remove symlink to event-schemas, and update openAPI schema paths accordingly * 4f633845 <Travis Ralston> 2021-04-12 21:54:54 -0600 Fix event schema examples too * 301c7b2f <Will> 2021-02-05 10:15:42 -0800 Restore docs describing OpenAPI extensions that we use
This commit is contained in:
parent
a26c352d78
commit
00c6a866e2
327 changed files with 82 additions and 10822 deletions
215
data/api/client-server/login.yaml
Normal file
215
data/api/client-server/login.yaml
Normal file
|
@ -0,0 +1,215 @@
|
|||
# Copyright 2016 OpenMarket Ltd
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# 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.
|
||||
swagger: '2.0'
|
||||
info:
|
||||
title: "Matrix Client-Server Registration and Login API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/login":
|
||||
get:
|
||||
summary: Get the supported login types to authenticate users
|
||||
description: |-
|
||||
Gets the homeserver's supported login types to authenticate users. Clients
|
||||
should pick one of these and supply it as the ``type`` when logging in.
|
||||
operationId: getLoginFlows
|
||||
responses:
|
||||
200:
|
||||
description: The login types the homeserver supports
|
||||
examples:
|
||||
application/json: {
|
||||
"flows": [
|
||||
{"type": "m.login.password"}
|
||||
]
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
flows:
|
||||
type: array
|
||||
description: The homeserver's supported login types
|
||||
items:
|
||||
type: object
|
||||
title: LoginFlow
|
||||
properties:
|
||||
type:
|
||||
description: |-
|
||||
The login type. This is supplied as the ``type`` when
|
||||
logging in.
|
||||
type: string
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
"$ref": "definitions/errors/rate_limited.yaml"
|
||||
tags:
|
||||
- Session management
|
||||
post:
|
||||
summary: Authenticates the user.
|
||||
description: |-
|
||||
Authenticates the user, and issues an access token they can
|
||||
use to authorize themself in subsequent requests.
|
||||
|
||||
If the client does not supply a ``device_id``, the server must
|
||||
auto-generate one.
|
||||
|
||||
The returned access token must be associated with the ``device_id``
|
||||
supplied by the client or generated by the server. The server may
|
||||
invalidate any access token previously associated with that device. See
|
||||
`Relationship between access tokens and devices`_.
|
||||
operationId: login
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"type": "m.login.password",
|
||||
"identifier": {
|
||||
"type": "m.id.user",
|
||||
"user": "cheeky_monkey"
|
||||
},
|
||||
"password": "ilovebananas",
|
||||
"initial_device_display_name": "Jungle Phone"
|
||||
}
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum: ["m.login.password", "m.login.token"]
|
||||
description: The login type being used.
|
||||
identifier:
|
||||
"$ref": "definitions/user_identifier.yaml"
|
||||
user:
|
||||
type: string
|
||||
description: The fully qualified user ID or just local part of the user ID, to log in. Deprecated in favour of ``identifier``.
|
||||
medium:
|
||||
type: string
|
||||
description: When logging in using a third party identifier, the medium of the identifier. Must be 'email'. Deprecated in favour of ``identifier``.
|
||||
address:
|
||||
type: string
|
||||
description: Third party identifier for the user. Deprecated in favour of ``identifier``.
|
||||
password:
|
||||
type: string
|
||||
description: |-
|
||||
Required when ``type`` is ``m.login.password``. The user's
|
||||
password.
|
||||
token:
|
||||
type: string
|
||||
description: |-
|
||||
Required when ``type`` is ``m.login.token``. Part of `Token-based`_ login.
|
||||
device_id:
|
||||
type: string
|
||||
description: |-
|
||||
ID of the client device. If this does not correspond to a
|
||||
known client device, a new device will be created. The given
|
||||
device ID must not be the same as a `cross-signing key ID
|
||||
<#cross-signing>`_. The server will auto-generate a device_id
|
||||
if this is not specified.
|
||||
initial_device_display_name:
|
||||
type: string
|
||||
description: |-
|
||||
A display name to assign to the newly-created device. Ignored
|
||||
if ``device_id`` corresponds to a known device.
|
||||
required: ["type"]
|
||||
|
||||
responses:
|
||||
200:
|
||||
description: The user has been authenticated.
|
||||
examples:
|
||||
application/json: {
|
||||
"user_id": "@cheeky_monkey:matrix.org",
|
||||
"access_token": "abc123",
|
||||
"device_id": "GHTYAJCE",
|
||||
"well_known": {
|
||||
"m.homeserver": {
|
||||
"base_url": "https://example.org"
|
||||
},
|
||||
"m.identity_server": {
|
||||
"base_url": "https://id.example.org"
|
||||
}
|
||||
}
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
description: The fully-qualified Matrix ID for the account.
|
||||
access_token:
|
||||
type: string
|
||||
description: |-
|
||||
An access token for the account.
|
||||
This access token can then be used to authorize other requests.
|
||||
home_server:
|
||||
type: string
|
||||
description: |-
|
||||
The server_name of the homeserver on which the account has
|
||||
been registered.
|
||||
|
||||
**Deprecated**. Clients should extract the server_name from
|
||||
``user_id`` (by splitting at the first colon) if they require
|
||||
it. Note also that ``homeserver`` is not spelt this way.
|
||||
device_id:
|
||||
type: string
|
||||
description: |-
|
||||
ID of the logged-in device. Will be the same as the
|
||||
corresponding parameter in the request, if one was specified.
|
||||
well_known:
|
||||
description: |-
|
||||
Optional client configuration provided by the server. If present,
|
||||
clients SHOULD use the provided object to reconfigure themselves,
|
||||
optionally validating the URLs within. This object takes the same
|
||||
form as the one returned from .well-known autodiscovery.
|
||||
allOf:
|
||||
- "$ref": "definitions/wellknown/full.yaml"
|
||||
400:
|
||||
description: |-
|
||||
Part of the request was invalid. For example, the login type may not be recognised.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_UNKNOWN",
|
||||
"error": "Bad login type."
|
||||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
403:
|
||||
description: |-
|
||||
The login attempt failed. This can include one of the following error codes:
|
||||
* ``M_FORBIDDEN``: The provided authentication data was incorrect
|
||||
or the requested device ID is the same as a cross-signing key
|
||||
ID.
|
||||
* ``M_USER_DEACTIVATED``: The user has been deactivated.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
"$ref": "definitions/errors/rate_limited.yaml"
|
||||
tags:
|
||||
- Session management
|
Loading…
Add table
Add a link
Reference in a new issue