Merge remote-tracking branch 'matrix-org/master' into mujx/missing-enum-fields
commit
adef7babfa
@ -0,0 +1,124 @@
|
||||
gendoc: &gendoc
|
||||
name: Generate the docs
|
||||
command: |
|
||||
source /env/bin/activate
|
||||
scripts/gendoc.py
|
||||
|
||||
genswagger: &genswagger
|
||||
name: Generate the swagger
|
||||
command: |
|
||||
source /env/bin/activate
|
||||
scripts/dump-swagger.py
|
||||
|
||||
buildswaggerui: &buildswaggerui
|
||||
name: Build Swagger UI
|
||||
command: |
|
||||
ls scripts/
|
||||
mkdir -p api/client-server
|
||||
git clone https://github.com/matrix-org/swagger-ui swagger-ui
|
||||
cp -r swagger-ui/dist/* api/client-server/
|
||||
mkdir -p api/client-server/json
|
||||
cp scripts/swagger/api-docs.json api/client-server/json/
|
||||
wget https://raw.githubusercontent.com/matrix-org/matrix.org/master/content/swagger.css -O api/client-server/swagger.css
|
||||
wget https://raw.githubusercontent.com/matrix-org/matrix.org/master/scripts/swagger-ui.patch
|
||||
patch api/client-server/index.html swagger-ui.patch
|
||||
|
||||
checkexamples: &checkexamples
|
||||
name: Check Event Examples
|
||||
command: |
|
||||
source /env/bin/activate
|
||||
cd event-schemas
|
||||
./check_examples.py
|
||||
cd ../api
|
||||
./check_examples.py
|
||||
|
||||
genmatrixassets: &genmatrixassets
|
||||
name: Generate/Verify matrix.org assets
|
||||
command: |
|
||||
source /env/bin/activate
|
||||
./scripts/generate-matrix-org-assets
|
||||
|
||||
validateapi: &validateapi
|
||||
name: Validate OpenAPI specifications
|
||||
command: |
|
||||
cd api
|
||||
npm install
|
||||
node validator.js -s "client-server"
|
||||
|
||||
buildspeculator: &buildspeculator
|
||||
name: Build Speculator
|
||||
command: |
|
||||
cd scripts/speculator
|
||||
go build -v
|
||||
|
||||
buildcontinuserv: &buildcontinuserv
|
||||
name: Build Continuserv
|
||||
command: |
|
||||
cd scripts/continuserv
|
||||
go build -v
|
||||
|
||||
version: 2
|
||||
jobs:
|
||||
validate-docs:
|
||||
docker:
|
||||
- image: node:alpine
|
||||
steps:
|
||||
- checkout
|
||||
- run: *validateapi
|
||||
check-docs:
|
||||
docker:
|
||||
- image: uhoreg/matrix-doc-build
|
||||
steps:
|
||||
- checkout
|
||||
- run: *checkexamples
|
||||
- run: *genmatrixassets # We don't actually use the assets, but we do want to make sure they build
|
||||
build-docs:
|
||||
docker:
|
||||
- image: uhoreg/matrix-doc-build
|
||||
steps:
|
||||
- checkout
|
||||
- run: *gendoc
|
||||
- store_artifacts:
|
||||
path: scripts/gen
|
||||
- run:
|
||||
name: "Doc build is available at:"
|
||||
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/scripts/gen/index.html"; echo $DOCS_URL
|
||||
build-swagger:
|
||||
docker:
|
||||
- image: uhoreg/matrix-doc-build
|
||||
steps:
|
||||
- checkout
|
||||
- run: *genswagger
|
||||
- run: *buildswaggerui
|
||||
- store_artifacts:
|
||||
path: api/client-server/
|
||||
- run:
|
||||
name: "Swagger UI is available at:"
|
||||
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/api/client-server/index.html"; echo $DOCS_URL
|
||||
build-dev-scripts:
|
||||
docker:
|
||||
- image: golang:1.8
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Install Dependencies
|
||||
command: |
|
||||
go get -v github.com/hashicorp/golang-lru
|
||||
go get -v gopkg.in/fsnotify/fsnotify.v1
|
||||
- run: *buildcontinuserv
|
||||
- run: *buildspeculator
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
|
||||
build-spec:
|
||||
jobs:
|
||||
- build-docs
|
||||
- build-swagger
|
||||
- check-docs
|
||||
- validate-docs
|
||||
- build-dev-scripts
|
||||
|
||||
notify:
|
||||
webhooks:
|
||||
- url: https://giles.cadair.com/circleci
|
@ -1,10 +1,13 @@
|
||||
scripts/gen
|
||||
scripts/continuserv/continuserv
|
||||
scripts/speculator/speculator
|
||||
/api/node_modules
|
||||
/assets
|
||||
/assets.tar.gz
|
||||
/env*
|
||||
/scripts/gen
|
||||
/scripts/continuserv/continuserv
|
||||
/scripts/speculator/speculator
|
||||
/scripts/swagger
|
||||
templating/out
|
||||
/scripts/tmp
|
||||
/templating/out
|
||||
*.pyc
|
||||
*.swp
|
||||
supporting-docs/_site
|
||||
supporting-docs/.sass-cache
|
||||
api/node_modules
|
||||
_rendered.rst
|
||||
|
@ -1,39 +1,141 @@
|
||||
This repository contains the documentation for Matrix.
|
||||
This repository contains the Matrix specification.
|
||||
|
||||
Structure
|
||||
=========
|
||||
If you want to ask more about the specification, join us on
|
||||
`#matrix-dev:matrix.org <http://matrix.to/#/#matrix-dev:matrix.org>`_.
|
||||
|
||||
We welcome contributions to the spec! See the notes below on `Building the
|
||||
specification`_, and `<CONTRIBUTING.rst>`_ to get started making contributions.
|
||||
|
||||
Note that the Matrix Project lists, which were previously kept in this
|
||||
repository, are now in https://github.com/matrix-org/matrix.org.
|
||||
|
||||
Structure of this repository
|
||||
============================
|
||||
|
||||
- ``api`` : Contains the HTTP API specification.
|
||||
- ``attic``: Contains historical sections of specification for reference
|
||||
- ``api`` : `OpenAPI`_ (swagger) specifications for the the HTTP APIs.
|
||||
- ``attic``: historical sections of specification for reference
|
||||
purposes.
|
||||
- ``changelogs``: Contains change logs for the various parts of the
|
||||
- ``changelogs``: change logs for the various parts of the
|
||||
specification.
|
||||
- ``drafts``: Previously, contained documents which were under discussion for
|
||||
future incusion into the specification and/or supporting documentation. This
|
||||
is now historical, as we use separate discussion documents (see
|
||||
`<CONTRIBUTING.rst>`_).
|
||||
- ``event-schemas``: Contains the `JSON Schema`_ for all Matrix events
|
||||
- ``event-schemas``: the `JSON Schema`_ for all Matrix events
|
||||
contained in the specification, along with example JSON files.
|
||||
- ``meta``: Contains documents outlining the processes involved when writing
|
||||
- ``meta``: documents outlining the processes involved when writing
|
||||
documents, e.g. documentation style, guidelines.
|
||||
- ``scripts``: Contains scripts to generate formatted versions of the
|
||||
- ``scripts``: scripts to generate formatted versions of the
|
||||
documentation, typically HTML.
|
||||
- ``specification``: Contains the specification split up into sections.
|
||||
- ``supporting-docs``: Contains additional documents which explain design
|
||||
decisions, examples, use cases, etc.
|
||||
- ``templating``: Contains the templates and templating system used to
|
||||
generate the spec.
|
||||
- ``specification``: the specification split up into sections.
|
||||
|
||||
Contributing
|
||||
============
|
||||
.. _OpenAPI: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
|
||||
.. _JSON Schema: http://json-schema.org/
|
||||
|
||||
Known issues with the specification are represented as JIRA issues at
|
||||
`<https://matrix.org/jira/browse/SPEC>`_.
|
||||
Building the specification
|
||||
==========================
|
||||
|
||||
If you want to ask more about the specification, join us on
|
||||
`#matrix-dev:matrix.org <http://matrix.to/#/#matrix-dev:matrix.org>`_.
|
||||
The Matrix Spec is generated by a set of scripts, from the RST documents, API
|
||||
specs and event schemas in this repository.
|
||||
|
||||
If you would like to contribute to the specification or supporting
|
||||
documentation, see `<CONTRIBUTING.rst>`_.
|
||||
Preparation
|
||||
-----------
|
||||
|
||||
.. _JSON Schema: http://json-schema.org/
|
||||
To use the scripts, it is best to create a Python 3.4+ virtualenv as follows::
|
||||
|
||||
virtualenv -p python3 env
|
||||
env/bin/pip install -r scripts/requirements.txt
|
||||
|
||||
(Benjamin Synders has contributed a script for `Nix`_ users, which can be
|
||||
invoked with ``nix-shell scripts/contrib/shell.nix``.)
|
||||
|
||||
.. TODO: Possibly we need some libs installed; should record what they are.
|
||||
|
||||
.. _`Nix`: https://nixos.org/nix/
|
||||
|
||||
Generating the specification
|
||||
----------------------------
|
||||
|
||||
To rebuild the specification, use ``scripts/gendoc.py``::
|
||||
|
||||
source env/bin/activate
|
||||
./scripts/gendoc.py
|
||||
|
||||
The above will write the rendered version of the specification to
|
||||
``scripts/gen``. To view it, point your browser at ``scripts/gen/index.html``.
|
||||
|
||||
Windows users
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
If you're on Windows Vista or higher, be sure that the "Symbolic Links"
|
||||
option was selected when installing Git prior to cloning this repository. If
|
||||
you're still seeing errors about files not being found it is likely because
|
||||
the symlink at ``api/client-server/definitions/event-schemas`` looks like a
|
||||
file. To correct the problem, open an Administrative/Elevated shell in your
|
||||
cloned matrix-doc directory and run the following::
|
||||
|
||||
cd api\client-server\definitions
|
||||
del event-schemas
|
||||
mklink /D event-schemas "..\..\..\event-schemas"
|
||||
|
||||
This will delete the file and replace it with a symlink. Git should not detect
|
||||
this as a change, and you should be able to go back to building the project.
|
||||
|
||||
Generating the OpenAPI (Swagger) specs
|
||||
--------------------------------------
|
||||
|
||||
`Swagger`_ is a framework for representing RESTful APIs. We use it to generate
|
||||
interactive documentation for our APIs.
|
||||
|
||||
Before the Swagger docs can be used in the Swagger UI (or other tool expecting
|
||||
a Swagger specs, they must be combined into a single json file. This can be
|
||||
done as follows::
|
||||
|
||||
source env/bin/activate
|
||||
./scripts/dump-swagger.py
|
||||
|
||||
By default, ``dump-swagger`` will write to ``scripts/swagger/api-docs.json``.
|
||||
|
||||
To make use of the generated file, there are a number of options:
|
||||
|
||||
* It can be uploaded from your filesystem to an online editor/viewer such as
|
||||
http://editor.swagger.io/
|
||||
* You can run a local HTTP server by running
|
||||
``./scripts/swagger-http-server.py``, and then view the documentation via an
|
||||
online viewer; for example, at
|
||||
http://petstore.swagger.io/?url=http://localhost:8000/api-docs.json
|
||||
* You can host the swagger UI yourself. See
|
||||
https://github.com/swagger-api/swagger-ui#how-to-run for advice on how to do
|
||||
so.
|
||||
|
||||
.. _`Swagger`: http://swagger.io/
|
||||
|
||||
Continuserv
|
||||
-----------
|
||||
|
||||
Continuserv is a script which will rebuild the specification every time a file
|
||||
is changed, and will serve it to a browser over HTTP. It is intended for use by
|
||||
specification authors, so that they can quickly see the effects of their
|
||||
changes.
|
||||
|
||||
It is written in Go, so you will need the ``go`` compiler installed on your
|
||||
computer. You will also need to install fsnotify by running::
|
||||
|
||||
go get gopkg.in/fsnotify/fsnotify.v1
|
||||
|
||||
Then, create a virtualenv as described above under `Preparation`_,
|
||||
and::
|
||||
|
||||
source env/bin/activate
|
||||
go run ./scripts/continuserv/main.go
|
||||
|
||||
You will then be able to view the generated spec by visiting
|
||||
http://localhost:8000/index.html.
|
||||
|
||||
Issue tracking
|
||||
==============
|
||||
|
||||
Issues with the Matrix specification are tracked in `GitHub
|
||||
<https://github.com/matrix-org/matrix-doc/issues>`_.
|
||||
|
||||
See `meta/labels.rst <meta/labels.rst>`_ for notes on what the labels mean.
|
||||
|
@ -1,3 +1,2 @@
|
||||
This directory contains swagger-compatible representations of our APIs. See
|
||||
scripts/README.md for details on how to make use of them.
|
||||
|
||||
the main README.rst for details on how to make use of them.
|
||||
|
@ -1,213 +0,0 @@
|
||||
# Copyright 2016 OpenMarket 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 Application Service API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: "/"
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/transactions/{txnId}":
|
||||
put:
|
||||
summary: Send some events to the application service.
|
||||
description: |-
|
||||
This API is called by the HS when the HS wants to push an event (or
|
||||
batch of events) to the AS.
|
||||
parameters:
|
||||
- in: path
|
||||
name: txnId
|
||||
type: string
|
||||
description: |-
|
||||
The transaction ID for this set of events. Homeservers generate
|
||||
these IDs and they are used to ensure idempotency of requests.
|
||||
required: true
|
||||
x-example: "35"
|
||||
- in: body
|
||||
name: body
|
||||
description: A list of events
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
"events": [
|
||||
{
|
||||
"age": 32,
|
||||
"content": {
|
||||
"body": "incoming message",
|
||||
"msgtype": "m.text"
|
||||
},
|
||||
"event_id": "$14328055551tzaee:localhost",
|
||||
"origin_server_ts": 1432804485886,
|
||||
"room_id": "!TmaZBKYIFrIPVGoUYp:localhost",
|
||||
"type": "m.room.message",
|
||||
"user_id": "@bob:localhost"
|
||||
},
|
||||
{
|
||||
"age": 1984,
|
||||
"content": {
|
||||
"body": "another incoming message",
|
||||
"msgtype": "m.text"
|
||||
},
|
||||
"event_id": "$1228055551ffsef:localhost",
|
||||
"origin_server_ts": 1432804485886,
|
||||
"room_id": "!TmaZBKYIFrIPVGoUYp:localhost",
|
||||
"type": "m.room.message",
|
||||
"user_id": "@bob:localhost"
|
||||
}
|
||||
]
|
||||
}
|
||||
description: "Transaction informations"
|
||||
properties:
|
||||
events:
|
||||
type: array
|
||||
description: A list of events
|
||||
items:
|
||||
type: object
|
||||
title: Event
|
||||
required: ["events"]
|
||||
responses:
|
||||
200:
|
||||
description: The transaction was processed successfully.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
schema:
|
||||
type: object
|
||||
|
||||
"/rooms/{roomAlias}":
|
||||
get:
|
||||
summary: Query if a room alias should exist on the application service.
|
||||
description: |-
|
||||
This endpoint is invoked by the homeserver on an application service to query
|
||||
the existence of a given room alias. The homeserver will only query room
|
||||
aliases inside the application service's ``aliases`` namespace. The
|
||||
homeserver will send this request when it receives a request to join a
|
||||
room alias within the application service's namespace.
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomAlias
|
||||
type: string
|
||||
description: The room alias being queried.
|
||||
required: true
|
||||
x-example: "#magicforest:example.com"
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
The application service indicates that this room alias exists. The
|
||||
application service MUST have created a room and associated it with
|
||||
the queried room alias using the client-server API. Additional
|
||||
information about the room such as its name and topic can be set
|
||||
before responding.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
schema:
|
||||
type: object
|
||||
401:
|
||||
description: |-
|
||||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
"errcode": "M_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
404:
|
||||
description: |-
|
||||
The application service indicates that this room alias does not exist.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
"/users/{userId}":
|
||||
get:
|
||||
summary: Query if a user should exist on the application service.
|
||||
description: |-
|
||||
This endpoint is invoked by the homeserver on an application service to query
|
||||
the existence of a given user ID. The homeserver will only query user IDs
|
||||
inside the application service's ``users`` namespace. The homeserver will
|
||||
send this request when it receives an event for an unknown user ID in
|
||||
the application service's namespace.
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
type: string
|
||||
description: The user ID being queried.
|
||||
required: true
|
||||
x-example: "@alice:example.com"
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
The application service indicates that this user exists. The application
|
||||
service MUST create the user using the client-server API.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
schema:
|
||||
type: object
|
||||
401:
|
||||
description: |-
|
||||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
"errcode": "M_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
404:
|
||||
description: |-
|
||||
The application service indicates that this user does not exist.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
type: object
|
@ -0,0 +1,32 @@
|
||||
# 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.
|
||||
properties:
|
||||
alias:
|
||||
description: An alias for a matrix room.
|
||||
type: string
|
||||
example: "#freenode_#matrix:matrix.org"
|
||||
protocol:
|
||||
description: The protocol ID that the third party location is a part of.
|
||||
type: string
|
||||
example: "irc"
|
||||
fields:
|
||||
description: Information used to identify this third party location.
|
||||
type: object
|
||||
example: {
|
||||
"network": "freenode",
|
||||
"channel": "#matrix"
|
||||
}
|
||||
required: ['alias', 'protocol', 'fields']
|
||||
title: Location
|
||||
type: object
|
@ -0,0 +1,17 @@
|
||||
# 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.
|
||||
type: array
|
||||
description: List of matched third party locations.
|
||||
items:
|
||||
$ref: location.yaml
|
@ -0,0 +1,113 @@
|
||||
# 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.
|
||||
title: Protocol
|
||||
type: object
|
||||
properties:
|
||||
user_fields:
|
||||
description: |-
|
||||
Fields which may be used to identify a third party user. These should be
|
||||
ordered to suggest the way that entities may be grouped, where higher
|
||||
groupings are ordered first. For example, the name of a network should be
|
||||
searched before the nickname of a user.
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Field used to identify a third party user.
|
||||
example: ["network", "nickname"]
|
||||
location_fields:
|
||||
description: |-
|
||||
Fields which may be used to identify a third party location. These should be
|
||||
ordered to suggest the way that entities may be grouped, where higher
|
||||
groupings are ordered first. For example, the name of a network should be
|
||||
searched before the name of a channel.
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Field used to identify a third party location.
|
||||
example: ["network", "channel"]
|
||||
icon:
|
||||
description: A content URI representing an icon for the third party protocol.
|
||||
type: string
|
||||
example: "mxc://example.org/aBcDeFgH"
|
||||
field_types:
|
||||
title: Field Types
|
||||
description: |-
|
||||
The type definitions for the fields defined in the ``user_fields`` and
|
||||
``location_fields``. Each entry in those arrays MUST have an entry here. The
|
||||
``string`` key for this object is field name itself.
|
||||
|
||||
May be an empty object if no fields are defined.
|
||||
type: object
|
||||
additionalProperties:
|
||||
title: Field Type
|
||||
description: Definition of valid values for a field.
|
||||
type: object
|
||||
properties:
|
||||
regexp:
|
||||
description: |-
|
||||
A regular expression for validation of a field's value. This may be relatively
|
||||
coarse to verify the value as the application service providing this protocol
|
||||
may apply additional validation or filtering.
|
||||
type: string
|
||||
placeholder:
|
||||
description: An placeholder serving as a valid example of the field value.
|
||||
type: string
|
||||
required: ['regexp', 'placeholder']
|
||||
required: ['fieldname']
|
||||
example: {
|
||||
"network": {
|
||||
"regexp": "([a-z0-9]+\\.)*[a-z0-9]+",
|
||||
"placeholder": "irc.example.org"
|
||||
},
|
||||
"nickname": {
|
||||
"regexp": "[^\\s#]+",
|
||||
"placeholder": "username"
|
||||
},
|
||||
"channel": {
|
||||
"regexp": "#[^\\s]+",
|
||||
"placeholder": "#foobar"
|
||||
}
|
||||
}
|
||||
instances:
|
||||
description: |-
|
||||
A list of objects representing independent instances of configuration.
|
||||
For example, multiple networks on IRC if multiple are provided by the
|
||||
same application service.
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
title: Protocol Instance
|
||||
properties:
|
||||
desc:
|
||||
type: string
|
||||
description: A human-readable description for the protocol, such as the name.
|
||||
example: "Freenode"
|
||||
icon:
|
||||
type: string
|
||||
description: |-
|
||||
An optional content URI representing the protocol. Overrides the one provided
|
||||
at the higher level Protocol object.
|
||||
example: "mxc://example.org/JkLmNoPq"
|
||||
fields:
|
||||
type: object
|
||||
description: Preset values for ``fields`` the client may use to search by.
|
||||
example: {
|
||||
"network": "freenode"
|
||||
}
|
||||
network_id:
|
||||
type: string
|
||||
description: A unique identifier across all instances.
|
||||
example: "freenode"
|
||||
required: ['desc', 'fields', 'network_id']
|
||||
required: ['user_fields', 'location_fields', 'icon', 'field_types', 'instances']
|
@ -0,0 +1,70 @@
|
||||
# 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.
|
||||
type: object
|
||||
description: Dictionary of supported third party protocols.
|
||||
additionalProperties:
|
||||
$ref: protocol.yaml
|
||||
example: {
|
||||
"irc": {
|
||||
"user_fields": ["network", "nickname"],
|
||||
"location_fields": ["network", "channel"],
|
||||
"icon": "mxc://example.org/aBcDeFgH",
|
||||
"field_types": {
|
||||
"network": {
|
||||
"regexp": "([a-z0-9]+\\.)*[a-z0-9]+",
|
||||
"placeholder": "irc.example.org"
|
||||
},
|
||||
"nickname": {
|
||||
"regexp": "[^\\s]+",
|
||||
"placeholder": "username"
|
||||
},
|
||||
"channel": {
|
||||
"regexp": "#[^\\s]+",
|
||||
"placeholder": "#foobar"
|
||||
}
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
"network_id": "freenode",
|
||||
"desc": "Freenode",
|
||||
"icon": "mxc://example.org/JkLmNoPq",
|
||||
"fields": {
|
||||
"network": "freenode.net",
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"gitter": {
|
||||
"user_fields": ["username"],
|
||||
"location_fields": ["room"],
|
||||
"field_types": {
|
||||
"username": {
|
||||
"regexp": "@[^\\s]+",
|
||||
"placeholder": "@username"
|
||||
},
|
||||
"room": {
|
||||
"regexp": "[^\\s]+\\/[^\\s]+",
|
||||
"placeholder": "matrix-org/matrix-doc"
|
||||
}
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
"network_id": "gitter",
|
||||
"desc": "Gitter",
|
||||
"icon": "mxc://example.org/zXyWvUt",
|
||||
"fields": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
# 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.
|
||||
|
||||
# TODO: Change userid to user_id as a breaking change
|
||||
properties:
|
||||
userid:
|
||||
description: A Matrix User ID represting a third party user.
|
||||
type: string
|
||||
example: "@_gitter_jim:matrix.org"
|
||||
protocol:
|
||||
description: The protocol ID that the third party location is a part of.
|
||||
type: string
|
||||
example: "gitter"
|
||||
fields:
|
||||
description: Information used to identify this third party location.
|
||||
type: object
|
||||
example: {
|
||||
"user": "jim"
|
||||
}
|
||||
required: ['userid', 'protocol', 'fields']
|
||||
title: User
|
||||
type: object
|
@ -0,0 +1,17 @@
|
||||
# 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.
|
||||
type: array
|
||||
description: List of matched third party users.
|
||||
items:
|
||||
$ref: user.yaml
|
@ -0,0 +1,267 @@
|
||||
# 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 Application Service API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: "/"
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/_matrix/app/unstable/thirdparty/protocol/{protocol}":
|
||||
get:
|
||||
summary: Retrieve metadata about a specific protocol that the application service supports.
|
||||
description: |-
|
||||
This API is called by the homeserver when it wants to present clients
|
||||
with specific information about the various third party networks that
|
||||
an application service supports.
|
||||
operationId: getProtocolMetadata
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
type: string
|
||||
description: The protocol ID.
|
||||
required: true
|
||||
x-example: "irc"
|
||||
responses:
|
||||
200:
|
||||
description: The protocol was found and metadata returned.
|
||||
schema:
|
||||
$ref: definitions/protocol_metadata.yaml
|
||||
401:
|
||||
description: |-
|
||||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
403:
|
||||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
404:
|
||||
description: No protocol was found with the given path.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
"/_matrix/app/unstable/thirdparty/user/{protocol}":
|
||||
get:
|
||||
summary: Retrieve the Matrix User ID of a corresponding third party user.
|
||||
description: |-
|
||||
This API is called by the homeserver in order to retrieve a Matrix
|
||||
User ID linked to a user on the third party network, given a set of
|
||||
user parameters.
|
||||
operationId: queryUserByProtocol
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
type: string
|
||||
description: The protocol ID.
|
||||
required: true
|
||||
x-example: irc
|
||||
- in: query
|
||||
name: fields...
|
||||
type: string
|
||||
description: |-
|
||||
One or more custom fields that are passed to the application
|
||||
service to help identify the user.
|
||||
responses:
|
||||
200:
|
||||
description: The Matrix User IDs found with the given parameters.
|
||||
schema:
|
||||
$ref: definitions/user_batch.yaml
|
||||
401:
|
||||
description: |-
|
||||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
403:
|
||||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
404:
|
||||
description: No users were found with the given parameters.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
"/_matrix/app/unstable/thirdparty/location/{protocol}":
|
||||
get:
|
||||
summary: Retrieve Matrix-side portal rooms leading to a third party location.
|
||||
description: |-
|
||||
Retrieve a list of Matrix portal rooms that lead to the matched third party location.
|
||||
operationId: queryLocationByProtocol
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
type: string
|
||||
description: The protocol ID.
|
||||
required: true
|
||||
x-example: irc
|
||||
- in: query
|
||||
name: fields...
|
||||
type: string
|
||||
description: |-
|
||||
One or more custom fields that are passed to the application
|
||||
service to help identify the third party location.
|
||||
responses:
|
||||
200:
|
||||
description: At least one portal room was found.
|
||||
schema:
|
||||
$ref: definitions/location_batch.yaml
|
||||
401:
|
||||
description: |-
|
||||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
403:
|
||||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
404:
|
||||
description: No mappings were found with the given parameters.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
"/_matrix/app/unstable/thirdparty/location":
|
||||
get:
|
||||
summary: Reverse-lookup third party locations given a Matrix room alias.
|
||||
description: |-
|
||||
Retrieve an array of third party network locations from a Matrix room
|
||||
alias.
|
||||
operationId: queryLocationByAlias
|
||||
parameters:
|
||||
- in: query
|
||||
name: alias
|
||||
type: string
|
||||
description: The Matrix room alias to look up.
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
All found third party locations.
|
||||
schema:
|
||||
$ref: definitions/location_batch.yaml
|
||||
401:
|
||||
description: |-
|
||||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
403:
|
||||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
404:
|
||||
description: No mappings were found with the given parameters.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
"/_matrix/app/unstable/thirdparty/user":
|
||||
get:
|
||||
summary: Reverse-lookup third party users given a Matrix User ID.
|
||||
description: |-
|
||||
Retrieve an array of third party users from a Matrix User ID.
|
||||
operationId: queryUserByID
|
||||
parameters:
|
||||
- in: query
|
||||
name: userid
|
||||
type: string
|
||||
description: The Matrix User ID to look up.
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
An array of third party users.
|
||||
schema:
|
||||
$ref: definitions/user_batch.yaml
|
||||
401:
|
||||
description: |-
|
||||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
403:
|
||||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
404:
|
||||
description: No mappings were found with the given parameters.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
@ -0,0 +1,86 @@
|
||||
# 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 Application Service API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: "/"
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/rooms/{roomAlias}":
|
||||
get:
|
||||
summary: Query if a room alias should exist on the application service.
|
||||
description: |-
|
||||
This endpoint is invoked by the homeserver on an application service to query
|
||||
the existence of a given room alias. The homeserver will only query room
|
||||
aliases inside the application service's ``aliases`` namespace. The
|
||||
homeserver will send this request when it receives a request to join a
|
||||
room alias within the application service's namespace.
|
||||
operationId: queryRoomByAlias
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomAlias
|
||||
type: string
|
||||
description: The room alias being queried.
|
||||
required: true
|
||||
x-example: "#magicforest:example.com"
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
The application service indicates that this room alias exists. The
|
||||
application service MUST have created a room and associated it with
|
||||
the queried room alias using the client-server API. Additional
|
||||
information about the room such as its name and topic can be set
|
||||
before responding.
|
||||
examples:
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
||||
401:
|
||||
description: |-
|
||||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
403:
|
||||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
404:
|
||||
description: |-
|
||||
The application service indicates that this room alias does not exist.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
@ -0,0 +1,83 @@
|
||||
# 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 Application Service API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: "/"
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/users/{userId}":
|
||||
get:
|
||||
summary: Query if a user should exist on the application service.
|
||||
description: |-
|
||||
This endpoint is invoked by the homeserver on an application service to query
|
||||
the existence of a given user ID. The homeserver will only query user IDs
|
||||
inside the application service's ``users`` namespace. The homeserver will
|
||||
send this request when it receives an event for an unknown user ID in
|
||||
the application service's namespace, such as a room invite.
|
||||
operationId: queryUserById
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
type: string
|
||||
description: The user ID being queried.
|
||||
required: true
|
||||
x-example: "@alice:example.com"
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
The application service indicates that this user exists. The application
|
||||
service MUST create the user using the client-server API.
|
||||
examples:
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
||||
401:
|
||||
description: |-
|
||||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
403:
|
||||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
404:
|
||||
description: |-
|
||||
The application service indicates that this user does not exist.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
@ -0,0 +1,74 @@
|
||||
# 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 Application Service API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: "/"
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/transactions/{txnId}":
|
||||
put:
|
||||
summary: Send some events to the application service.
|
||||
description: |-
|
||||
This API is called by the homeserver when it wants to push an event
|
||||
(or batch of events) to the application service.
|
||||
|
||||
Note that the application service should distinguish state events
|
||||
from message events via the presence of a ``state_key``, rather than
|
||||
via the event type.
|
||||
operationId: sendTransaction
|
||||
parameters:
|
||||
- in: path
|
||||
name: txnId
|
||||
type: string
|
||||
description: |-
|
||||
The transaction ID for this set of events. Homeservers generate
|
||||
these IDs and they are used to ensure idempotency of requests.
|
||||
required: true
|
||||
x-example: "35"
|
||||
- in: body
|
||||
name: body
|
||||
description: A list of events.
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"events": [
|
||||
{"$ref": "../../event-schemas/examples/m.room.member"},
|
||||
{"$ref": "../../event-schemas/examples/m.room.message#m.text"}
|
||||
]
|
||||
}
|
||||
description: Transaction information
|
||||
properties:
|
||||
events:
|
||||
type: array
|
||||
description: |-
|
||||
A list of events, formatted as per the Client-Server API.
|
||||
items:
|
||||
type: object
|
||||
title: Event
|
||||
required: ["events"]
|
||||
responses:
|
||||
200:
|
||||
description: The transaction was processed successfully.
|
||||
examples:
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
@ -0,0 +1,88 @@
|
||||
# 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 Application Service Room Directory API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
# Note: this is the same access_token definition used elsewhere in the client
|
||||
# server API, however this expects an access token for an application service.
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/directory/list/appservice/{networkId}/{roomId}":
|
||||
put:
|
||||
summary: |-
|
||||
Updates a room's visibility in the application service's room directory.
|
||||
description: |-
|
||||
Updates the visibility of a given room on the application service's room
|
||||
directory.
|
||||
|
||||
This API is similar to the room directory visibility API used by clients
|
||||
to update the homeserver's more general room directory.
|
||||
|
||||
This API requires the use of an application service access token (``as_token``)
|
||||
instead of a typical client's access_token. This API cannot be invoked by
|
||||
users who are not identified as application services.
|
||||
operationId: updateAppserviceRoomDirectoryVsibility
|
||||
parameters:
|
||||
- in: path
|
||||
type: string
|
||||
name: networkId
|
||||
description: |-
|
||||
The protocol (network) ID to update the room list for. This would
|
||||
have been provided by the application service as being listed as
|
||||
a supported protocol.
|
||||
required: true
|
||||
x-example: "irc"
|
||||
- in: path
|
||||
type: string
|
||||
name: roomId
|
||||
description: The room ID to add to the directory.
|
||||
required: true
|
||||
x-example: "!somewhere:domain.com"
|
||||
- in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
visibility:
|
||||
type: string
|
||||
enum: ["public", "private"]
|
||||
description: |-
|
||||
Whether the room should be visible (public) in the directory
|
||||
or not (private).
|
||||
example: "public"
|
||||
required: ['visibility']
|
||||
security:
|
||||
# again, this is the appservice's token - not a typical client's
|
||||
- accessToken: []
|
||||
responses:
|
||||
200:
|
||||
description: The room's directory visibility has been updated.
|
||||
schema:
|
||||
type: object
|
||||
examples:
|
||||
application/json: {}
|
||||
tags:
|
||||
- Application service room directory management
|
@ -0,0 +1,68 @@
|
||||
# Copyright 2016 OpenMarket 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.
|
||||
type: object
|
||||
title: DeviceKeys
|
||||
description: Device identity keys
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
description: |-
|
||||
The ID of the user the device belongs to. Must match the user ID used
|
||||
when logging in.
|
||||
example: "@alice:example.com"
|
||||
device_id:
|
||||
type: string
|
||||
description: |-
|
||||
The ID of the device these keys belong to. Must match the device ID used
|
||||
when logging in.
|
||||
example: "JLAFKJWSCS"
|
||||
algorithms:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: |-
|
||||
The encryption algorithms supported by this device.
|
||||
example: ["m.olm.curve25519-aes-sha256", "m.megolm.v1.aes-sha"]
|
||||
keys:
|
||||
type: object
|
||||
description: |-
|
||||
Public identity keys. The names of the properties should be in the
|
||||
format ``<algorithm>:<device_id>``. The keys themselves should be
|
||||
encoded as specified by the key algorithm.
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
"curve25519:JLAFKJWSCS": "3C5BFWi2Y8MaVvjM8M22DBmh24PmgR0nPvJOIArzgyI"
|
||||
"ed25519:JLAFKJWSCS": "lEuiRJBit0IG6nUf5pUzWTUEsRVVe/HJkoKuEww9ULI"
|
||||
signatures:
|
||||
type: object
|
||||
description: |-
|
||||
Signatures for the device key object. A map from user ID, to a map from
|
||||
``<algorithm>:<device_id>`` to the signature.
|
||||
|
||||
The signature is calculated using the process described at `Signing
|
||||
JSON`_.
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
"@alice:example.com":
|
||||
"ed25519:JLAFKJWSCS": "dSO80A01XiigH3uBiDVx/EjzaoycHcjq9lfQX0uWsqxl2giMIiSPR8a4d291W1ihKJL/a+myXS367WT6NAIcBA"
|
||||
required:
|
||||
- user_id
|
||||
- device_id
|
||||
- algorithms
|
||||
- keys
|
||||
- signatures
|
@ -0,0 +1,32 @@
|
||||
# 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.
|
||||
$ref: error.yaml
|
||||
type: object
|
||||
description: The rate limit was reached for this request
|
||||
properties:
|
||||
errcode:
|
||||
type: string
|
||||
description: The M_LIMIT_EXCEEDED error code
|
||||
example: M_LIMIT_EXCEEDED
|
||||
error:
|
||||
type: string
|
||||
description: A human-readable error message.
|
||||
example: Too many requests
|
||||
retry_after_ms:
|
||||
type: integer
|
||||
description: |-
|
||||
The amount of time in milliseconds the client should wait
|
||||
before trying the request again.
|
||||
example: 2000
|
||||
required: ["errcode"]
|
@ -0,0 +1,105 @@
|
||||
# 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.
|
||||
|
||||
type: object
|
||||
description: A list of the rooms on the server.
|
||||
required: ["chunk"]
|
||||
properties:
|
||||
chunk:
|
||||
title: "PublicRoomsChunks"
|
||||
type: array
|
||||
description: |-
|
||||
A paginated chunk of public rooms.
|
||||
items:
|
||||
type: object
|
||||
title: "PublicRoomsChunk"
|
||||
required:
|
||||
- room_id
|
||||
- num_joined_members
|
||||
- world_readable
|
||||
- guest_can_join
|
||||
properties:
|
||||
aliases:
|
||||
type: array
|
||||
description: |-
|
||||
Aliases of the room. May be empty.
|
||||
items:
|
||||
type: string
|
||||
canonical_alias:
|
||||
type: string
|
||||
description: |-
|
||||
The canonical alias of the room, if any.
|
||||
name:
|
||||
type: string
|
||||
description: |-
|
||||
The name of the room, if any.
|
||||
num_joined_members:
|
||||
type: integer
|
||||
description: |-
|
||||
The number of members joined to the room.
|
||||
room_id:
|
||||
type: string
|
||||
description: |-
|
||||
The ID of the room.
|
||||
topic:
|
||||
type: string
|
||||
description: |-
|
||||
The topic of the room, if any.
|
||||
world_readable:
|
||||
type: boolean
|
||||
description: |-
|
||||
Whether the room may be viewed by guest users without joining.
|
||||
guest_can_join:
|
||||
type: boolean
|
||||
description: |-
|
||||
Whether guest users may join the room and participate in it.
|
||||
If they can, they will be subject to ordinary power level
|
||||
rules like any other user.
|
||||
avatar_url:
|
||||
type: string
|
||||
description: The URL for the room's avatar, if one is set.
|
||||
next_batch:
|
||||
type: string
|
||||
description: |-
|
||||
A pagination token for the response. The absence of this token
|
||||
means there are no more results to fetch and the client should
|
||||
stop paginating.
|
||||
prev_batch:
|
||||
type: string
|
||||
description: |-
|
||||
A pagination token that allows fetching previous results. The
|
||||
absence of this token means there are no results before this
|
||||
batch, i.e. this is the first batch.
|
||||
total_room_count_estimate:
|
||||
type: integer
|
||||
description: |-
|
||||
An estimate on the total number of public rooms, if the
|
||||
server has an estimate.
|
||||
example: {
|
||||
"chunk": [
|
||||
{
|
||||
"aliases": ["#murrays:cheese.bar"],
|
||||
"avatar_url": "mxc://bleeker.street/CHEDDARandBRIE",
|
||||
"guest_can_join": false,
|
||||
"name": "CHEESE",
|
||||
"num_joined_members": 37,
|
||||
"room_id": "!ol19s:bleecker.street",
|
||||
"topic": "Tasty tasty cheese",
|
||||
"world_readable": true
|
||||
}
|
||||
],
|
||||
"next_batch": "p190q",
|
||||
"prev_batch": "p1902",
|
||||
"total_room_count_estimate": 115
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
# 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.
|
||||
title: User identifier
|
||||
description: |-
|
||||
Identification information for a user
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
description: The type of identification. See `Identifier types`_ for supported values and additional property descriptions.
|
||||
required:
|
||||
- type
|
||||
additionalProperties: true
|
@ -0,0 +1,357 @@
|
||||
# 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 Client Config 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:
|
||||
"/keys/upload":
|
||||
post:
|
||||
summary: Upload end-to-end encryption keys.
|
||||
description: |-
|
||||
Publishes end-to-end encryption keys for the device.
|
||||
operationId: uploadKeys
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: body
|
||||
name: keys
|
||||
description: |-
|
||||
The keys to be published
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
device_keys:
|
||||
description: |-
|
||||
Identity keys for the device. May be absent if no new
|
||||
identity keys are required.
|
||||
allOf:
|
||||
- $ref: definitions/device_keys.yaml
|
||||
one_time_keys:
|
||||
type: object
|
||||
description: |-
|
||||
One-time public keys for "pre-key" messages. The names of
|
||||
the properties should be in the format
|
||||
``<algorithm>:<key_id>``. The format of the key is determined
|
||||
by the key algorithm.
|
||||
|
||||
May be absent if no new one-time keys are required.
|
||||
additionalProperties:
|
||||
type:
|
||||
- string
|
||||
- object
|
||||
example:
|
||||
"curve25519:AAAAAQ": "/qyvZvwjiTxGdGU0RCguDCLeR+nmsb3FfNG3/Ve4vU8"
|
||||
signed_curve25519:AAAAHg:
|
||||
key: "zKbLg+NrIjpnagy+pIY6uPL4ZwEG2v+8F9lmgsnlZzs"
|
||||
signatures:
|
||||
"@alice:example.com":
|
||||
ed25519:JLAFKJWSCS: "FLWxXqGbwrb8SM3Y795eB6OA8bwBcoMZFXBqnTn58AYWZSqiD45tlBVcDa2L7RwdKXebW/VzDlnfVJ+9jok1Bw"
|
||||
signed_curve25519:AAAAHQ:
|
||||
key: "j3fR3HemM16M7CWhoI4Sk5ZsdmdfQHsKL1xuSft6MSw"
|
||||
signatures:
|
||||
"@alice:example.com":
|
||||
ed25519:JLAFKJWSCS: "IQeCEPb9HFk217cU9kw9EOiusC6kMIkoIRnbnfOh5Oc63S1ghgyjShBGpu34blQomoalCyXWyhaaT3MrLZYQAA"
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
The provided keys were sucessfully uploaded.
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
one_time_key_counts:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: integer
|
||||
description: |-
|
||||
For each key algorithm, the number of unclaimed one-time keys
|
||||
of that type currently held on the server for this device.
|
||||
example:
|
||||
curve25519: 10
|
||||
signed_curve25519: 20
|
||||
required:
|
||||
- one_time_key_counts
|
||||
|
||||
tags:
|
||||
- End-to-end encryption
|
||||
"/keys/query":
|
||||
post:
|
||||
summary: Download device identity keys.
|
||||
description: |-
|
||||
Returns the current devices and identity keys for the given users.
|
||||
operationId: queryKeys
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: body
|
||||
name: query
|
||||
description: |-
|
||||
Query defining the keys to be downloaded
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
timeout:
|
||||
type: integer
|
||||
description: |-
|
||||
The time (in milliseconds) to wait when downloading keys from
|
||||
remote servers. 10 seconds is the recommended default.
|
||||
example: 10000
|
||||
device_keys:
|
||||
type: object
|
||||
description: |-
|
||||
The keys to be downloaded. A map from user ID, to a list of
|
||||
device IDs, or to an empty list to indicate all devices for the
|
||||
corresponding user.
|
||||
additionalProperties:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: "device ID"
|
||||
example:
|
||||
"@alice:example.com": []
|
||||
token:
|
||||
type: string
|
||||
description: |-
|
||||
If the client is fetching keys as a result of a device update received
|
||||
in a sync request, this should be the 'since' token of that sync request,
|
||||
or any later sync token. This allows the server to ensure its response
|
||||
contains the keys advertised by the notification in that sync.
|
||||
required:
|
||||
- device_keys
|
||||
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
The device information
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
failures:
|
||||
type: object
|
||||
description: |-
|
||||
If any remote homeservers could not be reached, they are
|
||||
recorded here. The names of the properties are the names of
|
||||
the unreachable servers.
|
||||
|
||||
If the homeserver could be reached, but the user or device
|
||||
was unknown, no failure is recorded. Instead, the corresponding
|
||||
user or device is missing from the ``device_keys`` result.
|
||||
additionalProperties:
|
||||
type: object
|
||||
example: {}
|
||||
device_keys:
|
||||
type: object
|
||||
description: |-
|
||||
Information on the queried devices. A map from user ID, to a
|
||||
map from device ID to device information. For each device,
|
||||
the information returned will be the same as uploaded via
|
||||
``/keys/upload``, with the addition of an ``unsigned``
|
||||
property.
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties:
|
||||
allOf:
|
||||
- $ref: definitions/device_keys.yaml
|
||||
properties:
|
||||
unsigned:
|
||||
title: UnsignedDeviceInfo
|
||||
type: object
|
||||
description: |-
|
||||
Additional data added to the device key information
|
||||
by intermediate servers, and not covered by the
|
||||
signatures.
|
||||
properties:
|
||||
device_display_name:
|
||||
type: string
|
||||
description:
|
||||
The display name which the user set on the device.
|
||||
example:
|
||||
"@alice:example.com":
|
||||
JLAFKJWSCS: {
|
||||
"user_id": "@alice:example.com",
|
||||
"device_id": "JLAFKJWSCS",
|
||||
"algorithms": [
|
||||
"m.olm.v1.curve25519-aes-sha256",
|
||||
"m.megolm.v1.aes-sha"
|
||||
],
|
||||
"keys": {
|
||||
"curve25519:JLAFKJWSCS": "3C5BFWi2Y8MaVvjM8M22DBmh24PmgR0nPvJOIArzgyI",
|
||||
"ed25519:JLAFKJWSCS": "lEuiRJBit0IG6nUf5pUzWTUEsRVVe/HJkoKuEww9ULI"
|
||||
},
|
||||
"signatures": {
|
||||
"@alice:example.com": {
|
||||
"ed25519:JLAFKJWSCS": "dSO80A01XiigH3uBiDVx/EjzaoycHcjq9lfQX0uWsqxl2giMIiSPR8a4d291W1ihKJL/a+myXS367WT6NAIcBA"
|
||||
}
|
||||
},
|
||||
"unsigned": {
|
||||
"device_display_name": "Alice's mobile phone"
|
||||
}
|
||||
}
|
||||
|
||||
tags:
|
||||
- End-to-end encryption
|
||||
"/keys/claim":
|
||||
post:
|
||||
summary: Claim one-time encryption keys.
|
||||
description: |-
|
||||
Claims one-time keys for use in pre-key messages.
|
||||
operationId: claimKeys
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: body
|
||||
name: query
|
||||
description: |-
|
||||
Query defining the keys to be claimed
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
timeout:
|
||||
type: integer
|
||||
description: |-
|
||||
The time (in milliseconds) to wait when downloading keys from
|
||||
remote servers. 10 seconds is the recommended default.
|
||||
example: 10000
|
||||
one_time_keys:
|
||||
type: object
|
||||
description: |-
|
||||
The keys to be claimed. A map from user ID, to a map from
|
||||
device ID to algorithm name.
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: algorithm
|
||||
example: "signed_curve25519"
|
||||
example:
|
||||
"@alice:example.com": { "JLAFKJWSCS": "signed_curve25519" }
|
||||
required:
|
||||
- one_time_keys
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
The claimed keys
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
failures:
|
||||
type: object
|
||||
description: |-
|
||||
If any remote homeservers could not be reached, they are
|
||||
recorded here. The names of the properties are the names of
|
||||
the unreachable servers.
|
||||
|
||||
If the homeserver could be reached, but the user or device
|
||||
was unknown, no failure is recorded. Instead, the corresponding
|
||||
user or device is missing from the ``one_time_keys`` result.
|
||||
additionalProperties:
|
||||
type: object
|
||||
example: {}
|
||||
one_time_keys:
|
||||
type: object
|
||||
description: |-
|
||||
One-time keys for the queried devices. A map from user ID, to a
|
||||
map from devices to a map from ``<algorithm>:<key_id>`` to the key object.
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type:
|
||||
- string
|
||||
- object
|
||||
example:
|
||||
"@alice:example.com":
|
||||
JLAFKJWSCS:
|
||||
signed_curve25519:AAAAHg:
|
||||
key: "zKbLg+NrIjpnagy+pIY6uPL4ZwEG2v+8F9lmgsnlZzs"
|
||||
signatures:
|
||||
"@alice:example.com":
|
||||
ed25519:JLAFKJWSCS: "FLWxXqGbwrb8SM3Y795eB6OA8bwBcoMZFXBqnTn58AYWZSqiD45tlBVcDa2L7RwdKXebW/VzDlnfVJ+9jok1Bw"
|
||||
tags:
|
||||
- End-to-end encryption
|
||||
"/keys/changes":
|
||||
get:
|
||||
summary: Query users with recent device key updates.
|
||||
description: |-
|
||||
Gets a list of users who have updated their device identity keys since a
|
||||
previous sync token.
|
||||
|
||||
The server should include in the results any users who:
|
||||
|
||||
* currently share a room with the calling user (ie, both users have
|
||||
membership state ``join``); *and*
|
||||
* added new device identity keys or removed an existing device with
|
||||
identity keys, between ``from`` and ``to``.
|
||||
operationId: getKeysChanges
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: from
|
||||
type: string
|
||||
description: |-
|
||||
The desired start point of the list. Should be the ``next_batch`` field
|
||||
from a response to an earlier call to |/sync|. Users who have not
|
||||
uploaded new device identity keys since this point, nor deleted
|
||||
existing devices with identity keys since then, will be excluded
|
||||
from the results.
|
||||
required: true
|
||||
x-example: "s72594_4483_1934"
|
||||
- in: query
|
||||
name: to
|
||||
type: string
|
||||
description: |-
|
||||
The desired end point of the list. Should be the ``next_batch``
|
||||
field from a recent call to |/sync| - typically the most recent
|
||||
such call. This may be used by the server as a hint to check its
|
||||
caches are up to date.
|
||||
required: true
|
||||
x-example: "s75689_5632_2435"
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
The list of users who updated their devices.
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
changed:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: |-
|
||||
The Matrix User IDs of all users who updated their device
|
||||
identity keys.
|
||||
example: ["@alice:example.com", "@bob:example.org"]
|
||||
left:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: |-
|
||||
The Matrix User IDs of all users who may have left all
|
||||
the end-to-end encrypted rooms they previously shared
|
||||
with the user.
|
||||
example: ["@clara:example.com", "@doug:example.org"]
|
||||
tags:
|
||||
- End-to-end encryption
|
@ -0,0 +1,58 @@
|
||||
# Copyright 2017 Michael Telatynski <7t3chguy@gmail.com>
|
||||
#
|
||||
# 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 Room Listing 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:
|
||||
"/joined_rooms":
|
||||
get:
|
||||
summary: Lists the user's current rooms.
|
||||
description: |-
|
||||
This API returns a list of the user's current rooms.
|
||||
operationId: getJoinedRooms
|
||||
security:
|
||||
- accessToken: []
|
||||
responses:
|
||||
200:
|
||||
description: A list of the rooms the user is in.
|
||||
schema:
|
||||
type: object
|
||||
required: ["joined_rooms"]
|
||||
properties:
|
||||
joined_rooms:
|
||||
type: array
|
||||
description: |-
|
||||
The ID of each room in which the user has ``joined`` membership.
|
||||
items:
|
||||
type: string
|
||||
examples:
|
||||
application/json: {
|
||||
"joined_rooms": [
|
||||
"!foo:example.com"
|
||||
]
|
||||
}
|
||||
tags:
|
||||
- Room membership
|
@ -0,0 +1,103 @@
|
||||
# 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 OpenID 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:
|
||||
"/user/{userId}/openid/request_token":
|
||||
post:
|
||||
summary: Get an OpenID token object to verify the requester's identity.
|
||||
description: |-
|
||||
Gets an OpenID token object that the requester may supply to another
|
||||
service to verify their identity in Matrix. The generated token is only
|
||||
valid for exchanging for user information from the federation API for
|
||||
OpenID.
|
||||
|
||||
The access token generated is only valid for the OpenID API. It cannot
|
||||
be used to request another OpenID access token or call ``/sync``, for
|
||||
example.
|
||||
operationId: requestOpenIdToken
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: path
|
||||
type: string
|
||||
name: userId
|
||||
description: |-
|
||||
The user to request and OpenID token for. Should be the user who
|
||||
is authenticated for the request.
|
||||
required: true
|
||||
x-example: "@alice:example.com"
|
||||
- in: body
|
||||
name: body
|
||||
description: An empty object. Reserved for future expansion.
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: {}
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
OpenID token information. This response is nearly compatible with the
|
||||
response documented in the `OpenID 1.0 Specification <http://openid.net/specs/openid-connect-core-1_0.html#TokenResponse>`_
|
||||
with the only difference being the lack of an ``id_token``. Instead,
|
||||
the Matrix homeserver's name is provided.
|
||||
examples:
|
||||
application/json: {
|
||||
"access_token": "SomeT0kenHere",
|
||||
"token_type": "Bearer",
|
||||
"matrix_server_name": "example.com",
|
||||
"expires_in": 3600,
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
access_token:
|
||||
type: string
|
||||
description: |-
|
||||
An access token the consumer may use to verify the identity of
|
||||
the person who generated the token. This is given to the federation
|
||||
API ``GET /openid/userinfo``.
|
||||
token_type:
|
||||
type: string
|
||||
description: The string ``Bearer``.
|
||||
matrix_server_name:
|
||||
type: string
|
||||
description: |-
|
||||
The homeserver domain the consumer should use when attempting to
|
||||
verify the user's identity.
|
||||
expires_in:
|
||||
type: integer
|
||||
description: |-
|
||||
The number of seconds before this token expires and a new one must
|
||||
be generated.
|
||||
required: ['access_token', 'token_type', 'matrix_server_name', 'expires_in']
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
"$ref": "definitions/errors/rate_limited.yaml"
|
||||
tags:
|
||||
- OpenID
|
@ -0,0 +1,78 @@
|
||||
# Copyright 2018 Travis Ralston
|
||||
#
|
||||
# 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 Report Content 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:
|
||||
"/rooms/{roomId}/report/{eventId}":
|
||||
post:
|
||||
summary: Reports an event as inappropriate.
|
||||
description: |-
|
||||
Reports an event as inappropriate to the server, which may then notify
|
||||
the appropriate people.
|
||||
operationId: reportContent
|
||||
parameters:
|
||||
- in: path
|
||||
type: string
|
||||
name: roomId
|
||||
description: The room in which the event being reported is located.
|
||||
required: true
|
||||
x-example: "!637q39766251:example.com"
|
||||
- in: path
|
||||
type: string
|
||||
name: eventId
|
||||
description: The event to report.
|
||||
required: true
|
||||
x-example: "$something:domain.com"
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"score": -100,
|
||||
"reason": "this makes me sad"
|
||||
}
|
||||
required: ['score', 'reason']
|
||||
properties:
|
||||
score:
|
||||
type: integer
|
||||
description: |-
|
||||
The score to rate this content as where -100 is most offensive
|
||||
and 0 is inoffensive.
|
||||
reason:
|
||||
type: string
|
||||
description: The reason the content is being reported. May be blank.
|
||||
security:
|
||||
- accessToken: []
|
||||
responses:
|
||||
200:
|
||||
description: The event has been reported successfully.
|
||||
schema:
|
||||
type: object
|
||||
examples:
|
||||
application/json: {}
|
||||
tags:
|
||||
- Reporting content
|
@ -0,0 +1,208 @@
|
||||
# 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 Third Party Lookup 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:
|
||||
"/thirdparty/protocols":
|
||||
get:
|
||||
summary: Retrieve metadata about all protocols that a homeserver supports.
|
||||
description: |-
|
||||
Fetches the overall metadata about protocols supported by the
|
||||
homeserver. Includes both the available protocols and all fields
|
||||
required for queries against each protocol.
|
||||
operationId: getProtocols
|
||||
security:
|
||||
- accessToken: []
|
||||
responses:
|
||||
200:
|
||||
description: The protocols supported by the homeserver.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/protocol_metadata.yaml
|
||||
"/thirdparty/protocol/{protocol}":
|
||||
get:
|
||||
summary: Retrieve metadata about a specific protocol that the homeserver supports.
|
||||
description: |-
|
||||
Fetches the metadata from the homeserver about a particular third party protocol.
|
||||
operationId: getProtocolMetadata
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
type: string
|
||||
description: |-
|
||||
The name of the protocol.
|
||||
required: true
|
||||
x-example: "irc"
|
||||
responses:
|
||||
200:
|
||||
description: The protocol was found and metadata returned.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/protocol.yaml
|
||||
404:
|
||||
description: The protocol is unknown.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
"/thirdparty/location/{protocol}":
|
||||
get:
|
||||
summary: Retrieve Matrix-side portals rooms leading to a third party location.
|
||||
description: |-
|
||||
Requesting this endpoint with a valid protocol name results in a list
|
||||
of successful mapping results in a JSON array. Each result contains
|
||||
objects to represent the Matrix room or rooms that represent a portal
|
||||
to this third party network. Each has the Matrix room alias string,
|
||||
an identifier for the particular third party network protocol, and an
|
||||
object containing the network-specific fields that comprise this
|
||||
identifier. It should attempt to canonicalise the identifier as much
|
||||
as reasonably possible given the network type.
|
||||
operationId: queryLocationByProtocol
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
type: string
|
||||
description: The protocol used to communicate to the third party network.
|
||||
required: true
|
||||
x-example: irc
|
||||
- in: query
|
||||
name: searchFields
|
||||
type: string
|
||||
description: |-
|
||||
One or more custom fields to help identify the third party
|
||||
location.
|
||||
responses:
|
||||
200:
|
||||
description: At least one portal room was found.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/location_batch.yaml
|
||||
404:
|
||||
description: No portal rooms were found.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
"/thirdparty/user/{protocol}":
|
||||
get:
|
||||
summary: Retrieve the Matrix User ID of a corresponding third party user.
|
||||
description: |-
|
||||
Retrieve a Matrix User ID linked to a user on the third party service, given
|
||||
a set of user parameters.
|
||||
operationId: queryUserByProtocol
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
type: string
|
||||
description: |-
|
||||
The name of the protocol.
|
||||
required: true
|
||||
x-example: irc
|
||||
- in: query
|
||||
name: fields...
|
||||
type: string
|
||||
description: |-
|
||||
One or more custom fields that are passed to the AS to help identify the user.
|
||||
responses:
|
||||
200:
|
||||
description: The Matrix User IDs found with the given parameters.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/user_batch.yaml
|
||||
404:
|
||||
description: The Matrix User ID was not found
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
"/thirdparty/location":
|
||||
get:
|
||||
summary: Reverse-lookup third party locations given a Matrix room alias.
|
||||
description: |-
|
||||
Retrieve an array of third party network locations from a Matrix room
|
||||
alias.
|
||||
operationId: queryLocationByAlias
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: alias
|
||||
type: string
|
||||
description: The Matrix room alias to look up.
|
||||
required: true
|
||||
x-example: "#matrix:matrix.org"
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
All found third party locations.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/location_batch.yaml
|
||||
404:
|
||||
description: The Matrix room alias was not found
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
"/thirdparty/user":
|
||||
get:
|
||||
summary: Reverse-lookup third party users given a Matrix User ID.
|
||||
description: |-
|
||||
Retrieve an array of third party users from a Matrix User ID.
|
||||
operationId: queryUserByID
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: userid
|
||||
type: string
|
||||
description: The Matrix User ID to look up.
|
||||
required: true
|
||||
x-example: "@bob:matrix.org"
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
An array of third party users.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/user_batch.yaml
|
||||
404:
|
||||
description: The Matrix User ID was not found
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
@ -0,0 +1,100 @@
|
||||
# Copyright 2017 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 User Directory 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:
|
||||
"/user_directory/search":
|
||||
post:
|
||||
summary: Searches the user directory.
|
||||
description: |-
|
||||
This API performs a server-side search over all users registered on the server.
|
||||
It searches user ID and displayname case-insensitively for users that you share a room with or that are in public rooms.
|
||||
operationId: searchUserDirectory
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
search_term:
|
||||
type: string
|
||||
description: The term to search for
|
||||
example: "foo"
|
||||
limit:
|
||||
type: integer
|
||||
description: The maximum number of results to return (Defaults to 10).
|
||||
example: 10
|
||||
required: ["search_term"]
|
||||
responses:
|
||||
200:
|
||||
description: The results of the search.
|
||||
examples:
|
||||
application/json: {
|
||||
"results": [
|
||||
{
|
||||
"user_id": "@foo:bar.com",
|
||||
"display_name": "Foo",
|
||||
"avatar_url": "mxc://bar.com/foo"
|
||||
}
|
||||
],
|
||||
"limited": false
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
required: ["results", "limited"]
|
||||
properties:
|
||||
results:
|
||||
type: array
|
||||
description: Ordered by rank and then whether or not profile info is available.
|
||||
items:
|
||||
title: User
|
||||
type: object
|
||||
required: ["user_id"]
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
example: "@foo:bar.com"
|
||||
description: The user's matrix user ID.
|
||||
display_name:
|
||||
type: string
|
||||
example: "Foo"
|
||||
description: The display name of the user, if one exists.
|
||||
avatar_url:
|
||||
type: string
|
||||
example: "mxc://bar.com/foo"
|
||||
description: The avatar url, as an MXC, if one exists.
|
||||
limited:
|
||||
type: boolean
|
||||
description: Indicates if the result list has been truncated by the limit.
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
"$ref": "definitions/errors/rate_limited.yaml"
|
||||
tags:
|
||||
- User data
|
@ -0,0 +1,84 @@
|
||||
# Copyright 2017 Travis Ralston
|
||||
#
|
||||
# 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 Account Identification API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/account/whoami":
|
||||
get:
|
||||
summary: Gets information about the owner of an access token.
|
||||
description: |-
|
||||
Gets information about the owner of a given access token.
|
||||
|
||||
Note that, as with the rest of the Client-Server API,
|
||||
Application Services may masquerade as users within their
|
||||
namespace by giving a ``user_id`` query parameter. In this
|
||||
situation, the server should verify that the given ``user_id``
|
||||
is registered by the appservice, and return it in the response
|
||||
body.
|
||||
operationId: getTokenOwner
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters: []
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
The token belongs to a known user.
|
||||
examples:
|
||||
application/json: {
|
||||
"user_id": "@joe:example.org"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
required: ["user_id"]
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
description: The user id that owns the access token.
|
||||
401:
|
||||
description:
|
||||
The token is not recognised
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_UNKNOWN_TOKEN",
|
||||
"error": "Unrecognised access token."
|
||||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
403:
|
||||
description:
|
||||
The appservice cannot masquerade as the user or has not registered them.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "Application service has not registered this user."
|
||||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
"$ref": "definitions/errors/rate_limited.yaml"
|
||||
tags:
|
||||
- User data
|
@ -0,0 +1,179 @@
|
||||
# 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 Identity Service Establishing Associations API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/3pid/getValidated3pid":
|
||||
get:
|
||||
summary: Check whether ownership of a 3pid was validated.
|
||||
description: A client can check whether ownership of a 3pid was validated
|
||||
operationId: getValidated3pid
|
||||
parameters:
|
||||
- in: query
|
||||
type: string
|
||||
name: sid
|
||||
description: The Session ID generated by the ``requestToken`` call.
|
||||
required: true
|
||||
x-example: 1234
|
||||
- in: query
|
||||
type: string
|
||||
name: client_secret
|
||||
description: The client secret passed to the ``requestToken`` call.
|
||||
required: true
|
||||
x-example: monkeys_are_GREAT
|
||||
responses:
|
||||
200:
|
||||
description: Validation information for the session.
|
||||
examples:
|
||||
application/json: {
|
||||
"medium": "email",
|
||||
"validated_at": 1457622739026,
|
||||
"address": "louise@bobs.burgers"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
medium:
|
||||
type: string
|
||||
description: The medium type of the 3pid.
|
||||
address:
|
||||
type: string
|
||||
description: The address of the 3pid being looked up.
|
||||
validated_at:
|
||||
type: integer
|
||||
description: Timestamp indicating the time that the 3pid was validated.
|
||||
400:
|
||||
description: |-
|
||||
The session has not been validated.
|
||||
|
||||
If the session has not been validated, then ``errcode`` will be
|
||||
``M_SESSION_NOT_VALIDATED``. If the session has timed out, then
|
||||
``errcode`` will be ``M_SESSION_EXPIRED``.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_SESSION_NOT_VALIDATED",
|
||||
"error": "This validation session has not yet been completed"
|
||||
}
|
||||
404:
|
||||
description: The Session ID or client secret were not found
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NO_VALID_SESSION",
|
||||
"error": "No valid session was found matching that sid and client secret"
|
||||
}
|
||||
"/bind":
|
||||
post:
|
||||
summary: Publish an association between a session and a Matrix user ID.
|
||||
description: |-
|
||||
Publish an association between a session and a Matrix user ID.
|
||||
|
||||
Future calls to ``/lookup`` for any of the session\'s 3pids will return
|
||||
this association.
|
||||
|
||||
Note: for backwards compatibility with older versions of this
|
||||
specification, the parameters may also be specified as
|
||||
``application/x-form-www-urlencoded`` data. However, this usage is
|
||||
deprecated.
|
||||
operationId: bind
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"sid": "1234",
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"mxid": "@ears:matrix.org"
|
||||
}
|
||||
properties:
|
||||
sid:
|
||||
type: string
|
||||
description: The Session ID generated by the ``requestToken`` call.
|
||||
client_secret:
|
||||
type: string
|
||||
description: The client secret passed to the ``requestToken`` call.
|
||||
mxid:
|
||||
type: string
|
||||
description: The Matrix user ID to associate with the 3pids.
|
||||
required: ["sid", "client_secret", "mxid"]
|
||||
responses:
|
||||
200:
|
||||
description: The association was published.
|
||||
examples:
|
||||
application/json: {
|
||||
"address": "louise@bobs.burgers",
|
||||
"medium": "email",
|
||||
"mxid": "@ears:matrix.org",
|
||||
"not_before": 1428825849161,
|
||||
"not_after": 4582425849161,
|
||||
"ts": 1428825849161,
|
||||
|
||||
"signatures": {
|
||||
"matrix.org": {
|
||||
"ed25519:0": "ENiU2YORYUJgE6WBMitU0mppbQjidDLanAusj8XS2nVRHPu+0t42OKA/r6zV6i2MzUbNQ3c3MiLScJuSsOiVDQ"
|
||||
}
|
||||
}
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
address:
|
||||
type: string
|
||||
description: The 3pid address of the user being looked up.
|
||||
medium:
|
||||
type: string
|
||||
description: The medium type of the 3pid.
|
||||
mxid:
|
||||
type: string
|
||||
description: The Matrix user ID associated with the 3pid.
|
||||
not_before:
|
||||
type: integer
|
||||
description: A unix timestamp before which the association is not known to be valid.
|
||||
not_after:
|
||||
type: integer
|
||||
description: A unix timestamp after which the association is not known to be valid.
|
||||
ts:
|
||||
type: integer
|
||||
description: The unix timestamp at which the association was verified.
|
||||
signatures:
|
||||
type: object
|
||||
description: The signatures of the verifying identity services which show that the association should be trusted, if you trust the verifying identity services.
|
||||
400:
|
||||
description: |-
|
||||
The association was not published.
|
||||
|
||||
If the session has not been validated, then ``errcode`` will be
|
||||
``M_SESSION_NOT_VALIDATED``. If the session has timed out, then
|
||||
``errcode`` will be ``M_SESSION_EXPIRED``.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_SESSION_NOT_VALIDATED",
|
||||
"error": "This validation session has not yet been completed"
|
||||
}
|
||||
404:
|
||||
description: The Session ID or client secret were not found
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NO_VALID_SESSION",
|
||||
"error": "No valid session was found matching that sid and client secret"
|
||||
}
|
@ -0,0 +1,197 @@
|
||||
# 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 Identity Service Email Associations API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/validate/email/requestToken":
|
||||
post:
|
||||
summary: Request a token for validating an email address.
|
||||
description: |-
|
||||
Create a session for validating an email address.
|
||||
|
||||
The identity service will send an email containing a token. If that
|
||||
token is presented to the identity service in the future, it indicates
|
||||
that that user was able to read the email for that email address, and
|
||||
so we validate ownership of the email address.
|
||||
|
||||
Note that Home Servers offer APIs that proxy this API, adding
|
||||
additional behaviour on top, for example,
|
||||
``/register/email/requestToken`` is designed specifically for use when
|
||||
registering an account and therefore will inform the user if the email
|
||||
address given is already registered on the server.
|
||||
|
||||
Note: for backwards compatibility with older versions of this
|
||||
specification, the parameters may also be specified as
|
||||
``application/x-form-www-urlencoded`` data. However, this usage is
|
||||
deprecated.
|
||||
operationId: emailRequestToken
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"email": "foo@example.com",
|
||||
"send_attempt": 1
|
||||
}
|
||||
properties:
|
||||
client_secret:
|
||||
type: string
|
||||
description: A unique string used to identify the validation attempt
|
||||
email:
|
||||
type: string
|
||||
description: The email address to validate.
|
||||
send_attempt:
|
||||
type: integer
|
||||
description: |-
|
||||
Optional. If specified, the server will only send an email if
|
||||
the ``send_attempt`` is a number greater than the most recent
|
||||
one which it has seen (or if it has never seen one), scoped
|
||||
to that ``email`` + ``client_secret`` pair. This is to avoid
|
||||
repeatedly sending the same email in the case of request
|
||||
retries between the POSTing user and the identity
|
||||
service. The client should increment this value if they
|
||||
desire a new email (e.g. a reminder) to be sent.
|
||||
next_link:
|
||||
type: string
|
||||
description: |-
|
||||
Optional. When the validation is completed, the identity
|
||||
service will redirect the user to this URL.
|
||||
required: ["client_secret", "email"]
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
Session created.
|
||||
examples:
|
||||
application/json: {
|
||||
"sid": "1234"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
sid:
|
||||
type: string
|
||||
description: The session ID.
|
||||
400:
|
||||
description: |
|
||||
An error ocurred. Some possible errors are:
|
||||
|
||||
- ``M_INVALID_EMAIL``: The email address provided was invalid.
|
||||
- ``M_EMAIL_SEND_ERROR``: The validation email could not be sent.
|
||||
"/validate/email/submitToken":
|
||||
post:
|
||||
summary: Validate ownership of an email address.
|
||||
description: |-
|
||||
Validate ownership of an email address.
|
||||
|
||||
If the three parameters are consistent with a set generated by a
|
||||
``requestToken`` call, ownership of the email address is considered to
|
||||
have been validated. This does not publish any information publicly, or
|
||||
associate the email address with any Matrix user ID. Specifically,
|
||||
calls to ``/lookup`` will not show a binding.
|
||||
|
||||
Note: for backwards compatibility with older versions of this
|
||||
specification, the parameters may also be specified as
|
||||
``application/x-form-www-urlencoded`` data. However, this usage is
|
||||
deprecated.
|
||||
operationId: emailSubmitTokenPost
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"sid": "1234",
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"token": "atoken"
|
||||
}
|
||||
properties:
|
||||
sid:
|
||||
type: string
|
||||
description: The session ID, generated by the ``requestToken`` call.
|
||||
client_secret:
|
||||
type: string
|
||||
description: The client secret that was supplied to the ``requestToken`` call.
|
||||
token:
|
||||
type: string
|
||||
description: The token generated by the ``requestToken`` call and emailed to the user.
|
||||
required: ["sid", "client_secret", "token"]
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
The success of the validation.
|
||||
examples:
|
||||
application/json: {
|
||||
"success": true
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: boolean
|
||||
description: Whether the validation was successful or not.
|
||||
get:
|
||||
summary: Validate ownership of an email address.
|
||||
description: |-
|
||||
Validate ownership of an email address.
|
||||
|
||||
If the three parameters are consistent with a set generated by a
|
||||
``requestToken`` call, ownership of the email address is considered to
|
||||
have been validated. This does not publish any information publicly, or
|
||||
associate the email address with any Matrix user ID. Specifically,
|
||||
calls to ``/lookup`` will not show a binding.
|
||||
|
||||
Note that, in contrast with the POST version, this endpoint will be
|
||||
used by end-users, and so the response should be human-readable.
|
||||
operationId: emailSubmitTokenGet
|
||||
parameters:
|
||||
- in: query
|
||||
type: string
|
||||
name: sid
|
||||
required: true
|
||||
description: The session ID, generated by the ``requestToken`` call.
|
||||
x-example: 1234
|
||||
- in: query
|
||||
type: string
|
||||
name: client_secret
|
||||
required: true
|
||||
description: The client secret that was supplied to the ``requestToken`` call.
|
||||
x-example: monkeys_are_GREAT
|
||||
- in: query
|
||||
type: string
|
||||
name: token
|
||||
required: true
|
||||
description: The token generated by the ``requestToken`` call and emailed to the user.
|
||||
x-example: atoken
|
||||
responses:
|
||||
"200":
|
||||
description: Email address is validated.
|
||||
"3xx":
|
||||
description: |-
|
||||
Email address is validated, and the ``next_link`` parameter was
|
||||
provided to the ``requestToken`` call. The user must be redirected
|
||||
to the URL provided by the ``next_link`` parameter.
|
||||
"4xx":
|
||||
description:
|
||||
Validation failed.
|
@ -0,0 +1,90 @@
|
||||
# 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 Identity Service Ephemeral Invitation Signing API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/sign-ed25519":
|
||||
post:
|
||||
summary: Sign invitation details
|
||||
description: |-
|
||||
Sign invitation details.
|
||||
|
||||
The identity server will look up ``token`` which was stored in a call
|
||||
to ``store-invite``, and fetch the sender of the invite.
|
||||
operationId: blindlySignStuff
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"mxid": "@foo:bar.com",
|
||||
"token": "sometoken",
|
||||
"private_key": "base64encodedkey"
|
||||
}
|
||||
properties:
|
||||
mxid:
|
||||
type: string
|
||||
description: The Matrix user ID of the user accepting the invitation.
|
||||
token:
|
||||
type: string
|
||||
description: Token from the call to ``store-invite``
|
||||
private_key:
|
||||
type: string
|
||||
description: The private key, encoded as `Unpadded base64`_.
|
||||
required: ["mxid", "token", "private_key"]
|
||||
responses:
|
||||
200:
|
||||
description: The signedjson of the mxid, sender, and token.
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
mxid:
|
||||
type: string
|
||||
description: The Matrix user ID of the user accepting the invitation.
|
||||
sender:
|
||||
type: string
|
||||
description: The Matrix user ID of the user who sent the invitation.
|
||||
signatures:
|
||||
type: object
|
||||
description: The signature of the mxid, sender, and token.
|
||||
token:
|
||||
type: string
|
||||
description: The token for the invitation.
|
||||
examples:
|
||||
application/json: {
|
||||
"mxid": "@foo:bar.com",
|
||||
"sender": "@baz:bar.com",
|
||||
"signatures": {
|
||||
"my.id.server": {
|
||||
"ed25519:0": "def987"
|
||||
}
|
||||
},
|
||||
"token": "abc123"
|
||||
}
|
||||
404:
|
||||
description: Token was not found.
|
||||
example: {
|
||||
"errcode": "M_UNRECOGNIZED",
|
||||
"error": "Didn't recognize token"
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
# 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 Identity Service Phone Number Associations API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/validate/msisdn/requestToken":
|
||||
post:
|
||||
summary: Request a token for validating a phone number.
|
||||
description: |-
|
||||
Create a session for validating a phone number.
|
||||
|
||||
The identity service will send an SMS message containing a token. If
|
||||
that token is presented to the identity service in the future, it
|
||||
indicates that that user was able to read the SMS for that phone
|
||||
number, and so we validate ownership of the phone number.
|
||||
|
||||
Note that Home Servers offer APIs that proxy this API, adding
|
||||
additional behaviour on top, for example,
|
||||
``/register/msisdn/requestToken`` is designed specifically for use when
|
||||
registering an account and therefore will inform the user if the phone
|
||||
number given is already registered on the server.
|
||||
|
||||
Note: for backwards compatibility with older versions of this
|
||||
specification, the parameters may also be specified as
|
||||
``application/x-form-www-urlencoded`` data. However, this usage is
|
||||
deprecated.
|
||||
operationId: msisdnRequestToken
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"country": "GB",
|
||||
"phone_number": "07700900001",
|
||||
"send_attempt": 1
|
||||
}
|
||||
properties:
|
||||
client_secret:
|
||||
type: string
|
||||
description: A unique string used to identify the validation attempt.
|
||||
country:
|
||||
type: string
|
||||
description: |-
|
||||
The two-letter uppercase ISO country code that the number in
|
||||
``phone_number`` should be parsed as if it were dialled from.
|
||||
phone_number:
|
||||
type: string
|
||||
description: The phone number to validate.
|
||||
send_attempt:
|
||||
type: integer
|
||||
description: |-
|
||||
Optional. If specified, the server will only send an SMS if
|
||||
the ``send_attempt`` is a number greater than the most recent
|
||||
one which it has seen (or if it has never seen one), scoped
|
||||
to that ``country`` + ``phone_number`` + ``client_secret``
|
||||
triple. This is to avoid repeatedly sending the same SMS in
|
||||
the case of request retries between the POSTing user and the
|
||||
identity service. The client should increment this value if
|
||||
they desire a new SMS (e.g. a reminder) to be sent.
|
||||
next_link:
|
||||
type: string
|
||||
description: |-
|
||||
Optional. When the validation is completed, the identity
|
||||
service will redirect the user to this URL.
|
||||
required: ["client_secret", "country", "phone_number"]
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
Session created.
|
||||
examples:
|
||||
application/json: {
|
||||
"sid": "1234"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
sid:
|
||||
type: string
|
||||
description: The session ID.
|
||||
400:
|
||||
description: |
|
||||
An error ocurred. Some possible errors are:
|
||||
|
||||
- ``M_INVALID_ADDRESS``: The phone number provided was invalid.
|
||||
- ``M_SEND_ERROR``: The validation SMS could not be sent.
|
||||
"/validate/msisdn/submitToken":
|
||||
post:
|
||||
summary: Validate ownership of a phone number.
|
||||
description: |-
|
||||
Validate ownership of a phone number.
|
||||
|
||||
If the three parameters are consistent with a set generated by a
|
||||
``requestToken`` call, ownership of the phone number is considered to
|
||||
have been validated. This does not publish any information publicly, or
|
||||
associate the phone number address with any Matrix user
|
||||
ID. Specifically, calls to ``/lookup`` will not show a binding.
|
||||
|
||||
Note: for backwards compatibility with older versions of this
|
||||
specification, the parameters may also be specified as
|
||||
``application/x-form-www-urlencoded`` data. However, this usage is
|
||||
deprecated.
|
||||
operationId: msisdnSubmitTokenPost
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"sid": "1234",
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"token": "atoken"
|
||||
}
|
||||
properties:
|
||||
sid:
|
||||
type: string
|
||||
description: The session ID, generated by the ``requestToken`` call.
|
||||
client_secret:
|
||||
type: string
|
||||
description: The client secret that was supplied to the ``requestToken`` call.
|
||||
token:
|
||||
type: string
|
||||
description: The token generated by the ``requestToken`` call and sent to the user.
|
||||
required: ["sid", "client_secret", "token"]
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
The success of the validation.
|
||||
examples:
|
||||
application/json: {
|
||||
"success": true
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: boolean
|
||||
description: Whether the validation was successful or not.
|
||||
get:
|
||||
summary: Validate ownership of a phone number.
|
||||
description: |-
|
||||
Validate ownership of a phone number.
|
||||
|
||||
If the three parameters are consistent with a set generated by a
|
||||
``requestToken`` call, ownership of the phone number address is
|
||||
considered to have been validated. This does not publish any
|
||||
information publicly, or associate the phone number with any Matrix
|
||||
user ID. Specifically, calls to ``/lookup`` will not show a binding.
|
||||
|
||||
Note that, in contrast with the POST version, this endpoint will be
|
||||
used by end-users, and so the response should be human-readable.
|
||||
operationId: msisdnSubmitTokenGet
|
||||
parameters:
|
||||
- in: query
|
||||
type: string
|
||||
name: sid
|
||||
required: true
|
||||
description: The session ID, generated by the ``requestToken`` call.
|
||||
x-example: 1234
|
||||
- in: query
|
||||
type: string
|
||||
name: client_secret
|
||||
required: true
|
||||
description: The client secret that was supplied to the ``requestToken`` call.
|
||||
x-example: monkeys_are_GREAT
|
||||
- in: query
|
||||
type: string
|
||||
name: token
|
||||
required: true
|
||||
description: The token generated by the ``requestToken`` call and sent to the user.
|
||||
x-example: atoken
|
||||
responses:
|
||||
"200":
|
||||
description: Phone number is validated.
|
||||
"3xx":
|
||||
description: |-
|
||||
Phone number address is validated, and the ``next_link`` parameter
|
||||
was provided to the ``requestToken`` call. The user must be
|
||||
redirected to the URL provided by the ``next_link`` parameter.
|
||||
"4xx":
|
||||
description:
|
||||
Validation failed.
|
@ -0,0 +1,44 @@
|
||||
# Copyright 2018 Kamax Sàrl
|
||||
#
|
||||
# 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-Identity Versions API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/identity
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/api/v1":
|
||||
get:
|
||||
summary: Checks that an Identity server is available at this API endpopint.
|
||||
description: |-
|
||||
Checks that an Identity server is available at this API endpopint.
|
||||
|
||||
To discover that an Identity server is available at a specific URL,
|
||||
this endpoint can be queried and will return an empty object.
|
||||
|
||||
This is primarly used for auto-discovery and health check purposes
|
||||
by entities acting as a client for the Identity server.
|
||||
operationId: ping
|
||||
responses:
|
||||
200:
|
||||
description: An Identity server is ready to serve requests.
|
||||
examples:
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
@ -0,0 +1,114 @@
|
||||
# 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 Identity Service Store Invitations API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/store-invite":
|
||||
post:
|
||||
summary: Store pending invitations to a user\'s 3pid.
|
||||
description: |-
|
||||
Store pending invitations to a user\'s 3pid.
|
||||
|
||||
In addition to the request parameters specified below, an arbitrary
|
||||
number of other parameters may also be specified. These may be used in
|
||||
the invite message generation described below.
|
||||
|
||||
The service will generate a random token and an ephemeral key used for
|
||||
accepting the invite.
|
||||
|
||||
The service also generates a ``display_name`` for the inviter, which is
|
||||
a redacted version of ``address`` which does not leak the full contents
|
||||
of the ``address``.
|
||||
|
||||
The service records persistently all of the above information.
|
||||
|
||||
It also generates an email containing all of this data, sent to the
|
||||
``address`` parameter, notifying them of the invitation.
|
||||
|
||||
Also, the generated ephemeral public key will be listed as valid on
|
||||
requests to ``/_matrix/identity/api/v1/pubkey/ephemeral/isvalid``.
|
||||
operationId: storeInvite
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"medium": "email",
|
||||
"address": "foo@bar.baz",
|
||||
"room_id": "!something:example.tld",
|
||||
"sender": "@bob:example.com"
|
||||
}
|
||||
properties:
|
||||
medium:
|
||||
type: string
|
||||
description: The literal string ``email``.
|
||||
address:
|
||||
type: string
|
||||
description: The email address of the invited user.
|
||||
room_id:
|
||||
type: string
|
||||
description: The Matrix room ID to which the user is invited
|
||||
sender:
|
||||
type: string
|
||||
description: The Matrix user ID of the inviting user
|
||||
required: ["medium", "address", "room_id", "sender"]
|
||||
responses:
|
||||
200:
|
||||
description: The invitation was stored.
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
token:
|
||||
type: string
|
||||
description: The generated token.
|
||||
public_keys:
|
||||
type: array
|
||||
description: A list of [server\'s long-term public key, generated ephemeral public key].
|
||||
items:
|
||||
type: string
|
||||
display_name:
|
||||
type: string
|
||||
description: The generated (redacted) display_name.
|
||||
example:
|
||||
application/json: {
|
||||
"token": "sometoken",
|
||||
"public_keys": [
|
||||
"serverpublickey",
|
||||
"ephemeralpublickey"
|
||||
],
|
||||
"display_name": "f...@b..."
|
||||
}
|
||||
400:
|
||||
description: |
|
||||
An error has occured.
|
||||
|
||||
If the 3pid is already bound to a Matrix user ID, the error code
|
||||
will be ``M_THREEPID_IN_USE``. If the medium is unsupported, the
|
||||
error code will be ``M_UNRECOGNIZED``.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_THREEPID_IN_USE",
|
||||
"error": "Binding already known",
|
||||
"mxid": mxid
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
# OpenAPI Extensions
|
||||
|
||||
For some functionality that is not directly provided by the OpenAPI v2
|
||||
specification, some extensions have been added that are to be consistent
|
||||
across the specification. The defined extensions are listed below. Extensions
|
||||
should not break parsers, however if extra functionality is required, aware
|
||||
parsers should be able to take advantage of the added syntax.
|
||||
|
||||
## Extensible Query Parameters
|
||||
|
||||
<!-- TODO: Remove and change instances to 'explode' after OpenAPI/Swagger v3 update -->
|
||||
|
||||
If a unknown amount of query parameters can be added to a request, the `name`
|
||||
must be `fields...`, with the trailing ellipses representing the possibility
|
||||
of more fields.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
- in: query
|
||||
name: fields...
|
||||
type: string
|
||||
```
|
||||
|
||||
## Using oneOf to provide type alternatives
|
||||
|
||||
<!-- TODO: Remove this section after upgrading to OpenAPI v3 -->
|
||||
|
||||
`oneOf` (available in JSON Schema and Swagger/OpenAPI v3 but not in v2)
|
||||
is used in cases when a simpler type specification as a list of types
|
||||
doesn't work, as in the following example:
|
||||
```
|
||||
properties:
|
||||
old: # compliant with old Swagger
|
||||
type:
|
||||
- string
|
||||
- object # Cannot specify a schema here
|
||||
new: # uses oneOf extension
|
||||
oneOf:
|
||||
- type: string
|
||||
- type: object
|
||||
title: CustomSchemaForTheWin
|
||||
properties:
|
||||
...
|
||||
```
|
@ -0,0 +1,148 @@
|
||||
# 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 Federation Events API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8448
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/federation/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/backfill/{roomId}":
|
||||
get:
|
||||
summary: Retrieves the events which precede the given event
|
||||
description: |-
|
||||
Retrieves a sliding-window history of previous PDUs that occurred in the given room.
|
||||
Starting from the PDU ID(s) given in the ``v`` argument, the PDUs that preceded it
|
||||
are retrieved, up to the total number given by the ``limit``.
|
||||
operationId: backfillRoom
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
type: string
|
||||
description: The room ID to backfill.
|
||||
required: true
|
||||
x-example: "!SomeRoom:matrix.org"
|
||||
- in: query
|
||||
name: v
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: The event IDs to backfill from.
|
||||
required: true
|
||||
x-example: ["$abc123:matrix.org"]
|
||||
- in: query
|
||||
name: limit
|
||||
type: integer
|
||||
description: The maximum number of PDUs to retrieve, including the given events.
|
||||
required: true
|
||||
x-example: 2
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
A transaction containing the PDUs that preceded the given event(s), including the given
|
||||
event(s), up to the given limit.
|
||||
schema:
|
||||
$ref: "definitions/transaction.yaml"
|
||||
# Override the example to show the response of the request a bit better
|
||||
examples:
|
||||
application/json: {
|
||||
"$ref": "examples/transaction.json",
|
||||
"pdus": [
|
||||
{
|
||||
"$ref": "pdu.json",
|
||||
"room_id": "!SomeRoom:matrix.org",
|
||||
"event_id": "$abc123:matrix.org"
|
||||
},
|
||||
{
|
||||
"$ref": "pdu.json",
|
||||
"room_id": "!SomeRoom:matrix.org"
|
||||
},
|
||||
]
|
||||
}
|
||||
"/get_missing_events/{roomId}":
|
||||
post:
|
||||
summary: Retrieves events that the sender is missing
|
||||
description: |-
|
||||
Retrieves previous events that the sender is missing. This is done by doing a breadth-first
|
||||
walk of the ``prev_events`` for the ``latest_events``, ignoring any events in ``earliest_events``
|
||||
and stopping at the ``limit``.
|
||||
operationId: getMissingPreviousEvents
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
type: string
|
||||
description: The room ID to search in.
|
||||
required: true
|
||||
x-example: "!SomeRoom:matrix.org"
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
description: The maximum number of events to retrieve. Defaults to 10.
|
||||
example: 10
|
||||
min_depth:
|
||||
type: integer
|
||||
description: The minimum depth of events to retrieve. Defaults to 0.
|
||||
example: 0
|
||||
earliest_events:
|
||||
type: array
|
||||
description: |-
|
||||
The latest events that the sender already has. These are skipped when retrieving
|
||||
the previous events of ``latest_events``.
|
||||
items:
|
||||
type: string
|
||||
example: ["$missing_event:domain.com"]
|
||||
latest_events:
|
||||
type: array
|
||||
description: The events to retrieve the previous events for.
|
||||
items:
|
||||
type: string
|
||||
example: ["$event_that_has_the_missing_event_as_a_previous_event:domain.com"]
|
||||
required: ['earliest_events', 'latest_events']
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
The previous events for ``latest_events``, excluding any ``earliest_events``, up to the
|
||||
provided ``limit``.
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
events:
|
||||
type: array
|
||||
description: The missing events.
|
||||
items:
|
||||
$ref: definitions/pdu.yaml
|
||||
required: ['events']
|
||||
examples:
|
||||
application/json: {
|
||||
"events": [
|
||||
{"$ref": "examples/pdu.json"}
|
||||
]
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
# 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.
|
||||
|
||||
type: object
|
||||
title: Ephemeral Data Unit
|
||||
description: An ephemeral data unit.
|
||||
example:
|
||||
$ref: "../examples/edu.json"
|
||||
properties:
|
||||
edu_type:
|
||||
type: string
|
||||
description: The type of ephemeral message.
|
||||
example: "m.presence"
|
||||
content:
|
||||
type: object
|
||||
description: The content of the ephemeral message.
|
||||
required: ['edu_type', 'content']
|
@ -0,0 +1,71 @@
|
||||
# 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.
|
||||
|
||||
type: object
|
||||
title: m.presence
|
||||
description: |-
|
||||
An EDU representing presence updates for users of the sending homeserver.
|
||||
allOf:
|
||||
- $ref: ../edu.yaml
|
||||
- type: object
|
||||
properties:
|
||||
edu_type:
|
||||
type: enum
|
||||
enum: ['m.presence']
|
||||
description: The string ``m.presence``
|
||||
example: "m.presence"
|
||||
content:
|
||||
type: object
|
||||
description: The presence updates and requests.
|
||||
title: Presence Update
|
||||
properties:
|
||||
push:
|
||||
type: array
|
||||
description: |-
|
||||
A list of presence updates that the receiving server is likely
|
||||
to be interested in.
|
||||
items:
|
||||
type: object
|
||||
title: User Presence Update
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
description: The user ID this presence EDU is for.
|
||||
example: "@john:matrix.org"
|
||||
presence:
|
||||
type: enum
|
||||
enum: ['offline', 'unavailable', 'online']
|
||||
description: The presence of the user.
|
||||
example: "online"
|
||||
status_msg:
|
||||
type: string
|
||||
description: An optional description to accompany the presence.
|
||||
example: "Making cupcakes"
|
||||
last_active_ago:
|
||||
type: integer
|
||||
format: int64
|
||||
description: |-
|
||||
The number of milliseconds that have elapsed since the user
|
||||
last did something.
|
||||
example: 5000
|
||||
currently_active:
|
||||
type: boolean
|
||||
description: |-
|
||||
True if the user is likely to be interacting with their
|
||||
client. This may be indicated by the user having a
|
||||
``last_active_ago`` within the last few minutes. Defaults
|
||||
to false.
|
||||
example: true
|
||||
required: ['user_id', 'presence', 'last_active_ago']
|
||||
required: ['push']
|
@ -0,0 +1,46 @@
|
||||
# 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.
|
||||
|
||||
type: object
|
||||
title: m.presence_accept
|
||||
description: |-
|
||||
An EDU representing approval for the observing user to subscribe to the
|
||||
presence of the the observed user.
|
||||
allOf:
|
||||
- $ref: ../edu.yaml
|
||||
- type: object
|
||||
properties:
|
||||
edu_type:
|
||||
type: enum
|
||||
enum: ['m.presence_accept']
|
||||
description: The string ``m.presence_accept``
|
||||
example: "m.presence_accept"
|
||||
content:
|
||||
type: object
|
||||
description: The invite information.
|
||||
title: Invite Information
|
||||
properties:
|
||||
observed_user:
|
||||
type: string
|
||||
description: |-
|
||||
The user ID that has approved the ``observer_user`` to
|
||||
subscribe to their presence.
|
||||
example: "@alice:elsewhere.com"
|
||||
observer_user:
|
||||
type: string
|
||||
description: |-
|
||||
The user ID that requested to subscribe to the presence of
|
||||
the ``observed_user``.
|
||||
example: "@john:matrix.org"
|
||||
required: ['observer_user', 'observed_user']
|
@ -0,0 +1,55 @@
|
||||
# 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.
|
||||
|
||||
type: object
|
||||
title: m.presence_deny
|
||||
description: |-
|
||||
An EDU representing a declination or revocation for the observing user
|
||||
to subscribe to the presence of the observed user.
|
||||
example: {
|
||||
"origin": "domain.com",
|
||||
"destination": "elsewhere.org",
|
||||
"edu_type": "m.presence_deny",
|
||||
"content": {
|
||||
"observed_user": "@alice:elsewhere.org",
|
||||
"observer_user": "@john:domain.com"
|
||||
}
|
||||
}
|
||||
allOf:
|
||||
- $ref: ../edu.yaml
|
||||
- type: object
|
||||
properties:
|
||||
edu_type:
|
||||
type: enum
|
||||
enum: ['m.presence_deny']
|
||||
description: The string ``m.presence_deny``
|
||||
example: "m.presence_deny"
|
||||
content:
|
||||
type: object
|
||||
description: The invite information.
|
||||
title: Invite Information
|
||||
properties:
|
||||
observed_user:
|
||||
type: string
|
||||
description: |-
|
||||
The user ID that has declined or revoked the ``observer_user`` from
|
||||
subscribing to their presence.
|
||||
example: "@alice:elsewhere.com"
|
||||
observer_user:
|
||||
type: string
|
||||
description: |-
|
||||
The user ID that requested to subscribe to the presence of
|
||||
the ``observed_user``.
|
||||
example: "@john:matrix.org"
|
||||
required: ['observer_user', 'observed_user']
|
@ -0,0 +1,45 @@
|
||||
# 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.
|
||||
|
||||
type: object
|
||||
title: m.presence_invite
|
||||
description: |-
|
||||
An EDU representing a request to subscribe to a user's presence.
|
||||
allOf:
|
||||
- $ref: ../edu.yaml
|
||||
- type: object
|
||||
properties:
|
||||
edu_type:
|
||||
type: enum
|
||||
enum: ['m.presence_invite']
|
||||
description: The string ``m.presence_invite``
|
||||
example: "m.presence_invite"
|
||||
content:
|
||||
type: object
|
||||
description: The invite information.
|
||||
title: Invite Information
|
||||
properties:
|
||||
observed_user:
|
||||
type: string
|
||||
description: |-
|
||||
The user ID the ``observer_user`` would like to subscribe
|
||||
to the presence of.
|
||||
example: "@alice:elsewhere.com"
|
||||
observer_user:
|
||||
type: string
|
||||
description: |-
|
||||
The user ID that is wishing to subscribe to the presence of
|
||||
the ``observed_user``.
|
||||
example: "@john:matrix.org"
|
||||
required: ['observer_user', 'observed_user']
|
@ -0,0 +1,82 @@
|
||||
# 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.
|
||||
|
||||
type: object
|
||||
title: m.receipt
|
||||
description: |-
|
||||
An EDU representing receipt updates for users of the sending homeserver.
|
||||
When receiving receipts, the server should only update entries that are
|
||||
listed in the EDU. Receipts previously received that do not appear in the
|
||||
EDU should not be removed or otherwise manipulated.
|
||||
allOf:
|
||||
- $ref: ../edu.yaml
|
||||
- type: object
|
||||
properties:
|
||||
edu_type:
|
||||
type: enum
|
||||
enum: ['m.receipt']
|
||||
description: The string ``m.receipt``
|
||||
example: "m.receipt"
|
||||
content:
|
||||
type: object
|
||||
description: |-
|
||||
Receipts for a particular room. The string key is the room ID for
|
||||
which the receipts under it belong.
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Room Receipts
|
||||
properties:
|
||||
# We strongly define the receipt type to help spec future ones later
|
||||
# on. At that point, m.read can become optional (maybe).
|
||||
"m.read":
|
||||
type: object
|
||||
description: Read receipts for users in the room.
|
||||
title: User Read Receipt
|
||||
properties:
|
||||
event_ids:
|
||||
type: array
|
||||
description: |-
|
||||
The extremity event IDs that the user has read up to.
|
||||
minItems: 1
|
||||
maxItems: 1
|
||||
items:
|
||||
type: string
|
||||
example: ['$read_this_event:matrix.org']
|
||||
data:
|
||||
type: object
|
||||
description: Metadata for the read receipt.
|
||||
title: Read Receipt Metadata
|
||||
properties:
|
||||
ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: |-
|
||||
A POSIX timestamp in milliseconds for when the user read
|
||||
the event specified in the read receipt.
|
||||
example: 1533358089009
|
||||
required: ['ts']
|
||||
required: ['event_ids', 'data']
|
||||
required: ['m.read']
|
||||
example: {
|
||||
"!some_room:domain.com": {
|
||||
"m.read": {
|
||||
"@john:matrix.org": {
|
||||
"event_ids": ["$read_this_event:matrix.org"],
|
||||
"data": {
|
||||
"ts": 1533358089009
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
# 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.
|
||||
|
||||
type: object
|
||||
title: m.typing
|
||||
description: A typing notification EDU for a user in a room.
|
||||
allOf:
|
||||
- $ref: ../edu.yaml
|
||||
- type: object
|
||||
properties:
|
||||
edu_type:
|
||||
type: enum
|
||||
enum: ['m.typing']
|
||||
description: The string ``m.typing``
|
||||
example: "m.typing"
|
||||
content:
|
||||
type: object
|
||||
description: The typing notification.
|
||||
title: Typing Notification
|
||||
properties:
|
||||
room_id:
|
||||
type: string
|
||||
description: |-
|
||||
The room where the user's typing status has been updated.
|
||||
example: "!somewhere:matrix.org"
|
||||
user_id:
|
||||
type: string
|
||||
description: |-
|
||||
The user ID that has had their typing status changed.
|
||||
example: "@john:matrix.org"
|
||||
typing:
|
||||
type: boolean
|
||||
description: Whether the user is typing in the room or not.
|
||||
example: true
|
||||
required: ['room_id', 'user_id', 'typing']
|
@ -0,0 +1,87 @@
|
||||
# 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.
|
||||
type: object
|
||||
title: Invite Event
|
||||
description: An invite event
|
||||
allOf:
|
||||
- $ref: "pdu.yaml"
|
||||
- type: object
|
||||
properties:
|
||||
# Note: we override a bunch of parameters to change their descriptions
|
||||
sender:
|
||||
type: string
|
||||
# TODO: Verify/clarify this - it doesn't seem right, given this is a 'regular' invite
|
||||
description: |-
|
||||
The matrix ID of the user who sent the original ``m.room.third_party_invite``.
|
||||
example: "@someone:example.org"
|
||||
origin:
|
||||
type: string
|
||||
description: The name of the inviting homeserver.
|
||||
example: "matrix.org"
|
||||
origin_server_ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: A timestamp added by the inviting homeserver.
|
||||
example: 1234567890
|
||||
type:
|
||||
type: string
|
||||
description: The value ``m.room.member``.
|
||||
example: "m.room.member"
|
||||
state_key:
|
||||
type: string
|
||||
description: The user ID of the invited member.
|
||||
example: "@joe:elsewhere.com"
|
||||
content:
|
||||
type: object
|
||||
title: Membership Event Content
|
||||
description: |-
|
||||
The content of the event, matching what is available in the
|
||||
`Client-Server API`_. Must include a ``membership`` of ``invite``.
|
||||
example: {"membership": "invite"}
|
||||
properties:
|
||||
membership:
|
||||
type: string
|
||||
description: The value ``invite``.
|
||||
example: "invite"
|
||||
required: ['membership']
|
||||
auth_events:
|
||||
type: array
|
||||
description: |-
|
||||
An event reference list containing the authorization events that would
|
||||
allow the member to be invited to the room.
|
||||
items:
|
||||
type: array
|
||||
maxItems: 2
|
||||
minItems: 2
|
||||
items:
|
||||
- type: string
|
||||
title: Event ID
|
||||
example: "$abc123:matrix.org"
|
||||
- type: object
|
||||
title: Event Hash
|
||||
example: {
|
||||
"sha256": "abase64encodedsha256hashshouldbe43byteslong"
|
||||
}
|
||||
properties:
|
||||
sha256:
|
||||
type: string
|
||||
description: The event hash.
|
||||
example: abase64encodedsha256hashshouldbe43byteslong
|
||||
required: ['sha256']
|
||||
redacts:
|
||||
type: string
|
||||
description: Not used.
|
||||
required:
|
||||
# Every other field is already flagged as required by the $ref
|
||||
- state_key
|
@ -0,0 +1,110 @@
|
||||
# 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.
|
||||
type: object
|
||||
title: Server Keys
|
||||
description: Server keys
|
||||
example:
|
||||
$ref: "../examples/server_key.json"
|
||||
properties:
|
||||
server_name:
|
||||
type: string
|
||||
description: DNS name of the homeserver.
|
||||
required: true
|
||||
example: "example.org"
|
||||
verify_keys:
|
||||
type: object
|
||||
description: |-
|
||||
Public keys of the homeserver for verifying digital signatures.
|
||||
|
||||
The object's key is the algorithm and version combined (``ed25519`` being the
|
||||
algorithm and ``abc123`` being the version in the example below). Together,
|
||||
this forms the Key ID. The version must have characters matching the regular
|
||||
expression ``[a-zA-Z0-9_]``.
|
||||
required: true
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Verify Key
|
||||
example: {
|
||||
"ed25519:abc123": {
|
||||
"key": "VGhpcyBzaG91bGQgYmUgYSByZWFsIGVkMjU1MTkgcGF5bG9hZA"
|
||||
}
|
||||
}
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
description: The `Unpadded Base64`_ encoded key.
|
||||
required: true
|
||||
example: "VGhpcyBzaG91bGQgYmUgYSByZWFsIGVkMjU1MTkgcGF5bG9hZA"
|
||||
old_verify_keys:
|
||||
type: object
|
||||
description: |-
|
||||
The public keys that the server used to use and when it stopped using them.
|
||||
|
||||
The object's key is the algorithm and version combined (``ed25519`` being the
|
||||
algorithm and ``0ldK3y`` being the version in the example below). Together,
|
||||
this forms the Key ID. The version must have characters matching the regular
|
||||
expression ``[a-zA-Z0-9_]``.
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Old Verify Key
|
||||
example: {
|
||||
"ed25519:0ldK3y": {
|
||||
"expired_ts": 1532645052628,
|
||||
"key": "VGhpcyBzaG91bGQgYmUgeW91ciBvbGQga2V5J3MgZWQyNTUxOSBwYXlsb2FkLg"
|
||||
}
|
||||
}
|
||||
properties:
|
||||
expired_ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: POSIX timestamp in milliseconds for when this key expired.
|
||||
required: true
|
||||
example: 1532645052628
|
||||
key:
|
||||
type: string
|
||||
description: The `Unpadded Base64`_ encoded key.
|
||||
required: true
|
||||
example: "VGhpcyBzaG91bGQgYmUgeW91ciBvbGQga2V5J3MgZWQyNTUxOSBwYXlsb2FkLg"
|
||||
signatures:
|
||||
type: object
|
||||
description: Digital signatures for this object signed using the ``verify_keys``.
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Signed Server
|
||||
example: {
|
||||
"example.org": {
|
||||
"ad25519:abc123": "VGhpcyBzaG91bGQgYWN0dWFsbHkgYmUgYSBzaWduYXR1cmU"
|
||||
}
|
||||
}
|
||||
additionalProperties:
|
||||
type: string
|
||||
name: Encoded Signature Verification Key
|
||||
tls_fingerprints:
|
||||
type: array
|
||||
description: Hashes of X.509 TLS certificates used by this server.
|
||||
items:
|
||||
type: object
|
||||
title: TLS Fingerprint
|
||||
properties:
|
||||
sha256:
|
||||
type: string
|
||||
description: The `Unpadded Base64`_ encoded fingerprint.
|
||||
example: "VGhpcyBpcyBoYXNoIHdoaWNoIHNob3VsZCBiZSBieXRlcw"
|
||||
valid_until_ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: |-
|
||||
POSIX timestamp when the list of valid keys should be refreshed. Keys used beyond this
|
||||
timestamp are no longer valid.
|
||||
example: 1052262000000
|
@ -0,0 +1,27 @@
|
||||
# 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.
|
||||
type: object
|
||||
description: Server keys
|
||||
example: {
|
||||
"server_keys": [{
|
||||
$ref: "../examples/server_key_notary_signed.json"
|
||||
}]
|
||||
}
|
||||
properties:
|
||||
server_keys:
|
||||
type: array
|
||||
title: Server Keys
|
||||
description: The queried server's keys, signed by the notary server.
|
||||
items:
|
||||
$ref: "keys.yaml"
|
@ -0,0 +1,52 @@
|
||||
# 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.
|
||||
type: object
|
||||
title: Persistent Data Unit
|
||||
description: A persistent data unit (event)
|
||||
example:
|
||||
$ref: "../examples/pdu.json"
|
||||
allOf:
|
||||
- $ref: "unsigned_pdu.yaml"
|
||||
- type: object
|
||||
properties:
|
||||
hashes:
|
||||
type: object
|
||||
title: Event Hash
|
||||
description: Hashes of the PDU, following the algorithm specified in `Signing Events`_.
|
||||
example: {
|
||||
"sha256": "thishashcoversallfieldsincasethisisredacted"
|
||||
}
|
||||
properties:
|
||||
sha256:
|
||||
type: string
|
||||
description: The hash.
|
||||
example: thishashcoversallfieldsincasthisisredacted
|
||||
required: ['sha256']
|
||||
signatures:
|
||||
type: object
|
||||
description: |-
|
||||
Signatures for the PDU, following the algorithm specified in `Signing Events`_.
|
||||
example: {
|
||||
"example.com": {
|
||||
"ed25519:key_version:": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus"
|
||||
}
|
||||
}
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Server Signatures
|
||||
additionalProperties:
|
||||
type: string
|
||||
required:
|
||||
- hashes
|
||||
- signatures
|
@ -0,0 +1,19 @@
|
||||
# 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.
|
||||
signedRequest:
|
||||
type: apiKey
|
||||
description: |-
|
||||
The ``Authorization`` header defined in the `Authentication`_ section.
|
||||
name: Authorization
|
||||
in: header
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue