Merge branch 'm-master' into travis/general/3pid_invite
This commit is contained in:
commit
d57b977a55
189 changed files with 4567 additions and 1219 deletions
|
@ -23,9 +23,55 @@ buildswaggerui: &buildswaggerui
|
|||
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
|
||||
|
@ -37,7 +83,6 @@ jobs:
|
|||
- 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
|
||||
|
@ -50,6 +95,18 @@ jobs:
|
|||
- 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
|
||||
|
@ -58,6 +115,9 @@ workflows:
|
|||
jobs:
|
||||
- build-docs
|
||||
- build-swagger
|
||||
- check-docs
|
||||
- validate-docs
|
||||
- build-dev-scripts
|
||||
|
||||
notify:
|
||||
webhooks:
|
||||
|
|
|
@ -19,12 +19,14 @@ properties:
|
|||
protocol:
|
||||
description: The protocol ID that the third party location is a part of.
|
||||
type: string
|
||||
example: irc
|
||||
example: "irc"
|
||||
fields:
|
||||
description: Information used to identify this third party location.
|
||||
type: object
|
||||
example:
|
||||
"network": "freenode"
|
||||
example: {
|
||||
"network": "freenode",
|
||||
"channel": "#matrix"
|
||||
}
|
||||
required: ['alias', 'protocol', 'fields']
|
||||
title: Location
|
||||
type: object
|
|
@ -11,41 +11,60 @@
|
|||
# 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 used to identify a third party user.
|
||||
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 used to identify a third party location.
|
||||
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: An icon representing the third party protocol.
|
||||
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: All location or user fields should have an entry here.
|
||||
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
|
||||
properties:
|
||||
fieldname:
|
||||
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.
|
||||
type: string
|
||||
placeholder:
|
||||
description: An placeholder serving as a valid example of the field value.
|
||||
type: string
|
||||
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]+",
|
||||
|
@ -63,17 +82,32 @@ properties:
|
|||
instances:
|
||||
description: |-
|
||||
A list of objects representing independent instances of configuration.
|
||||
For instance multiple networks on IRC if multiple are bridged by the
|
||||
same bridge.
|
||||
For example, multiple networks on IRC if multiple are provided by the
|
||||
same application service.
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
example: {
|
||||
"desc": "Freenode",
|
||||
"icon": "mxc://example.org/JkLmNoPq",
|
||||
"fields": {
|
||||
"network": "freenode.net",
|
||||
}
|
||||
}
|
||||
title: Protocol
|
||||
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']
|
||||
|
|
|
@ -36,6 +36,7 @@ example: {
|
|||
},
|
||||
"instances": [
|
||||
{
|
||||
"network_id": "freenode",
|
||||
"desc": "Freenode",
|
||||
"icon": "mxc://example.org/JkLmNoPq",
|
||||
"fields": {
|
||||
|
@ -59,6 +60,7 @@ example: {
|
|||
},
|
||||
"instances": [
|
||||
{
|
||||
"network_id": "gitter",
|
||||
"desc": "Gitter",
|
||||
"icon": "mxc://example.org/zXyWvUt",
|
||||
"fields": {}
|
||||
|
|
18
api/application-service/definitions/security.yaml
Normal file
18
api/application-service/definitions/security.yaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
# 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.
|
||||
homeserverAccessToken:
|
||||
type: apiKey
|
||||
description: The ``hs_token`` provided by the application service's registration.
|
||||
name: access_token
|
||||
in: query
|
|
@ -21,11 +21,13 @@ properties:
|
|||
protocol:
|
||||
description: The protocol ID that the third party location is a part of.
|
||||
type: string
|
||||
example: gitter
|
||||
example: "gitter"
|
||||
fields:
|
||||
description: Information used to identify this third party location.
|
||||
type: object
|
||||
example:
|
||||
example: {
|
||||
"user": "jim"
|
||||
}
|
||||
required: ['userid', 'protocol', 'fields']
|
||||
title: User
|
||||
type: object
|
|
@ -1,4 +1,3 @@
|
|||
# Copyright 2016 OpenMarket Ltd
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@ -20,194 +19,15 @@ host: localhost:8008
|
|||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: "/"
|
||||
basePath: /_matrix/app/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
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.
|
||||
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": [
|
||||
{
|
||||
"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.
|
||||
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
|
||||
"/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.
|
||||
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
|
||||
"/_matrix/app/unstable/thirdparty/protocol/{protocol}":
|
||||
"/thirdparty/protocol/{protocol}":
|
||||
get:
|
||||
summary: Retrieve metadata about a specific protocol that the application service supports.
|
||||
description: |-
|
||||
|
@ -215,6 +35,8 @@ paths:
|
|||
with specific information about the various third party networks that
|
||||
an application service supports.
|
||||
operationId: getProtocolMetadata
|
||||
security:
|
||||
- homeserverAccessToken: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
|
@ -254,7 +76,7 @@ paths:
|
|||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
"/_matrix/app/unstable/thirdparty/user/{protocol}":
|
||||
"/thirdparty/user/{protocol}":
|
||||
get:
|
||||
summary: Retrieve the Matrix User ID of a corresponding third party user.
|
||||
description: |-
|
||||
|
@ -262,6 +84,8 @@ paths:
|
|||
User ID linked to a user on the third party network, given a set of
|
||||
user parameters.
|
||||
operationId: queryUserByProtocol
|
||||
security:
|
||||
- homeserverAccessToken: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
|
@ -307,12 +131,14 @@ paths:
|
|||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
"/_matrix/app/unstable/thirdparty/location/{protocol}":
|
||||
"/thirdparty/location/{protocol}":
|
||||
get:
|
||||
summary: Retreive Matrix-side portal rooms leading to a third party location.
|
||||
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
|
||||
security:
|
||||
- homeserverAccessToken: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
|
@ -358,13 +184,15 @@ paths:
|
|||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
"/_matrix/app/unstable/thirdparty/location":
|
||||
"/thirdparty/location":
|
||||
get:
|
||||
summary: Reverse-lookup third party locations given a Matrix room alias.
|
||||
description: |-
|
||||
Retreive an array of third party network locations from a Matrix room
|
||||
Retrieve an array of third party network locations from a Matrix room
|
||||
alias.
|
||||
operationId: queryLocationByAlias
|
||||
security:
|
||||
- homeserverAccessToken: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: alias
|
||||
|
@ -403,12 +231,14 @@ paths:
|
|||
}
|
||||
schema:
|
||||
$ref: ../client-server/definitions/errors/error.yaml
|
||||
"/_matrix/app/unstable/thirdparty/user":
|
||||
"/thirdparty/user":
|
||||
get:
|
||||
summary: Reverse-lookup third party users given a Matrix User ID.
|
||||
description: |-
|
||||
Retreive an array of third party users from a Matrix User ID.
|
||||
Retrieve an array of third party users from a Matrix User ID.
|
||||
operationId: queryUserByID
|
||||
security:
|
||||
- homeserverAccessToken: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: userid
|
90
api/application-service/query_room.yaml
Normal file
90
api/application-service/query_room.yaml
Normal file
|
@ -0,0 +1,90 @@
|
|||
# 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: /_matrix/app/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
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
|
||||
security:
|
||||
- homeserverAccessToken: []
|
||||
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
|
87
api/application-service/query_user.yaml
Normal file
87
api/application-service/query_user.yaml
Normal file
|
@ -0,0 +1,87 @@
|
|||
# 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: /_matrix/app/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
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
|
||||
security:
|
||||
- homeserverAccessToken: []
|
||||
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
|
78
api/application-service/transactions.yaml
Normal file
78
api/application-service/transactions.yaml
Normal file
|
@ -0,0 +1,78 @@
|
|||
# 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: /_matrix/app/v1
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
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
|
||||
security:
|
||||
- homeserverAccessToken: []
|
||||
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
|
|
@ -105,7 +105,8 @@ paths:
|
|||
type: string
|
||||
description: Most recently seen IP address of the session.
|
||||
last_seen:
|
||||
type: number
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unix timestamp that the session was last active.
|
||||
user_agent:
|
||||
type: string
|
||||
|
|
|
@ -66,7 +66,7 @@ paths:
|
|||
medium:
|
||||
type: string
|
||||
description: The medium of the third party identifier.
|
||||
enum: ["email"]
|
||||
enum: ["email", "msisdn"]
|
||||
address:
|
||||
type: string
|
||||
description: The third party identifier address.
|
||||
|
@ -143,7 +143,21 @@ paths:
|
|||
validation tokens when adding an email address to an account. This API's
|
||||
parameters and response is identical to that of the HS API
|
||||
|/register/email/requestToken|_ endpoint.
|
||||
operationId: requestTokenTo3PID
|
||||
operationId: requestTokenTo3PIDEmail
|
||||
responses:
|
||||
200:
|
||||
description: An email was sent to the given address
|
||||
description: An email was sent to the given address.
|
||||
"/account/3pid/msisdn/requestToken":
|
||||
post:
|
||||
summary: Requests a validation token be sent to the given email address for the purpose of adding a phone number to an account.
|
||||
description: |-
|
||||
Proxies the identity server API ``validate/msisdn/requestToken``, but
|
||||
first checks that the given phone number is **not** already associated
|
||||
with an account on this Home Server. This API should be used to request
|
||||
validation tokens when adding a phone number to an account. This API's
|
||||
parameters and response is identical to that of the HS API
|
||||
|/register/msisdn/requestToken|_ endpoint.
|
||||
operationId: requestTokenTo3PIDMSISDN
|
||||
responses:
|
||||
200:
|
||||
description: An SMS message was sent to the given phone number.
|
||||
|
|
88
api/client-server/appservice_room_directory.yaml
Normal file
88
api/client-server/appservice_room_directory.yaml
Normal file
|
@ -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
|
|
@ -259,7 +259,8 @@ paths:
|
|||
description: "The URL to get a preview of"
|
||||
required: true
|
||||
- in: query
|
||||
type: number
|
||||
type: integer
|
||||
format: int64
|
||||
x-example: 1510610716656
|
||||
name: ts
|
||||
description: |-
|
||||
|
@ -276,7 +277,8 @@ paths:
|
|||
type: object
|
||||
properties:
|
||||
"matrix:image:size":
|
||||
type: number
|
||||
type: integer
|
||||
format: int64
|
||||
description: |-
|
||||
The byte-size of the image. Omitted if there is no image attached.
|
||||
"og:image":
|
||||
|
@ -324,7 +326,8 @@ paths:
|
|||
type: object
|
||||
properties:
|
||||
m.upload.size:
|
||||
type: number
|
||||
type: integer
|
||||
format: int64
|
||||
description: |-
|
||||
The maximum size an upload can be in bytes.
|
||||
Clients SHOULD use this as a guide when uploading content.
|
||||
|
|
|
@ -39,16 +39,20 @@ paths:
|
|||
apply the events implied by the request in the following order:
|
||||
|
||||
0. A default ``m.room.power_levels`` event, giving the room creator
|
||||
(and not other members) permission to send state events.
|
||||
(and not other members) permission to send state events. Overridden
|
||||
by the ``power_level_content_override`` parameter.
|
||||
|
||||
1. Events set by the ``preset``.
|
||||
1. Events set by the ``preset``. Currently these are the ``m.room.join_rules``,
|
||||
``m.room.history_visibility``, and ``m.room.guest_access`` state events.
|
||||
|
||||
2. Events listed in ``initial_state``, in the order that they are
|
||||
listed.
|
||||
|
||||
3. Events implied by ``name`` and ``topic``.
|
||||
3. Events implied by ``name`` and ``topic`` (``m.room.name`` and ``m.room.topic``
|
||||
state events).
|
||||
|
||||
4. Invite events implied by ``invite`` and ``invite_3pid``.
|
||||
4. Invite events implied by ``invite`` and ``invite_3pid`` (``m.room.member`` with
|
||||
``membership: invite`` and ``m.room.third_party_invite``).
|
||||
|
||||
The available presets do the following with respect to room state:
|
||||
|
||||
|
@ -60,6 +64,9 @@ paths:
|
|||
``public_chat`` ``public`` ``shared`` ``forbidden``
|
||||
======================== ============== ====================== ================ =========
|
||||
|
||||
The server will create a ``m.room.create`` event in the room with the
|
||||
requesting user as the creator, alongside other keys provided in the
|
||||
``creation_content``.
|
||||
operationId: createRoom
|
||||
security:
|
||||
- accessToken: []
|
||||
|
@ -70,14 +77,14 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"preset": "public_chat",
|
||||
"room_alias_name": "thepub",
|
||||
"name": "The Grand Duke Pub",
|
||||
"topic": "All about happy hour",
|
||||
"creation_content": {
|
||||
"m.federate": false
|
||||
}
|
||||
"preset": "public_chat",
|
||||
"room_alias_name": "thepub",
|
||||
"name": "The Grand Duke Pub",
|
||||
"topic": "All about happy hour",
|
||||
"creation_content": {
|
||||
"m.federate": false
|
||||
}
|
||||
}
|
||||
properties:
|
||||
visibility:
|
||||
type: string
|
||||
|
@ -98,6 +105,9 @@ paths:
|
|||
created the room. For example, if this was set to "foo" and
|
||||
sent to the homeserver "example.com" the complete room alias
|
||||
would be ``#foo:example.com``.
|
||||
|
||||
The complete room alias will become the canonical alias for
|
||||
the room.
|
||||
name:
|
||||
type: string
|
||||
description: |-
|
||||
|
@ -137,14 +147,22 @@ paths:
|
|||
type: string
|
||||
description: The invitee's third party identifier.
|
||||
required: ["id_server", "medium", "address"]
|
||||
room_version:
|
||||
type: string
|
||||
description: |-
|
||||
The room version to set for the room. If not provided, the homeserver is
|
||||
to use its configured default. If provided, the homeserver will return a
|
||||
400 error with the errcode ``M_UNSUPPORTED_ROOM_VERSION`` if it does not
|
||||
support the room version.
|
||||
example: "1"
|
||||
creation_content:
|
||||
title: CreationContent
|
||||
type: object
|
||||
description: |-
|
||||
Extra keys to be added to the content of the ``m.room.create``.
|
||||
The server will clobber the following keys: ``creator``. Future
|
||||
versions of the specification may allow the server to clobber
|
||||
other keys.
|
||||
Extra keys, such as ``m.federate``, to be added to the content
|
||||
of the `m.room.create`_ event. The server will clobber the following
|
||||
keys: ``creator``, ``room_version``. Future versions of the specification
|
||||
may allow the server to clobber other keys.
|
||||
initial_state:
|
||||
type: array
|
||||
description: |-
|
||||
|
@ -175,16 +193,25 @@ paths:
|
|||
description: |-
|
||||
Convenience parameter for setting various default state events
|
||||
based on a preset.
|
||||
|
||||
If unspecified, the server should use the ``visibility`` to determine
|
||||
which preset to use. A visbility of ``public`` equates to a preset of
|
||||
``public_chat`` and ``private`` visibility equates to a preset of
|
||||
``private_chat``.
|
||||
is_direct:
|
||||
type: boolean
|
||||
description: |-
|
||||
This flag makes the server set the ``is_direct`` flag on the
|
||||
``m.room.member`` events sent to the users in ``invite`` and
|
||||
``invite_3pid``. See `Direct Messaging`_ for more information.
|
||||
guest_can_join:
|
||||
type: boolean
|
||||
power_level_content_override:
|
||||
title: Power Level Event Content
|
||||
type: object
|
||||
description: |-
|
||||
Allows guests to join the room. See `Guest Access`_ for more information.
|
||||
The power level content to override in the default power level
|
||||
event. This object is applied on top of the generated `m.room.power_levels`_
|
||||
event content prior to it being sent to the room. Defaults to
|
||||
overriding nothing.
|
||||
responses:
|
||||
200:
|
||||
description: Information about the newly created room.
|
||||
|
@ -196,10 +223,11 @@ paths:
|
|||
type: string
|
||||
description: |-
|
||||
The created room's ID.
|
||||
required: ['room_id']
|
||||
examples:
|
||||
application/json: {
|
||||
"room_id": "!sefiuhWgwghwWgh:example.com"
|
||||
}
|
||||
"room_id": "!sefiuhWgwghwWgh:example.com"
|
||||
}
|
||||
400:
|
||||
description: |-
|
||||
|
||||
|
@ -218,6 +246,5 @@ paths:
|
|||
``M_INVALID_ROOM_STATE``).
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
|
||||
tags:
|
||||
- Room creation
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# 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: Filter
|
||||
title: EventFilter
|
||||
properties:
|
||||
limit:
|
||||
description: The maximum number of events to return.
|
||||
|
|
|
@ -45,7 +45,7 @@ properties:
|
|||
description: |-
|
||||
The name of the room, if any.
|
||||
num_joined_members:
|
||||
type: number
|
||||
type: integer
|
||||
description: |-
|
||||
The number of members joined to the room.
|
||||
room_id:
|
||||
|
@ -82,7 +82,7 @@ properties:
|
|||
absence of this token means there are no results before this
|
||||
batch, i.e. this is the first batch.
|
||||
total_room_count_estimate:
|
||||
type: number
|
||||
type: integer
|
||||
description: |-
|
||||
An estimate on the total number of public rooms, if the
|
||||
server has an estimate.
|
||||
|
|
|
@ -13,23 +13,23 @@
|
|||
# limitations under the License.
|
||||
allOf:
|
||||
- $ref: event_filter.yaml
|
||||
title: RoomEventFilter
|
||||
properties:
|
||||
not_rooms:
|
||||
description: A list of room IDs to exclude. If this list is absent then no rooms
|
||||
are excluded. A matching room will be excluded even if it is listed in the ``'rooms'``
|
||||
filter.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
rooms:
|
||||
description: A list of room IDs to include. If this list is absent then all rooms
|
||||
are included.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
contains_url:
|
||||
type: boolean
|
||||
description: If ``true``, includes only events with a url key in their content. If
|
||||
``false``, excludes those events.
|
||||
type: object
|
||||
- type: object
|
||||
title: RoomEventFilter
|
||||
properties:
|
||||
not_rooms:
|
||||
description: A list of room IDs to exclude. If this list is absent then no rooms
|
||||
are excluded. A matching room will be excluded even if it is listed in the ``'rooms'``
|
||||
filter.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
rooms:
|
||||
description: A list of room IDs to include. If this list is absent then all rooms
|
||||
are included.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
contains_url:
|
||||
type: boolean
|
||||
description: If ``true``, includes only events with a ``url`` key in their content. If
|
||||
``false``, excludes those events. Defaults to ``false``.
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
# 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: Filter
|
||||
properties:
|
||||
event_fields:
|
||||
description: List of event fields to include. If this list is absent then all
|
||||
|
@ -40,6 +42,7 @@ properties:
|
|||
room:
|
||||
title: RoomFilter
|
||||
description: Filters to be applied to room data.
|
||||
type: object
|
||||
properties:
|
||||
not_rooms:
|
||||
description: A list of room IDs to exclude. If this list is absent then no rooms
|
||||
|
@ -76,5 +79,3 @@ properties:
|
|||
allOf:
|
||||
- $ref: room_event_filter.yaml
|
||||
description: The per user account data to include for rooms.
|
||||
type: object
|
||||
type: object
|
||||
|
|
24
api/client-server/definitions/wellknown/homeserver.yaml
Normal file
24
api/client-server/definitions/wellknown/homeserver.yaml
Normal file
|
@ -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: Homeserver Information
|
||||
description: |-
|
||||
Used by clients to discover homeserver information.
|
||||
type: object
|
||||
properties:
|
||||
base_url:
|
||||
type: string
|
||||
description: The base URL for the homeserver for client-server connections.
|
||||
example: https://matrix.example.com
|
||||
required:
|
||||
- base_url
|
24
api/client-server/definitions/wellknown/identity_server.yaml
Normal file
24
api/client-server/definitions/wellknown/identity_server.yaml
Normal file
|
@ -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: Identity Server Information
|
||||
description: |-
|
||||
Used by clients to discover identity server information.
|
||||
type: object
|
||||
properties:
|
||||
base_url:
|
||||
type: string
|
||||
description: The base URL for the identity server for client-server connections.
|
||||
example: https://identity.example.com
|
||||
required:
|
||||
- base_url
|
|
@ -41,7 +41,7 @@ paths:
|
|||
required: true
|
||||
x-example: "#monkeys:matrix.org"
|
||||
- in: body
|
||||
name: roomInfo
|
||||
name: body
|
||||
description: Information about this room alias.
|
||||
required: true
|
||||
schema:
|
||||
|
@ -50,24 +50,24 @@ paths:
|
|||
room_id:
|
||||
type: string
|
||||
description: The room ID to set.
|
||||
required: ['room_id']
|
||||
example: {
|
||||
"room_id": "!abnjk1jdasj98:capuchins.com"
|
||||
}
|
||||
"room_id": "!abnjk1jdasj98:capuchins.com"
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: The mapping was created.
|
||||
examples:
|
||||
application/json: {
|
||||
}
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
||||
409:
|
||||
description: A room alias with that name already exists.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_UNKNOWN",
|
||||
"error": "Room alias #monkeys:matrix.org already exists."
|
||||
}
|
||||
"errcode": "M_UNKNOWN",
|
||||
"error": "Room alias #monkeys:matrix.org already exists."
|
||||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
tags:
|
||||
|
|
|
@ -54,44 +54,45 @@ paths:
|
|||
allOf:
|
||||
- $ref: "definitions/sync_filter.yaml"
|
||||
example: {
|
||||
"room": {
|
||||
"state": {
|
||||
"types": ["m.room.*"],
|
||||
"not_rooms": ["!726s6s6q:example.com"]
|
||||
},
|
||||
"timeline": {
|
||||
"limit": 10,
|
||||
"types": ["m.room.message"],
|
||||
"not_rooms": ["!726s6s6q:example.com"],
|
||||
"not_senders": ["@spam:example.com"]
|
||||
},
|
||||
"ephemeral": {
|
||||
"types": ["m.receipt", "m.typing"],
|
||||
"not_rooms": ["!726s6s6q:example.com"],
|
||||
"not_senders": ["@spam:example.com"]
|
||||
}
|
||||
"room": {
|
||||
"state": {
|
||||
"types": ["m.room.*"],
|
||||
"not_rooms": ["!726s6s6q:example.com"]
|
||||
},
|
||||
"presence": {
|
||||
"types": ["m.presence"],
|
||||
"not_senders": ["@alice:example.com"]
|
||||
"timeline": {
|
||||
"limit": 10,
|
||||
"types": ["m.room.message"],
|
||||
"not_rooms": ["!726s6s6q:example.com"],
|
||||
"not_senders": ["@spam:example.com"]
|
||||
},
|
||||
"event_format": "client",
|
||||
"event_fields": ["type", "content", "sender"]
|
||||
}
|
||||
"ephemeral": {
|
||||
"types": ["m.receipt", "m.typing"],
|
||||
"not_rooms": ["!726s6s6q:example.com"],
|
||||
"not_senders": ["@spam:example.com"]
|
||||
}
|
||||
},
|
||||
"presence": {
|
||||
"types": ["m.presence"],
|
||||
"not_senders": ["@alice:example.com"]
|
||||
},
|
||||
"event_format": "client",
|
||||
"event_fields": ["type", "content", "sender"]
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: The filter was created.
|
||||
examples:
|
||||
application/json: {
|
||||
"filter_id": "66696p746572"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
filter_id:
|
||||
type: string
|
||||
description: |-
|
||||
The ID of the filter that was created.
|
||||
The ID of the filter that was created. Cannot start
|
||||
with a ``{`` as this character is used to determine
|
||||
if the filter provided is inline JSON or a previously
|
||||
declared filter by homeservers on some APIs.
|
||||
example: "66696p746572"
|
||||
required: ['filter_id']
|
||||
tags:
|
||||
- Room participation
|
||||
"/user/{userId}/filter/{filterId}":
|
||||
|
|
|
@ -194,7 +194,7 @@ paths:
|
|||
"user_id": "@alice:example.com",
|
||||
"device_id": "JLAFKJWSCS",
|
||||
"algorithms": [
|
||||
"m.olm.curve25519-aes-sha256",
|
||||
"m.olm.v1.curve25519-aes-sha256",
|
||||
"m.megolm.v1.aes-sha"
|
||||
],
|
||||
"keys": {
|
||||
|
@ -247,7 +247,7 @@ paths:
|
|||
description: algorithm
|
||||
example: "signed_curve25519"
|
||||
example:
|
||||
"@alice:example.com": { "JLAFKJWSCS": "curve25519" }
|
||||
"@alice:example.com": { "JLAFKJWSCS": "signed_curve25519" }
|
||||
required:
|
||||
- one_time_keys
|
||||
responses:
|
||||
|
|
|
@ -123,7 +123,7 @@ paths:
|
|||
parameters:
|
||||
- in: query
|
||||
name: limit
|
||||
type: number
|
||||
type: integer
|
||||
description: |-
|
||||
Limit the number of results returned.
|
||||
- in: query
|
||||
|
@ -173,7 +173,7 @@ paths:
|
|||
type: object
|
||||
properties:
|
||||
limit:
|
||||
type: number
|
||||
type: integer
|
||||
description: |-
|
||||
Limit the number of results returned.
|
||||
since:
|
||||
|
@ -194,8 +194,26 @@ paths:
|
|||
description: |-
|
||||
A string to search for in the room metadata, e.g. name,
|
||||
topic, canonical alias etc. (Optional).
|
||||
include_all_networks:
|
||||
type: boolean
|
||||
description: |-
|
||||
Whether or not to include all known networks/protocols from
|
||||
application services on the homeserver. Defaults to false.
|
||||
example: false
|
||||
third_party_instance_id:
|
||||
type: string
|
||||
description: |-
|
||||
The specific third party network/protocol to request from the
|
||||
homeserver. Can only be used if ``include_all_networks`` is false.
|
||||
example: "irc"
|
||||
example: {
|
||||
"limit": 10, "filter": {"generic_search_term": "foo"}}
|
||||
"limit": 10,
|
||||
"filter": {
|
||||
"generic_search_term": "foo"
|
||||
},
|
||||
"include_all_networks": false,
|
||||
"third_party_instance_id": "irc"
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: A list of the rooms on the server.
|
||||
|
@ -233,7 +251,7 @@ paths:
|
|||
description: |-
|
||||
The name of the room, if any.
|
||||
num_joined_members:
|
||||
type: number
|
||||
type: integer
|
||||
description: |-
|
||||
The number of members joined to the room.
|
||||
room_id:
|
||||
|
@ -270,7 +288,7 @@ paths:
|
|||
absence of this token means there are no results before this
|
||||
batch, i.e. this is the first batch.
|
||||
total_room_count_estimate:
|
||||
type: number
|
||||
type: integer
|
||||
description: |-
|
||||
An estimate on the total number of public rooms, if the
|
||||
server has an estimate.
|
||||
|
|
|
@ -45,7 +45,7 @@ paths:
|
|||
required: false
|
||||
x-example: "xxxxx"
|
||||
- in: query
|
||||
type: number
|
||||
type: integer
|
||||
name: limit
|
||||
description: Limit on the number of events to return in this request.
|
||||
required: false
|
||||
|
|
103
api/client-server/openid.yaml
Normal file
103
api/client-server/openid.yaml
Normal file
|
@ -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
|
|
@ -1,4 +1,5 @@
|
|||
# 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.
|
||||
|
@ -31,30 +32,30 @@ paths:
|
|||
get:
|
||||
summary: Gets the current pushers for the authenticated user
|
||||
description: |-
|
||||
Gets all currently active pushers for the authenticated user
|
||||
Gets all currently active pushers for the authenticated user.
|
||||
operationId: getPushers
|
||||
security:
|
||||
- accessToken: []
|
||||
responses:
|
||||
200:
|
||||
description: The pushers for this user
|
||||
description: The pushers for this user.
|
||||
examples:
|
||||
application/json: {
|
||||
"pushers": [
|
||||
{
|
||||
"pushkey": "Xp/MzCt8/9DcSNE9cuiaoT5Ac55job3TdLSSmtmYl4A=",
|
||||
"kind": "http",
|
||||
"app_id": "face.mcapp.appy.prod",
|
||||
"app_display_name": "Appy McAppface",
|
||||
"device_display_name": "Alice's Phone",
|
||||
"profile_tag": "xyz",
|
||||
"lang": "en-US",
|
||||
"data": {
|
||||
"url": "https://example.com/_matrix/push/v1/notify"
|
||||
}
|
||||
"pushers": [
|
||||
{
|
||||
"pushkey": "Xp/MzCt8/9DcSNE9cuiaoT5Ac55job3TdLSSmtmYl4A=",
|
||||
"kind": "http",
|
||||
"app_id": "face.mcapp.appy.prod",
|
||||
"app_display_name": "Appy McAppface",
|
||||
"device_display_name": "Alice's Phone",
|
||||
"profile_tag": "xyz",
|
||||
"lang": "en-US",
|
||||
"data": {
|
||||
"url": "https://example.com/_matrix/push/v1/notify"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -70,7 +71,7 @@ paths:
|
|||
pushkey:
|
||||
type: string
|
||||
description: |-
|
||||
This is a unique identifier for this pusher. See `/set` for
|
||||
This is a unique identifier for this pusher. See ``/set`` for
|
||||
more detail.
|
||||
Max length, 512 bytes.
|
||||
kind:
|
||||
|
@ -115,6 +116,19 @@ paths:
|
|||
description: |-
|
||||
Required if ``kind`` is ``http``. The URL to use to send
|
||||
notifications to.
|
||||
format:
|
||||
type: string
|
||||
description: |-
|
||||
The format to use when sending notifications to the Push
|
||||
Gateway.
|
||||
required:
|
||||
- pushkey
|
||||
- app_id
|
||||
- kind
|
||||
- app_display_name
|
||||
- device_display_name
|
||||
- lang
|
||||
- data
|
||||
tags:
|
||||
- Push notifications
|
||||
"/pushers/set":
|
||||
|
@ -130,23 +144,24 @@ paths:
|
|||
parameters:
|
||||
- in: body
|
||||
name: pusher
|
||||
description: The pusher information
|
||||
description: The pusher information.
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"lang": "en",
|
||||
"kind": "http",
|
||||
"app_display_name": "Mat Rix",
|
||||
"device_display_name": "iPhone 9",
|
||||
"profile_tag": "xxyyzz",
|
||||
"app_id": "com.example.app.ios",
|
||||
"pushkey": "APA91bHPRgkF3JUikC4ENAHEeMrd41Zxv3hVZjC9KtT8OvPVGJ-hQMRKRrZuJAEcl7B338qju59zJMjw2DELjzEvxwYv7hH5Ynpc1ODQ0aT4U4OFEeco8ohsN5PjL1iC2dNtk2BAokeMCg2ZXKqpc8FXKmhX94kIxQ",
|
||||
"data": {
|
||||
"url": "https://push-gateway.location.here"
|
||||
},
|
||||
"append": false
|
||||
}
|
||||
"lang": "en",
|
||||
"kind": "http",
|
||||
"app_display_name": "Mat Rix",
|
||||
"device_display_name": "iPhone 9",
|
||||
"profile_tag": "xxyyzz",
|
||||
"app_id": "com.example.app.ios",
|
||||
"pushkey": "APA91bHPRgkF3JUikC4ENAHEeMrd41Zxv3hVZjC9KtT8OvPVGJ-hQMRKRrZuJAEcl7B338qju59zJMjw2DELjzEvxwYv7hH5Ynpc1ODQ0aT4U4OFEeco8ohsN5PjL1iC2dNtk2BAokeMCg2ZXKqpc8FXKmhX94kIxQ",
|
||||
"data": {
|
||||
"url": "https://push-gateway.location.here/_matrix/push/v1/notify",
|
||||
"format": "event_id_only"
|
||||
},
|
||||
"append": false
|
||||
}
|
||||
properties:
|
||||
pushkey:
|
||||
type: string
|
||||
|
@ -157,11 +172,15 @@ paths:
|
|||
for APNS or the Registration ID for GCM. If your notification
|
||||
client has no such concept, use any unique identifier.
|
||||
Max length, 512 bytes.
|
||||
|
||||
If the ``kind`` is ``"email"``, this is the email address to
|
||||
send notifications to.
|
||||
kind:
|
||||
type: string
|
||||
description: |-
|
||||
The kind of pusher to configure. ``"http"`` makes a pusher that
|
||||
sends HTTP pokes. ``null`` deletes the pusher.
|
||||
sends HTTP pokes. ``"email"`` makes a pusher that emails the
|
||||
user with unread notifications. ``null`` deletes the pusher.
|
||||
app_id:
|
||||
type: string
|
||||
description: |-
|
||||
|
@ -169,6 +188,8 @@ paths:
|
|||
It is recommended that this end with the platform, such that
|
||||
different platform versions get different app identifiers.
|
||||
Max length, 64 chars.
|
||||
|
||||
If the ``kind`` is ``"email"``, this is ``"m.email"``.
|
||||
app_display_name:
|
||||
type: string
|
||||
description: |-
|
||||
|
@ -188,7 +209,7 @@ paths:
|
|||
type: string
|
||||
description: |-
|
||||
The preferred language for receiving notifications (e.g. 'en'
|
||||
or 'en-US')
|
||||
or 'en-US').
|
||||
data:
|
||||
type: object
|
||||
description: |-
|
||||
|
@ -201,7 +222,17 @@ paths:
|
|||
type: string
|
||||
description: |-
|
||||
Required if ``kind`` is ``http``. The URL to use to send
|
||||
notifications to.
|
||||
notifications to. MUST be an HTTPS URL with a path of
|
||||
``/_matrix/push/v1/notify``.
|
||||
example: "https://push-gateway.location.here/_matrix/push/v1/notify"
|
||||
format:
|
||||
type: string
|
||||
description: |-
|
||||
The format to send notifications in to Push Gateways if the
|
||||
``kind`` is ``http``. The details about what fields the
|
||||
homeserver should send to the push gateway are defined in the
|
||||
`Push Gateway Specification`_. Currently the only format
|
||||
available is 'event_id_only'.
|
||||
append:
|
||||
type: boolean
|
||||
description: |-
|
||||
|
@ -216,17 +247,17 @@ paths:
|
|||
200:
|
||||
description: The pusher was set.
|
||||
examples:
|
||||
application/json: {
|
||||
}
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
type: object
|
||||
description: An empty object.
|
||||
400:
|
||||
description: One or more of the pusher values were invalid.
|
||||
examples:
|
||||
application/json: {
|
||||
"error": "Missing parameters: lang, data",
|
||||
"errcode": "M_MISSING_PARAM"
|
||||
}
|
||||
"error": "Missing parameters: lang, data",
|
||||
"errcode": "M_MISSING_PARAM"
|
||||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
429:
|
||||
|
|
|
@ -343,6 +343,8 @@ paths:
|
|||
This endpoint allows the creation, modification and deletion of pushers
|
||||
for this user ID. The behaviour of this endpoint varies depending on the
|
||||
values in the JSON body.
|
||||
|
||||
When creating push rules, they MUST be enabled by default.
|
||||
operationId: setPushRule
|
||||
security:
|
||||
- accessToken: []
|
||||
|
@ -424,7 +426,7 @@ paths:
|
|||
required: ["actions"]
|
||||
responses:
|
||||
200:
|
||||
description: The pusher was set.
|
||||
description: The push rule was created/updated.
|
||||
examples:
|
||||
application/json: {
|
||||
}
|
||||
|
|
|
@ -196,11 +196,9 @@ paths:
|
|||
description: |-
|
||||
Proxies the identity server API ``validate/email/requestToken``, but
|
||||
first checks that the given email address is not already associated
|
||||
with an account on this Home Server. Note that, for consistency,
|
||||
this API takes JSON objects, though the Identity Server API takes
|
||||
``x-www-form-urlencoded`` parameters. See the Identity Server API for
|
||||
with an account on this Home Server. See the Identity Server API for
|
||||
further information.
|
||||
operationId: requestTokenToRegister
|
||||
operationId: requestTokenToRegisterEmail
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
|
@ -220,7 +218,7 @@ paths:
|
|||
description: The email address
|
||||
example: "example@example.com"
|
||||
send_attempt:
|
||||
type: number
|
||||
type: integer
|
||||
description: Used to distinguish protocol level retries from requests to re-send the email.
|
||||
example: 1
|
||||
required: ["client_secret", "email", "send_attempt"]
|
||||
|
@ -252,6 +250,71 @@ paths:
|
|||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
"/register/msisdn/requestToken":
|
||||
post:
|
||||
summary: Requests a validation token be sent to the given phone number for the purpose of registering an account
|
||||
description: |-
|
||||
Proxies the identity server API ``validate/msisdn/requestToken``, but
|
||||
first checks that the given phone number is not already associated
|
||||
with an account on this Home Server. See the Identity Server API for
|
||||
further information.
|
||||
operationId: requestTokenToRegisterMSISDN
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
id_server:
|
||||
type: string
|
||||
description: The ID server to send the onward request to as a hostname with an appended colon and port number if the port is not the default.
|
||||
example: "id.matrix.org"
|
||||
client_secret:
|
||||
type: string
|
||||
description: Client-generated secret string used to protect this session.
|
||||
example: "this_is_my_secret_string"
|
||||
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.
|
||||
example: "example@example.com"
|
||||
send_attempt:
|
||||
type: integer
|
||||
description: Used to distinguish protocol level retries from requests to re-send the SMS message.
|
||||
example: 1
|
||||
required: ["client_secret", "country", "phone_number", "send_attempt"]
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
An SMS message has been sent to the specified phone number.
|
||||
Note that this may be an SMS message containing the validation token or it may be informing
|
||||
the user of an error.
|
||||
examples:
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
||||
400:
|
||||
description: |-
|
||||
Part of the request was invalid. This may include one of the following error codes:
|
||||
|
||||
* ``M_THREEPID_IN_USE`` : The phone number is already registered to an account on this server.
|
||||
However, if the home server has the ability to send SMS message, it is recommended that the server
|
||||
instead send an SMS message to the user with instructions on how to reset their password.
|
||||
This prevents malicious parties from being able to determine if a given phone number
|
||||
has an account on the Home Server in question.
|
||||
* ``M_SERVER_NOT_TRUSTED`` : The ``id_server`` parameter refers to an ID server
|
||||
that is not trusted by this Home Server.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_THREEPID_IN_USE",
|
||||
"error": "The specified address is already in use"
|
||||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
"/account/password":
|
||||
post:
|
||||
summary: "Changes a user's password."
|
||||
|
@ -319,10 +382,32 @@ paths:
|
|||
.. |/register/email/requestToken| replace:: ``/register/email/requestToken``
|
||||
|
||||
.. _/register/email/requestToken: #post-matrix-client-%CLIENT_MAJOR_VERSION%-register-email-requesttoken
|
||||
operationId: requestTokenToResetPassword
|
||||
operationId: requestTokenToResetPasswordEmail
|
||||
responses:
|
||||
200:
|
||||
description: An email was sent to the given address
|
||||
"/account/password/msisdn/requestToken":
|
||||
post:
|
||||
summary: Requests a validation token be sent to the given phone number for the purpose of resetting a user's password.
|
||||
description: |-
|
||||
Proxies the identity server API ``validate/msisdn/requestToken``, but
|
||||
first checks that the given phone number **is** associated with an account
|
||||
on this Home Server. This API should be used to request
|
||||
validation tokens when authenticating for the
|
||||
`account/password` endpoint. This API's parameters and response are
|
||||
identical to that of the HS API |/register/msisdn/requestToken|_ except that
|
||||
`M_THREEPID_NOT_FOUND` may be returned if no account matching the
|
||||
given email address could be found. The server may instead send an
|
||||
SMS message to the given address prompting the user to create an account.
|
||||
`M_THREEPID_IN_USE` may not be returned.
|
||||
|
||||
.. |/register/msisdn/requestToken| replace:: ``/register/msisdn/requestToken``
|
||||
|
||||
.. _/register/msisdn/requestToken: #post-matrix-client-%CLIENT_MAJOR_VERSION%-register-email-requesttoken
|
||||
operationId: requestTokenToResetPasswordMSISDN
|
||||
responses:
|
||||
200:
|
||||
description: An SMS message was sent to the given phone number.
|
||||
"/account/deactivate":
|
||||
post:
|
||||
summary: "Deactivate a user's account."
|
||||
|
|
|
@ -87,6 +87,16 @@ paths:
|
|||
type: string
|
||||
description: |-
|
||||
A unique identifier for the event.
|
||||
403:
|
||||
description: |-
|
||||
The sender doesn't have permission to send the event into the room.
|
||||
schema:
|
||||
$ref: "definitions/errors/error.yaml"
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "You do not have permission to send the event."
|
||||
}
|
||||
tags:
|
||||
- Room participation
|
||||
"/rooms/{roomId}/state/{eventType}":
|
||||
|
@ -142,5 +152,15 @@ paths:
|
|||
type: string
|
||||
description: |-
|
||||
A unique identifier for the event.
|
||||
403:
|
||||
description: |-
|
||||
The sender doesn't have permission to send the event into the room.
|
||||
schema:
|
||||
$ref: "definitions/errors/error.yaml"
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "You do not have permission to send the event."
|
||||
}
|
||||
tags:
|
||||
- Room participation
|
||||
|
|
|
@ -41,7 +41,7 @@ paths:
|
|||
type: string
|
||||
description: |-
|
||||
The point to return events from. If given, this should be a
|
||||
`next_batch` result from a previous call to this endpoint.
|
||||
``next_batch`` result from a previous call to this endpoint.
|
||||
x-example: "YWxsCgpOb25lLDM1ODcwOA"
|
||||
- in: body
|
||||
name: body
|
||||
|
@ -95,6 +95,7 @@ paths:
|
|||
# for now :/
|
||||
description: |-
|
||||
This takes a `filter`_.
|
||||
$ref: "definitions/room_event_filter.yaml"
|
||||
order_by:
|
||||
title: "Ordering"
|
||||
type: string
|
||||
|
@ -179,7 +180,7 @@ paths:
|
|||
description: Mapping of category name to search criteria.
|
||||
properties:
|
||||
count:
|
||||
type: number
|
||||
type: integer
|
||||
description: An approximate count of the total number of results found.
|
||||
highlights:
|
||||
type: array
|
||||
|
|
|
@ -77,13 +77,14 @@ paths:
|
|||
- in: query
|
||||
name: set_presence
|
||||
type: string
|
||||
enum: ["offline"]
|
||||
enum: ["offline", "online", "unavailable"]
|
||||
description: |-
|
||||
Controls whether the client is automatically marked as online by
|
||||
polling this API. If this parameter is omitted then the client is
|
||||
automatically marked as online when it uses this API. Otherwise if
|
||||
the parameter is set to "offline" then the client is not marked as
|
||||
being online when it uses this API.
|
||||
being online when it uses this API. When set to "unavailable", the
|
||||
client is marked as being idle.
|
||||
x-example: "offline"
|
||||
- in: query
|
||||
name: timeout
|
||||
|
@ -227,6 +228,14 @@ paths:
|
|||
room up to the point when the user left.
|
||||
allOf:
|
||||
- $ref: "definitions/timeline_batch.yaml"
|
||||
account_data:
|
||||
title: Account Data
|
||||
type: object
|
||||
description: |-
|
||||
The private data that this user has attached to
|
||||
this room.
|
||||
allOf:
|
||||
- $ref: "definitions/event_batch.yaml"
|
||||
presence:
|
||||
title: Presence
|
||||
type: object
|
||||
|
@ -253,6 +262,14 @@ paths:
|
|||
description: |-
|
||||
Information on end-to-end device updates, as specified in
|
||||
|device_lists_sync|_.
|
||||
device_one_time_keys_count:
|
||||
title: One-time keys count
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: integer
|
||||
description: |-
|
||||
Information on end-to-end encryption keys, as specified
|
||||
in |device_lists_sync|_.
|
||||
examples:
|
||||
application/json: {
|
||||
"next_batch": "s72595_4483_1934",
|
||||
|
|
|
@ -73,7 +73,7 @@ paths:
|
|||
$ref: definitions/errors/error.yaml
|
||||
"/thirdparty/location/{protocol}":
|
||||
get:
|
||||
summary: Retreive Matrix-side portals rooms leading to a third party location.
|
||||
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
|
||||
|
@ -151,7 +151,7 @@ paths:
|
|||
get:
|
||||
summary: Reverse-lookup third party locations given a Matrix room alias.
|
||||
description: |-
|
||||
Retreive an array of third party network locations from a Matrix room
|
||||
Retrieve an array of third party network locations from a Matrix room
|
||||
alias.
|
||||
operationId: queryLocationByAlias
|
||||
security:
|
||||
|
@ -181,7 +181,7 @@ paths:
|
|||
get:
|
||||
summary: Reverse-lookup third party users given a Matrix User ID.
|
||||
description: |-
|
||||
Retreive an array of third party users from a Matrix User ID.
|
||||
Retrieve an array of third party users from a Matrix User ID.
|
||||
operationId: queryUserByID
|
||||
security:
|
||||
- accessToken: []
|
||||
|
|
|
@ -47,7 +47,7 @@ paths:
|
|||
description: The term to search for
|
||||
example: "foo"
|
||||
limit:
|
||||
type: number
|
||||
type: integer
|
||||
description: The maximum number of results to return (Defaults to 10).
|
||||
example: 10
|
||||
required: ["search_term"]
|
||||
|
|
66
api/client-server/wellknown.yaml
Normal file
66
api/client-server/wellknown.yaml
Normal file
|
@ -0,0 +1,66 @@
|
|||
# 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 Server Discovery API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
basePath: /.well-known
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/matrix/client":
|
||||
get:
|
||||
summary: Gets Matrix server discovery information about the domain.
|
||||
description: |-
|
||||
Gets discovery information about the domain. The file may include
|
||||
additional keys, which MUST follow the Java package naming convention,
|
||||
e.g. ``com.example.myapp.property``. This ensures property names are
|
||||
suitably namespaced for each application and reduces the risk of
|
||||
clashes.
|
||||
|
||||
Note that this endpoint is not necessarily handled by the homeserver,
|
||||
but by another webserver, to be used for discovering the homeserver URL.
|
||||
operationId: getWellknown
|
||||
responses:
|
||||
200:
|
||||
description: Server discovery information.
|
||||
examples:
|
||||
application/json: {
|
||||
"m.homeserver": {
|
||||
"base_url": "https://matrix.example.com"
|
||||
},
|
||||
"m.identity_server": {
|
||||
"base_url": "https://identity.example.com"
|
||||
}
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
m.homeserver:
|
||||
description: Information about the homeserver to connect to.
|
||||
"$ref": "definitions/wellknown/homeserver.yaml"
|
||||
m.identity_server:
|
||||
description: Optional. Information about the identity server to connect to.
|
||||
"$ref": "definitions/wellknown/identity_server.yaml"
|
||||
additionalProperties:
|
||||
description: Application-dependent keys using Java package naming convention.
|
||||
required:
|
||||
- m.homeserver
|
||||
404:
|
||||
description: No server discovery information available.
|
||||
tags:
|
||||
- Server administration
|
|
@ -18,15 +18,17 @@ info:
|
|||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
consumes:
|
||||
- application/json
|
||||
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
|
||||
description: |-
|
||||
Determines if a given 3pid has been validated by a user.
|
||||
operationId: getValidated3pid
|
||||
parameters:
|
||||
- in: query
|
||||
|
@ -46,10 +48,10 @@ paths:
|
|||
description: Validation information for the session.
|
||||
examples:
|
||||
application/json: {
|
||||
"medium": "email",
|
||||
"validated_at": 1457622739026,
|
||||
"address": "louise@bobs.burgers"
|
||||
}
|
||||
"medium": "email",
|
||||
"validated_at": 1457622739026,
|
||||
"address": "louise@bobs.burgers"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -61,7 +63,10 @@ paths:
|
|||
description: The address of the 3pid being looked up.
|
||||
validated_at:
|
||||
type: integer
|
||||
description: Timestamp indicating the time that the 3pid was validated.
|
||||
description: |-
|
||||
Timestamp, in milliseconds, indicating the time that the 3pid
|
||||
was validated.
|
||||
required: ['medium', 'address', 'validated_at']
|
||||
400:
|
||||
description: |-
|
||||
The session has not been validated.
|
||||
|
@ -71,16 +76,20 @@ paths:
|
|||
``errcode`` will be ``M_SESSION_EXPIRED``.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_SESSION_NOT_VALIDATED",
|
||||
"error": "This validation session has not yet been completed"
|
||||
}
|
||||
"errcode": "M_SESSION_NOT_VALIDATED",
|
||||
"error": "This validation session has not yet been completed"
|
||||
}
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
404:
|
||||
description: The Session ID or client secret were not found
|
||||
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"
|
||||
}
|
||||
"errcode": "M_NO_VALID_SESSION",
|
||||
"error": "No valid session was found matching that sid and client secret"
|
||||
}
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
"/bind":
|
||||
post:
|
||||
summary: Publish an association between a session and a Matrix user ID.
|
||||
|
@ -90,7 +99,7 @@ paths:
|
|||
Future calls to ``/lookup`` for any of the session\'s 3pids will return
|
||||
this association.
|
||||
|
||||
Note: for backwards compatibility with older versions of this
|
||||
Note: for backwards compatibility with previous drafts of this
|
||||
specification, the parameters may also be specified as
|
||||
``application/x-form-www-urlencoded`` data. However, this usage is
|
||||
deprecated.
|
||||
|
@ -101,10 +110,10 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"sid": "1234",
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"mxid": "@ears:matrix.org"
|
||||
}
|
||||
"sid": "1234",
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"mxid": "@ears:matrix.org"
|
||||
}
|
||||
properties:
|
||||
sid:
|
||||
type: string
|
||||
|
@ -121,19 +130,18 @@ paths:
|
|||
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"
|
||||
}
|
||||
"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:
|
||||
|
@ -157,7 +165,19 @@ paths:
|
|||
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.
|
||||
description: |-
|
||||
The signatures of the verifying identity services which show that the
|
||||
association should be trusted, if you trust the verifying identity
|
||||
services.
|
||||
$ref: "../../schemas/server-signatures.yaml"
|
||||
required:
|
||||
- address
|
||||
- medium
|
||||
- mxid
|
||||
- not_before
|
||||
- not_after
|
||||
- ts
|
||||
- signatures
|
||||
400:
|
||||
description: |-
|
||||
The association was not published.
|
||||
|
@ -167,13 +187,17 @@ paths:
|
|||
``errcode`` will be ``M_SESSION_EXPIRED``.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_SESSION_NOT_VALIDATED",
|
||||
"error": "This validation session has not yet been completed"
|
||||
}
|
||||
"errcode": "M_SESSION_NOT_VALIDATED",
|
||||
"error": "This validation session has not yet been completed"
|
||||
}
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
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"
|
||||
}
|
||||
"errcode": "M_NO_VALID_SESSION",
|
||||
"error": "No valid session was found matching that sid and client secret"
|
||||
}
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
|
|
|
@ -18,8 +18,9 @@ info:
|
|||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
|
@ -34,13 +35,13 @@ paths:
|
|||
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
|
||||
Note that homeservers 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
|
||||
Note: for backwards compatibility with previous drafts of this
|
||||
specification, the parameters may also be specified as
|
||||
``application/x-form-www-urlencoded`` data. However, this usage is
|
||||
deprecated.
|
||||
|
@ -51,14 +52,14 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"email": "foo@example.com",
|
||||
"send_attempt": 1
|
||||
}
|
||||
"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
|
||||
description: A unique string used to identify the validation attempt.
|
||||
email:
|
||||
type: string
|
||||
description: The email address to validate.
|
||||
|
@ -85,20 +86,28 @@ paths:
|
|||
Session created.
|
||||
examples:
|
||||
application/json: {
|
||||
"sid": "1234"
|
||||
}
|
||||
"sid": "1234"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
sid:
|
||||
type: string
|
||||
description: The session ID.
|
||||
required: ['sid']
|
||||
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.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_INVALID_EMAIL",
|
||||
"error": "The email address is not valid"
|
||||
}
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
"/validate/email/submitToken":
|
||||
post:
|
||||
summary: Validate ownership of an email address.
|
||||
|
@ -111,7 +120,7 @@ paths:
|
|||
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
|
||||
Note: for backwards compatibility with previous drafts of this
|
||||
specification, the parameters may also be specified as
|
||||
``application/x-form-www-urlencoded`` data. However, this usage is
|
||||
deprecated.
|
||||
|
@ -122,10 +131,10 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"sid": "1234",
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"token": "atoken"
|
||||
}
|
||||
"sid": "1234",
|
||||
"client_secret": "monkeys_are_GREAT",
|
||||
"token": "atoken"
|
||||
}
|
||||
properties:
|
||||
sid:
|
||||
type: string
|
||||
|
@ -143,14 +152,15 @@ paths:
|
|||
The success of the validation.
|
||||
examples:
|
||||
application/json: {
|
||||
"success": true
|
||||
}
|
||||
"success": true
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: boolean
|
||||
description: Whether the validation was successful or not.
|
||||
required: ['success']
|
||||
get:
|
||||
summary: Validate ownership of an email address.
|
||||
description: |-
|
||||
|
|
|
@ -18,8 +18,9 @@ info:
|
|||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
|
@ -29,7 +30,7 @@ paths:
|
|||
description: |-
|
||||
Sign invitation details.
|
||||
|
||||
The identity server will look up ``token`` which was stored in a call
|
||||
The identity service will look up ``token`` which was stored in a call
|
||||
to ``store-invite``, and fetch the sender of the invite.
|
||||
operationId: blindlySignStuff
|
||||
parameters:
|
||||
|
@ -38,24 +39,24 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"mxid": "@foo:bar.com",
|
||||
"token": "sometoken",
|
||||
"private_key": "base64encodedkey"
|
||||
}
|
||||
"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``
|
||||
description: The 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.
|
||||
description: The signed JSON of the mxid, sender, and token.
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -68,9 +69,11 @@ paths:
|
|||
signatures:
|
||||
type: object
|
||||
description: The signature of the mxid, sender, and token.
|
||||
$ref: "../../schemas/server-signatures.yaml"
|
||||
token:
|
||||
type: string
|
||||
description: The token for the invitation.
|
||||
required: ['mxid', 'sender', 'signatures', 'token']
|
||||
examples:
|
||||
application/json: {
|
||||
"mxid": "@foo:bar.com",
|
||||
|
@ -83,8 +86,11 @@ paths:
|
|||
"token": "abc123"
|
||||
}
|
||||
404:
|
||||
description: Token was not found.
|
||||
example: {
|
||||
description: The token was not found.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_UNRECOGNIZED",
|
||||
"error": "Didn't recognize token"
|
||||
}
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright 2016 OpenMarket Ltd
|
||||
# Copyright 2017 Kamax.io
|
||||
# Copyright 2017 New Vector 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.
|
||||
|
@ -20,8 +21,9 @@ info:
|
|||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
|
@ -46,31 +48,30 @@ paths:
|
|||
responses:
|
||||
200:
|
||||
description:
|
||||
The association for that 3pid, or the empty object if no association is known.
|
||||
The association for that 3pid, or an empty object if no association is known.
|
||||
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"
|
||||
}
|
||||
"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.
|
||||
description: The 3pid address of the user being looked up, matching the address requested.
|
||||
medium:
|
||||
type: string
|
||||
description: The literal string "email".
|
||||
description: A medium from the `3PID Types`_ Appendix, matching the medium requested.
|
||||
mxid:
|
||||
type: string
|
||||
description: The Matrix user ID associated with the 3pid.
|
||||
|
@ -86,6 +87,15 @@ paths:
|
|||
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.
|
||||
$ref: "../../schemas/server-signatures.yaml"
|
||||
required:
|
||||
- address
|
||||
- medium
|
||||
- mxid
|
||||
- not_before
|
||||
- not_after
|
||||
- ts
|
||||
- signatures
|
||||
"/bulk_lookup":
|
||||
post:
|
||||
summary: Lookup Matrix user IDs for a list of 3pids.
|
||||
|
@ -110,10 +120,17 @@ paths:
|
|||
items:
|
||||
type: array
|
||||
title: 3PID mappings
|
||||
minItems: 2
|
||||
maxItems: 2
|
||||
items:
|
||||
type: string
|
||||
title: 3PID medium or address
|
||||
description: an array of arrays containing the `3PID Types`_ with the ``medium`` in first position and the ``address`` in second position.
|
||||
# TODO: Give real names to these values. Adding a `title` does not work.
|
||||
#- type: 3PID Medium
|
||||
#- type: 3PID Address
|
||||
- type: string
|
||||
- type: string
|
||||
description: |-
|
||||
An array of arrays containing the `3PID Types`_ with the ``medium``
|
||||
in first position and the ``address`` in second position.
|
||||
required:
|
||||
- "threepids"
|
||||
responses:
|
||||
|
@ -134,9 +151,19 @@ paths:
|
|||
items:
|
||||
type: array
|
||||
title: 3PID mappings
|
||||
minItems: 3
|
||||
maxItems: 3
|
||||
items:
|
||||
type: string
|
||||
title: 3PID medium or address or the Matrix ID
|
||||
description: an array of array containing the `3PID Types`_ with the ``medium`` in first position, the ``address`` in second position and Matrix ID in third position.
|
||||
# TODO: Give real names to these values. Adding a `title` does not work.
|
||||
#- type: 3PID Medium
|
||||
#- type: 3PID Address
|
||||
#- type: Matrix User ID
|
||||
- type: string
|
||||
- type: string
|
||||
- type: string
|
||||
description: |-
|
||||
An array of array containing the `3PID Types`_ with the ``medium``
|
||||
in first position, the ``address`` in second position and Matrix user
|
||||
ID in third position.
|
||||
required:
|
||||
- "threepids"
|
||||
|
|
215
api/identity/phone_associations.yaml
Normal file
215
api/identity/phone_associations.yaml
Normal file
|
@ -0,0 +1,215 @@
|
|||
# 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
|
||||
basePath: /_matrix/identity/api/v1
|
||||
consumes:
|
||||
- application/json
|
||||
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 homeservers 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 previous drafts 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.
|
||||
required: ['sid']
|
||||
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.
|
||||
- ``M_DESTINATION_REJECTED``: The identity service cannot deliver an
|
||||
SMS to the provided country or region.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_INVALID_ADDRESS",
|
||||
"error": "The phone number is not valid"
|
||||
}
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
"/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 previous drafts 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.
|
||||
required: ['success']
|
||||
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.
|
|
@ -1,4 +1,5 @@
|
|||
# Copyright 2018 Kamax Sàrl
|
||||
# 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.
|
||||
|
@ -14,7 +15,7 @@
|
|||
|
||||
swagger: "2.0"
|
||||
info:
|
||||
title: "Matrix Client-Identity Versions API"
|
||||
title: "Matrix Identity Service Ping API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8090
|
||||
schemes:
|
||||
|
@ -25,19 +26,19 @@ produces:
|
|||
paths:
|
||||
"/api/v1":
|
||||
get:
|
||||
summary: Checks that an Identity server is available at this API endpopint.
|
||||
summary: Checks that an Identity Service is available at this API endpoint.
|
||||
description: |-
|
||||
Checks that an Identity server is available at this API endpopint.
|
||||
Checks that an Identity Service is available at this API endpoint.
|
||||
|
||||
To discover that an Identity server is available at a specific URL,
|
||||
To discover that an Identity Service 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.
|
||||
by entities acting as a client for the Identity Service.
|
||||
operationId: ping
|
||||
responses:
|
||||
200:
|
||||
description: An Identity server is ready to serve requests.
|
||||
description: An Identity Service is ready to serve requests.
|
||||
examples:
|
||||
application/json: {}
|
||||
schema:
|
||||
|
|
|
@ -18,8 +18,9 @@ info:
|
|||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
|
@ -45,13 +46,25 @@ paths:
|
|||
The public key exists.
|
||||
examples:
|
||||
application/json: {
|
||||
"public_key": "VXuGitF39UH5iRfvbIknlvlAVKgD1BsLDMvBf0pmp7c"
|
||||
}
|
||||
"public_key": "VXuGitF39UH5iRfvbIknlvlAVKgD1BsLDMvBf0pmp7c"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
public_key:
|
||||
type: string
|
||||
description: Unpadded Base64 encoded public key.
|
||||
required: ['public_key']
|
||||
404:
|
||||
description:
|
||||
The public key was not found.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND",
|
||||
"error": "The public key was not found"
|
||||
}
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
"/pubkey/isvalid":
|
||||
get:
|
||||
summary: Check whether a long-term public key is valid.
|
||||
|
@ -73,14 +86,15 @@ paths:
|
|||
The validity of the public key.
|
||||
examples:
|
||||
application/json: {
|
||||
"valid": true
|
||||
}
|
||||
"valid": true
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
valid:
|
||||
type: boolean
|
||||
description: Whether the public key is recognised and is currently valid.
|
||||
required: ['valid']
|
||||
"/pubkey/ephemeral/isvalid":
|
||||
get:
|
||||
summary: Check whether a short-term public key is valid.
|
||||
|
@ -101,11 +115,12 @@ paths:
|
|||
The validity of the public key.
|
||||
examples:
|
||||
application/json: {
|
||||
"valid": true
|
||||
}
|
||||
"valid": true
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
valid:
|
||||
type: boolean
|
||||
description: Whether the public key is recognised and is currently valid.
|
||||
required: ['valid']
|
||||
|
|
|
@ -18,16 +18,17 @@ info:
|
|||
host: localhost:8090
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/identity/api/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/store-invite":
|
||||
post:
|
||||
summary: Store pending invitations to a user\'s 3pid.
|
||||
summary: Store pending invitations to a user's 3pid.
|
||||
description: |-
|
||||
Store pending invitations to a user\'s 3pid.
|
||||
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
|
||||
|
@ -47,6 +48,8 @@ paths:
|
|||
|
||||
Also, the generated ephemeral public key will be listed as valid on
|
||||
requests to ``/_matrix/identity/api/v1/pubkey/ephemeral/isvalid``.
|
||||
|
||||
Currently, invites may only be issued for 3pids of the ``email`` medium.
|
||||
operationId: storeInvite
|
||||
parameters:
|
||||
- in: body
|
||||
|
@ -54,11 +57,11 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"medium": "email",
|
||||
"address": "foo@bar.baz",
|
||||
"room_id": "!something:example.tld",
|
||||
"sender": "@bob:example.com"
|
||||
}
|
||||
"medium": "email",
|
||||
"address": "foo@bar.baz",
|
||||
"room_id": "!something:example.tld",
|
||||
"sender": "@bob:example.com"
|
||||
}
|
||||
properties:
|
||||
medium:
|
||||
type: string
|
||||
|
@ -84,21 +87,22 @@ paths:
|
|||
description: The generated token.
|
||||
public_keys:
|
||||
type: array
|
||||
description: A list of [server\'s long-term public key, generated ephemeral public key].
|
||||
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.
|
||||
required: ['token', 'public_keys', 'display_name']
|
||||
example:
|
||||
application/json: {
|
||||
"token": "sometoken",
|
||||
"public_keys": [
|
||||
"serverpublickey",
|
||||
"ephemeralpublickey"
|
||||
],
|
||||
"display_name": "f...@b..."
|
||||
}
|
||||
"token": "sometoken",
|
||||
"public_keys": [
|
||||
"serverpublickey",
|
||||
"ephemeralpublickey"
|
||||
],
|
||||
"display_name": "f...@b..."
|
||||
}
|
||||
400:
|
||||
description: |
|
||||
An error has occured.
|
||||
|
@ -108,7 +112,9 @@ paths:
|
|||
error code will be ``M_UNRECOGNIZED``.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_THREEPID_IN_USE",
|
||||
"error": "Binding already known",
|
||||
"mxid": mxid
|
||||
}
|
||||
"errcode": "M_THREEPID_IN_USE",
|
||||
"error": "Binding already known",
|
||||
"mxid": "@alice:example.com"
|
||||
}
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# 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.
|
||||
|
@ -19,7 +20,7 @@ host: localhost:8008
|
|||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/push/%CLIENT_MAJOR_VERSION%
|
||||
basePath: /_matrix/push/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
|
@ -38,14 +39,14 @@ paths:
|
|||
|
||||
Notifications about a particular event will normally cause the user to be
|
||||
alerted in some way. It is therefore necessary to perform duplicate
|
||||
suppression for such notifications using the `event_id` field to avoid
|
||||
suppression for such notifications using the ``event_id`` field to avoid
|
||||
retries of this HTTP API causing duplicate alerts. The operation of
|
||||
updating counts of unread notifications should be idempotent and
|
||||
therefore do not require duplicate suppression.
|
||||
|
||||
Notifications are sent to the URL configured when the pusher is
|
||||
created. This means that the HTTP path may be different depending on the
|
||||
push gateway.
|
||||
Notifications are sent to the URL configured when the pusher is created.
|
||||
This means that the HTTP path may be different depending on the push
|
||||
gateway.
|
||||
operationId: notify
|
||||
parameters:
|
||||
- in: body
|
||||
|
@ -55,36 +56,36 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"notification": {
|
||||
"id": "$3957tyerfgewrf384",
|
||||
"room_id": "!slw48wfj34rtnrf:example.com",
|
||||
"type": "m.room.message",
|
||||
"sender": "@exampleuser:matrix.org",
|
||||
"sender_display_name": "Major Tom",
|
||||
"room_name": "Mission Control",
|
||||
"room_alias": "#exampleroom:matrix.org",
|
||||
"prio": "high",
|
||||
"content": {
|
||||
"msgtype": "m.text",
|
||||
"body": "I'm floating in a most peculiar way."
|
||||
},
|
||||
"counts": {
|
||||
"unread" : 2,
|
||||
"missed_calls": 1
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"app_id": "org.matrix.matrixConsole.ios",
|
||||
"pushkey": "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/",
|
||||
"pushkey_ts": 12345678,
|
||||
"data" : {},
|
||||
"tweaks": {
|
||||
"sound": "bing"
|
||||
}
|
||||
"notification": {
|
||||
"id": "$3957tyerfgewrf384",
|
||||
"room_id": "!slw48wfj34rtnrf:example.com",
|
||||
"type": "m.room.message",
|
||||
"sender": "@exampleuser:matrix.org",
|
||||
"sender_display_name": "Major Tom",
|
||||
"room_name": "Mission Control",
|
||||
"room_alias": "#exampleroom:matrix.org",
|
||||
"prio": "high",
|
||||
"content": {
|
||||
"msgtype": "m.text",
|
||||
"body": "I'm floating in a most peculiar way."
|
||||
},
|
||||
"counts": {
|
||||
"unread" : 2,
|
||||
"missed_calls": 1
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"app_id": "org.matrix.matrixConsole.ios",
|
||||
"pushkey": "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/",
|
||||
"pushkey_ts": 12345678,
|
||||
"data" : {},
|
||||
"tweaks": {
|
||||
"sound": "bing"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
required: ["notification"]
|
||||
properties:
|
||||
notification:
|
||||
|
@ -111,14 +112,10 @@ paths:
|
|||
type: string
|
||||
description: |-
|
||||
The type of the event as in the event's ``type`` field.
|
||||
Required if the notification relates to a specific
|
||||
Matrix event.
|
||||
sender:
|
||||
type: string
|
||||
description: |-
|
||||
The sender of the event as in the corresponding event field.
|
||||
Required if the notification relates to a specific
|
||||
Matrix event.
|
||||
sender_display_name:
|
||||
type: string
|
||||
description: |-
|
||||
|
@ -148,15 +145,16 @@ paths:
|
|||
type: object
|
||||
title: EventContent
|
||||
description: |-
|
||||
The ``content`` field from the event, if present. If the
|
||||
event had no content field, this field is omitted.
|
||||
The ``content`` field from the event, if present. The pusher
|
||||
may omit this if the event had no content or for any other
|
||||
reason.
|
||||
counts:
|
||||
type: object
|
||||
title: Counts
|
||||
description: |-
|
||||
This is a dictionary of the current number of unacknowledged
|
||||
communications for the recipient user. Counts whose value is
|
||||
zero are omitted.
|
||||
zero should be omitted.
|
||||
properties:
|
||||
unread:
|
||||
type: integer
|
||||
|
@ -180,10 +178,10 @@ paths:
|
|||
app_id:
|
||||
type: string
|
||||
description: |-
|
||||
The app_id given when the pusher was created.
|
||||
The ``app_id`` given when the pusher was created.
|
||||
pushkey:
|
||||
type: string
|
||||
description: The pushkey given when the pusher was created.
|
||||
description: The ``pushkey`` given when the pusher was created.
|
||||
pushkey_ts:
|
||||
type: integer
|
||||
description: |-
|
||||
|
@ -202,13 +200,14 @@ paths:
|
|||
description: |-
|
||||
A dictionary of customisations made to the way this
|
||||
notification is to be presented. These are added by push rules.
|
||||
required: ['app_id', 'pushkey']
|
||||
responses:
|
||||
200:
|
||||
description: A list of rejected push keys.
|
||||
examples:
|
||||
application/json: {
|
||||
"rejected": [ "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/" ]
|
||||
}
|
||||
"rejected": [ "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/" ]
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
properties:
|
||||
|
@ -222,7 +221,8 @@ paths:
|
|||
pushkeys and remove the associated pushers. It may not
|
||||
necessarily be the notification in the request that failed:
|
||||
it could be that a previous notification to the same pushkey
|
||||
failed.
|
||||
failed. May be empty.
|
||||
items:
|
||||
type: string
|
||||
description: A pushkey
|
||||
description: A pushkey that has been rejected.
|
||||
required: ['rejected']
|
||||
|
|
|
@ -24,6 +24,8 @@ consumes:
|
|||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/backfill/{roomId}":
|
||||
get:
|
||||
|
@ -33,6 +35,8 @@ paths:
|
|||
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
|
||||
|
@ -85,6 +89,8 @@ paths:
|
|||
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
|
||||
|
|
71
api/server-server/definitions/event-schemas/m.presence.yaml
Normal file
71
api/server-server/definitions/event-schemas/m.presence.yaml
Normal file
|
@ -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']
|
82
api/server-server/definitions/event-schemas/m.receipt.yaml
Normal file
82
api/server-server/definitions/event-schemas/m.receipt.yaml
Normal file
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
46
api/server-server/definitions/event-schemas/m.typing.yaml
Normal file
46
api/server-server/definitions/event-schemas/m.typing.yaml
Normal file
|
@ -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']
|
19
api/server-server/definitions/security.yaml
Normal file
19
api/server-server/definitions/security.yaml
Normal file
|
@ -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
|
|
@ -31,7 +31,7 @@ properties:
|
|||
example: 1532991320875
|
||||
pdus:
|
||||
type: array
|
||||
description: List of persistent updates to rooms.
|
||||
description: List of persistent updates to rooms. Must not include more than 50 PDUs.
|
||||
items:
|
||||
$ref: "pdu.yaml"
|
||||
required: ['origin', 'origin_server_ts', 'pdus']
|
||||
|
|
|
@ -78,7 +78,10 @@ properties:
|
|||
required: ['sha256']
|
||||
depth:
|
||||
type: integer
|
||||
description: The maximum depth of the ``prev_events``, plus one.
|
||||
description: |-
|
||||
The maximum depth of the ``prev_events``, plus one. Must be less than the
|
||||
maximum value for an integer (2^63 - 1). If the room's depth is already at
|
||||
the limit, the depth must be set to the limit.
|
||||
example: 12
|
||||
auth_events:
|
||||
type: array
|
||||
|
|
|
@ -24,6 +24,8 @@ consumes:
|
|||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/event_auth/{roomId}/{eventId}":
|
||||
get:
|
||||
|
@ -31,6 +33,8 @@ paths:
|
|||
description: |-
|
||||
Retrieves the complete auth chain for a given event.
|
||||
operationId: getEventAuth
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
@ -72,6 +76,8 @@ paths:
|
|||
bottom-up after sorting each chain by depth then by event ID. The differences
|
||||
are then discovered and returned as the response to this API call.
|
||||
operationId: compareEventAuth
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
|
|
@ -22,6 +22,8 @@ schemes:
|
|||
basePath: /_matrix/federation/v1
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/state/{roomId}":
|
||||
get:
|
||||
|
@ -29,6 +31,8 @@ paths:
|
|||
description: |-
|
||||
Retrieves a snapshot of a room's state at a given event.
|
||||
operationId: getRoomState
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
@ -45,7 +49,8 @@ paths:
|
|||
responses:
|
||||
200:
|
||||
description: |-
|
||||
The fully resolved state for the room, including the authorization
|
||||
The fully resolved state for the room, prior to considering any state
|
||||
changes induced by the requested event. Includes the authorization
|
||||
chain for the events.
|
||||
schema:
|
||||
type: object
|
||||
|
@ -74,6 +79,8 @@ paths:
|
|||
event IDs. This performs the same function as calling ``/state/{roomId}``,
|
||||
however this returns just the event IDs rather than the full events.
|
||||
operationId: getRoomStateIds
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
@ -90,7 +97,8 @@ paths:
|
|||
responses:
|
||||
200:
|
||||
description: |-
|
||||
The fully resolved state for the room, including the authorization
|
||||
The fully resolved state for the room, prior to considering any state
|
||||
changes induced by the requested event. Includes the authorization
|
||||
chain for the events.
|
||||
schema:
|
||||
type: object
|
||||
|
@ -117,6 +125,8 @@ paths:
|
|||
description: |-
|
||||
Retrieves a single event.
|
||||
operationId: getEvent
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: eventId
|
||||
|
|
|
@ -24,6 +24,8 @@ consumes:
|
|||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/invite/{roomId}/{eventId}":
|
||||
put:
|
||||
|
@ -33,6 +35,8 @@ paths:
|
|||
homeserver and the invited homeserver, it can be sent to all of the servers in the
|
||||
room by the inviting homeserver.
|
||||
operationId: sendInvite
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
|
|
@ -24,6 +24,8 @@ consumes:
|
|||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/make_join/{roomId}/{userId}":
|
||||
get:
|
||||
|
@ -32,6 +34,8 @@ paths:
|
|||
Asks the receiving server to return information that the sending
|
||||
server will need to prepare a join event to get into the room.
|
||||
operationId: makeJoin
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
@ -45,6 +49,15 @@ paths:
|
|||
description: The user ID the join event will be for.
|
||||
required: true
|
||||
x-example: "@someone:example.org"
|
||||
- in: query
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
name: ver
|
||||
description: |-
|
||||
The room versions the sending server has support for. Defaults
|
||||
to ``[1]``.
|
||||
x-example: ["1", "2"]
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
|
@ -138,6 +151,30 @@ paths:
|
|||
["$room_p0wer_l3vels_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}]
|
||||
]
|
||||
}
|
||||
400:
|
||||
description: |-
|
||||
The request is invalid or the room the server is attempting
|
||||
to join has a version that is not listed in the ``ver``
|
||||
parameters.
|
||||
|
||||
The error should be passed through to clients so that they
|
||||
may give better feedback to users.
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: "../client-server/definitions/errors/error.yaml"
|
||||
- type: object
|
||||
properties:
|
||||
room_version:
|
||||
type: string
|
||||
description: |-
|
||||
The version of the room. Required if the ``errcode``
|
||||
is ``M_INCOMPATIBLE_ROOM_VERSION``.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_INCOMPATIBLE_ROOM_VERSION",
|
||||
"error": "Your homeserver does not support the features required to join this room",
|
||||
"room_version": "3"
|
||||
}
|
||||
"/send_join/{roomId}/{eventId}":
|
||||
put:
|
||||
summary: Submit a signed join event to a resident server
|
||||
|
@ -145,6 +182,8 @@ paths:
|
|||
Submits a signed join event to the resident server for it
|
||||
to accept it into the room's graph.
|
||||
operationId: sendJoin
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
|
|
@ -24,6 +24,8 @@ consumes:
|
|||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/make_leave/{roomId}/{userId}":
|
||||
get:
|
||||
|
@ -32,6 +34,8 @@ paths:
|
|||
Asks the receiving server to return information that the sending
|
||||
server will need to prepare a leave event to get out of the room.
|
||||
operationId: makeLeave
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
@ -151,6 +155,8 @@ paths:
|
|||
Submits a signed leave event to the resident server for it
|
||||
to accept it into the room's graph.
|
||||
operationId: sendLeave
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
|
63
api/server-server/openid.yaml
Normal file
63
api/server-server/openid.yaml
Normal file
|
@ -0,0 +1,63 @@
|
|||
# Copyright 2017 Kamax.io
|
||||
# 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 OpenID API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8448
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/federation/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/openid/userinfo":
|
||||
get:
|
||||
summary: Exchange an OpenID token for user information
|
||||
description: |-
|
||||
Exchanges an OpenID access token for information about the user
|
||||
who generated the token. Currently this only exposes the Matrix
|
||||
User ID of the owner.
|
||||
operationId: exchangeOpenIdToken
|
||||
parameters:
|
||||
- in: path
|
||||
name: access_token
|
||||
type: string
|
||||
description: |-
|
||||
The OpenID access token to get information about the owner for.
|
||||
required: true
|
||||
x-example: SomeT0kenHere
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
Information about the user who generated the OpenID access token.
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
sub:
|
||||
type: string
|
||||
description: The Matrix User ID who generated the token.
|
||||
example: "@alice:example.com"
|
||||
required: ['sub']
|
||||
401:
|
||||
description: The token was not recognized or has expired.
|
||||
schema:
|
||||
$ref: "../client-server/definitions/errors/error.yaml"
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_UNKNOWN_TOKEN",
|
||||
"error": "Access token unknown or expired"
|
||||
}
|
|
@ -22,6 +22,8 @@ schemes:
|
|||
basePath: /_matrix/federation/v1
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/publicRooms":
|
||||
get:
|
||||
|
@ -31,6 +33,8 @@ paths:
|
|||
rooms that are listed on another homeserver's directory, just those
|
||||
listed on the receiving homeserver's directory.
|
||||
operationId: getPublicRooms
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: limit
|
||||
|
@ -45,6 +49,20 @@ paths:
|
|||
A pagination token from a previous call to this endpoint to fetch more
|
||||
rooms.
|
||||
x-example: "GetMoreRoomsTokenHere"
|
||||
- in: query
|
||||
name: include_all_networks
|
||||
type: boolean
|
||||
description: |-
|
||||
Whether or not to include all networks/protocols defined by application
|
||||
services on the homeserver. Defaults to false.
|
||||
x-example: false
|
||||
- in: query
|
||||
name: third_party_instance_id
|
||||
type: string
|
||||
description: |-
|
||||
The specific third party network/protocol to request from the homeserver.
|
||||
Can only be used if ``include_all_networks`` is false.
|
||||
x-example: "irc"
|
||||
responses:
|
||||
200:
|
||||
description: The public room list for the homeserver.
|
||||
|
|
|
@ -23,6 +23,8 @@ schemes:
|
|||
basePath: /_matrix/federation/v1
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/query/{queryType}":
|
||||
get:
|
||||
|
@ -32,6 +34,8 @@ paths:
|
|||
arguments are dependent on which type of query is being made. Known query types
|
||||
are specified as their own endpoints as an extension to this definition.
|
||||
operationId: queryInfo
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: queryType
|
||||
|
@ -54,6 +58,8 @@ paths:
|
|||
Servers may wish to cache the response to this query to avoid requesting the
|
||||
information too often.
|
||||
operationId: queryRoomDirectory
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: room_alias
|
||||
|
@ -110,6 +116,9 @@ paths:
|
|||
|
||||
Servers may wish to cache the response to this query to avoid requesting the
|
||||
information too often.
|
||||
operationId: queryProfile
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: query
|
||||
name: user_id
|
||||
|
|
|
@ -24,6 +24,8 @@ consumes:
|
|||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/exchange_third_party_invite/{roomId}":
|
||||
put:
|
||||
|
@ -34,6 +36,8 @@ paths:
|
|||
an invite as per the `Inviting to a room`_ section before returning a
|
||||
response to this request.
|
||||
operationId: exchangeThirdPartyInvite
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
|
|
|
@ -24,6 +24,8 @@ consumes:
|
|||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/send/{txnId}":
|
||||
put:
|
||||
|
@ -36,6 +38,8 @@ paths:
|
|||
The sending server must wait and retry for a 200 OK response before sending a
|
||||
transaction with a different ``txnId`` to the receiving server.
|
||||
operationId: sendTransaction
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: txnId
|
||||
|
@ -56,8 +60,8 @@ paths:
|
|||
edus:
|
||||
type: array
|
||||
description: |-
|
||||
List of ephemeral messages. May be omitted if there are no ephemeral
|
||||
messages to be sent.
|
||||
List of ephemeral messages. May be omitted if there are no ephemeral
|
||||
messages to be sent. Must not include more than 100 EDUs.
|
||||
items:
|
||||
$ref: "definitions/edu.yaml"
|
||||
example: {
|
||||
|
|
0
changelogs/application_service.rst
Normal file
0
changelogs/application_service.rst
Normal file
1
changelogs/application_service/newsfragments/.gitignore
vendored
Normal file
1
changelogs/application_service/newsfragments/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
!.gitignore
|
30
changelogs/application_service/pyproject.toml
Normal file
30
changelogs/application_service/pyproject.toml
Normal file
|
@ -0,0 +1,30 @@
|
|||
[tool.towncrier]
|
||||
filename = "../application_service.rst"
|
||||
directory = "newsfragments"
|
||||
issue_format = "`#{issue} <https://github.com/matrix-org/matrix-doc/issues/{issue}>`_"
|
||||
title_format = "{version}"
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "breaking"
|
||||
name = "Breaking Changes"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "deprecation"
|
||||
name = "Deprecations"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "new"
|
||||
name = "New Endpoints"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "feature"
|
||||
name = "Backwards Compatible Changes"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "clarification"
|
||||
name = "Spec Clarifications"
|
||||
showcontent = true
|
1
changelogs/client_server/newsfragments/1176.new
Normal file
1
changelogs/client_server/newsfragments/1176.new
Normal file
|
@ -0,0 +1 @@
|
|||
Specify how to control the power level required for ``@room``
|
|
@ -0,0 +1 @@
|
|||
Clarify ``changed`` field behaviour in device tracking process
|
7
changelogs/client_server/newsfragments/1284.feature
Normal file
7
changelogs/client_server/newsfragments/1284.feature
Normal file
|
@ -0,0 +1,7 @@
|
|||
End-to-end encryption for group chats:
|
||||
|
||||
- Olm and Megolm messaging algorithms.
|
||||
- ``m.room.encrypted``, ``m.room.encryption``, ``m.room_key`` events.
|
||||
- Device verification process.
|
||||
- ``device_one_time_keys_count`` sync parameter.
|
||||
- ``device_lists:left`` sync parameter.
|
1
changelogs/client_server/newsfragments/1359.feature
Normal file
1
changelogs/client_server/newsfragments/1359.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add ``.well-known`` server discovery method
|
1
changelogs/client_server/newsfragments/1465.feature
Normal file
1
changelogs/client_server/newsfragments/1465.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Share room decryption keys between devices
|
1
changelogs/client_server/newsfragments/1506.feature
Normal file
1
changelogs/client_server/newsfragments/1506.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Document and improve client interaction with pushers.
|
1
changelogs/client_server/newsfragments/1507.new
Normal file
1
changelogs/client_server/newsfragments/1507.new
Normal file
|
@ -0,0 +1 @@
|
|||
``POST /account/3pid/msisdn/requestToken``, ``POST /register/msisdn/requestToken``, and ``POST /account/password/msisdn/requestToken``
|
1
changelogs/client_server/newsfragments/1516.feature
Normal file
1
changelogs/client_server/newsfragments/1516.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add support for Room Versions.
|
|
@ -0,0 +1 @@
|
|||
Clarify how access tokens are meant to be supplied to the homeserver.
|
|
@ -0,0 +1 @@
|
|||
Document additional parameters on the ``/createRoom`` API.
|
1
changelogs/client_server/newsfragments/1542.feature
Normal file
1
changelogs/client_server/newsfragments/1542.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Guests can now call /context and /event to fetch events
|
1
changelogs/client_server/newsfragments/1547.feature
Normal file
1
changelogs/client_server/newsfragments/1547.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add a common standard for user, room, and group mentions in messages.
|
1
changelogs/client_server/newsfragments/1550.feature
Normal file
1
changelogs/client_server/newsfragments/1550.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add server ACLs as an option for controlling federation in a room.
|
|
@ -0,0 +1 @@
|
|||
Clarify that new push rules should be enabled by default, and that unrecognised conditions should not match.
|
1
changelogs/client_server/newsfragments/1551.feature
Normal file
1
changelogs/client_server/newsfragments/1551.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add new push rules for encrypted events and ``@room`` notifications.
|
1
changelogs/client_server/newsfragments/1554.feature
Normal file
1
changelogs/client_server/newsfragments/1554.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add third party network room directories, as provided by application services.
|
|
@ -0,0 +1 @@
|
|||
Update all event examples to be accurate representations of their associated events.
|
|
@ -0,0 +1 @@
|
|||
Clarify the supported HTML features for room messages.
|
|
@ -0,0 +1 @@
|
|||
Move the ``invite_room_state`` definition under ``unsigned`` where it actually resides.
|
|
@ -0,0 +1 @@
|
|||
Clarify the object structures and defaults for Filters.
|
|
@ -0,0 +1 @@
|
|||
Clarify instances of ``type: number`` in the swagger/OpenAPI schema definitions.
|
|
@ -0,0 +1 @@
|
|||
Clarify that left rooms also have account data in ``/sync``.
|
|
@ -0,0 +1 @@
|
|||
Fix naming of the body field in ``PUT /directory/room``.
|
|
@ -0,0 +1 @@
|
|||
Clarify the filter object schema used in room searching.
|
|
@ -0,0 +1 @@
|
|||
Document the 403 error for sending state events.
|
|
@ -0,0 +1 @@
|
|||
specify how to handle multiple olm sessions with the same device
|
1
changelogs/client_server/newsfragments/780.feature
Normal file
1
changelogs/client_server/newsfragments/780.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add more presence options to the ``set_presence`` parameter of ``/sync``. (Thanks @mujx!)
|
0
changelogs/identity_service.rst
Normal file
0
changelogs/identity_service.rst
Normal file
1
changelogs/identity_service/newsfragments/.gitignore
vendored
Normal file
1
changelogs/identity_service/newsfragments/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
!.gitignore
|
30
changelogs/identity_service/pyproject.toml
Normal file
30
changelogs/identity_service/pyproject.toml
Normal file
|
@ -0,0 +1,30 @@
|
|||
[tool.towncrier]
|
||||
filename = "../identity_service.rst"
|
||||
directory = "newsfragments"
|
||||
issue_format = "`#{issue} <https://github.com/matrix-org/matrix-doc/issues/{issue}>`_"
|
||||
title_format = "{version}"
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "breaking"
|
||||
name = "Breaking Changes"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "deprecation"
|
||||
name = "Deprecations"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "new"
|
||||
name = "New Endpoints"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "feature"
|
||||
name = "Backwards Compatible Changes"
|
||||
showcontent = true
|
||||
|
||||
[[tool.towncrier.type]]
|
||||
directory = "clarification"
|
||||
name = "Spec Clarifications"
|
||||
showcontent = true
|
6
changelogs/push_gateway.rst
Normal file
6
changelogs/push_gateway.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
r0.1.0
|
||||
======
|
||||
|
||||
The first release of the Push Gateway specification. This release contains
|
||||
a single endpoint, ``/notify``, that pushers may use to send push notifications
|
||||
to clients.
|
1
changelogs/push_gateway/newsfragments/.gitignore
vendored
Normal file
1
changelogs/push_gateway/newsfragments/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
!.gitignore
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue