Merge branch 'master' into hs/dns-to-be-hostname
commit
bdb881420c
@ -0,0 +1,64 @@
|
||||
gendoc: &gendoc
|
||||
name: Generate the docs
|
||||
command: |
|
||||
source /env/bin/activate
|
||||
scripts/gendoc.py
|
||||
|
||||
genswagger: &genswagger
|
||||
name: Generate the swagger
|
||||
command: |
|
||||
source /env/bin/activate
|
||||
scripts/dump-swagger.py
|
||||
|
||||
buildswaggerui: &buildswaggerui
|
||||
name: Build Swagger UI
|
||||
command: |
|
||||
ls scripts/
|
||||
mkdir -p api/client-server
|
||||
git clone https://github.com/matrix-org/swagger-ui swagger-ui
|
||||
cp -r swagger-ui/dist/* api/client-server/
|
||||
mkdir -p api/client-server/json
|
||||
cp scripts/swagger/api-docs.json api/client-server/json/
|
||||
wget https://raw.githubusercontent.com/matrix-org/matrix.org/master/content/swagger.css -O api/client-server/swagger.css
|
||||
wget https://raw.githubusercontent.com/matrix-org/matrix.org/master/scripts/swagger-ui.patch
|
||||
patch api/client-server/index.html swagger-ui.patch
|
||||
|
||||
|
||||
version: 2
|
||||
jobs:
|
||||
build-docs:
|
||||
docker:
|
||||
- image: uhoreg/matrix-doc-build
|
||||
steps:
|
||||
- checkout
|
||||
- run: *gendoc
|
||||
- store_artifacts:
|
||||
path: scripts/gen
|
||||
- run:
|
||||
name: "Doc build is available at:"
|
||||
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/scripts/gen/index.html"; echo $DOCS_URL
|
||||
|
||||
build-swagger:
|
||||
docker:
|
||||
- image: uhoreg/matrix-doc-build
|
||||
steps:
|
||||
- checkout
|
||||
- run: *genswagger
|
||||
- run: *buildswaggerui
|
||||
- store_artifacts:
|
||||
path: api/client-server/
|
||||
- run:
|
||||
name: "Swagger UI is available at:"
|
||||
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/api/client-server/index.html"; echo $DOCS_URL
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
|
||||
build-spec:
|
||||
jobs:
|
||||
- build-docs
|
||||
- build-swagger
|
||||
|
||||
notify:
|
||||
webhooks:
|
||||
- url: https://giles.cadair.com/circleci
|
@ -0,0 +1,30 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
properties:
|
||||
alias:
|
||||
description: An alias for a matrix room.
|
||||
type: string
|
||||
example: "#freenode_#matrix:matrix.org"
|
||||
protocol:
|
||||
description: The protocol ID that the third party location is a part of.
|
||||
type: string
|
||||
example: irc
|
||||
fields:
|
||||
description: Information used to identify this third party location.
|
||||
type: object
|
||||
example:
|
||||
"network": "freenode"
|
||||
"channel": "#matrix"
|
||||
title: Location
|
||||
type: object
|
@ -0,0 +1,17 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
type: array
|
||||
description: List of matched third party locations.
|
||||
items:
|
||||
$ref: location.yaml
|
@ -0,0 +1,79 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
properties:
|
||||
user_fields:
|
||||
description: Fields used to identify a third party 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.
|
||||
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.
|
||||
type: string
|
||||
example: "mxc://example.org/aBcDeFgH"
|
||||
field_types:
|
||||
title: Field Types
|
||||
description: All location or user fields should have an entry here.
|
||||
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
|
||||
example: {
|
||||
"network": {
|
||||
"regexp": "([a-z0-9]+\\.)*[a-z0-9]+",
|
||||
"placeholder": "irc.example.org"
|
||||
},
|
||||
"nickname": {
|
||||
"regexp": "[^\\s#]+",
|
||||
"placeholder": "username"
|
||||
},
|
||||
"channel": {
|
||||
"regexp": "#[^\\s]+",
|
||||
"placeholder": "#foobar"
|
||||
}
|
||||
}
|
||||
instances:
|
||||
description: |-
|
||||
A list of objects representing independent instances of configuration.
|
||||
For instance multiple networks on IRC if multiple are bridged by the
|
||||
same bridge.
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
example: {
|
||||
"desc": "Freenode",
|
||||
"icon": "mxc://example.org/JkLmNoPq",
|
||||
"fields": {
|
||||
"network": "freenode.net",
|
||||
}
|
||||
}
|
||||
title: Protocol
|
||||
type: object
|
@ -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.
|
||||
type: object
|
||||
description: Dictionary of supported third party protocols.
|
||||
example: {
|
||||
"irc": {
|
||||
"user_fields": ["network", "nickname"],
|
||||
"location_fields": ["network", "channel"],
|
||||
"icon": "mxc://example.org/aBcDeFgH",
|
||||
"field_types": {
|
||||
"network": {
|
||||
"regexp": "([a-z0-9]+\\.)*[a-z0-9]+",
|
||||
"placeholder": "irc.example.org"
|
||||
},
|
||||
"nickname": {
|
||||
"regexp": "[^\\s]+",
|
||||
"placeholder": "username"
|
||||
},
|
||||
"channel": {
|
||||
"regexp": "#[^\\s]+",
|
||||
"placeholder": "#foobar"
|
||||
}
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
"desc": "Freenode",
|
||||
"icon": "mxc://example.org/JkLmNoPq",
|
||||
"fields": {
|
||||
"network": "freenode.net",
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"gitter": {
|
||||
"user_fields": ["username"],
|
||||
"location_fields": ["room"],
|
||||
"field_types": {
|
||||
"username": {
|
||||
"regexp": "@[^\\s]+",
|
||||
"placeholder": "@username"
|
||||
},
|
||||
"room": {
|
||||
"regexp": "[^\\s]+\\/[^\\s]+",
|
||||
"placeholder": "matrix-org/matrix-doc"
|
||||
}
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
"desc": "Gitter",
|
||||
"icon": "mxc://example.org/zXyWvUt",
|
||||
"fields": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# TODO: Change userid to user_id as a breaking change
|
||||
properties:
|
||||
userid:
|
||||
description: A Matrix User ID represting a third party user.
|
||||
type: string
|
||||
example: "@_gitter_jim:matrix.org"
|
||||
protocol:
|
||||
description: The protocol ID that the third party location is a part of.
|
||||
type: string
|
||||
example: gitter
|
||||
fields:
|
||||
description: Information used to identify this third party location.
|
||||
type: object
|
||||
example:
|
||||
"user": "jim"
|
||||
title: Location
|
||||
type: object
|
@ -0,0 +1,17 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
type: array
|
||||
description: List of matched third party users.
|
||||
items:
|
||||
$ref: user.yaml
|
@ -0,0 +1,32 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
$ref: error.yaml
|
||||
type: object
|
||||
description: The rate limit was reached for this request
|
||||
properties:
|
||||
errcode:
|
||||
type: string
|
||||
description: The M_LIMIT_EXCEEDED error code
|
||||
example: M_LIMIT_EXCEEDED
|
||||
error:
|
||||
type: string
|
||||
description: A human-readable error message.
|
||||
example: Too many requests
|
||||
retry_after_ms:
|
||||
type: integer
|
||||
description: |-
|
||||
The amount of time in milliseconds the client should wait
|
||||
before trying the request again.
|
||||
example: 2000
|
||||
required: ["errcode"]
|
@ -0,0 +1,194 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
swagger: '2.0'
|
||||
info:
|
||||
title: "Matrix Client-Server Third Party Lookup API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8008
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/thirdparty/protocols":
|
||||
get:
|
||||
summary: Retrieve metadata about all protocols that a homeserver supports.
|
||||
description: |-
|
||||
Fetches the overall metadata about protocols supported by the
|
||||
homeserver. Includes both the available protocols and all fields
|
||||
required for queries against each protocol.
|
||||
operationId: queryMetadata
|
||||
responses:
|
||||
200:
|
||||
description: The protocols supported by the homeserver.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/protocol_metadata.yaml
|
||||
"/thirdparty/protocol/{protocol}":
|
||||
get:
|
||||
summary: Retrieve metadata about a specific protocol that the homeserver supports.
|
||||
description: |-
|
||||
Fetches the metadata from the homeserver about a particular third party protocol.
|
||||
operationId: queryMetadata
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
type: string
|
||||
description: |-
|
||||
The name of the protocol.
|
||||
required: true
|
||||
x-example: "irc"
|
||||
responses:
|
||||
200:
|
||||
description: The protocol was found and metadata returned.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/protocol.yaml
|
||||
404:
|
||||
description: The protocol is unknown.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
"/thirdparty/location/{protocol}":
|
||||
get:
|
||||
summary: Retreive Matrix-side portals rooms leading to a third party location.
|
||||
description: |-
|
||||
Requesting this endpoint with a valid protocol name results in a list
|
||||
of successful mapping results in a JSON array. Each result contains
|
||||
objects to represent the Matrix room or rooms that represent a portal
|
||||
to this third party network. Each has the Matrix room alias string,
|
||||
an identifier for the particular third party network protocol, and an
|
||||
object containing the network-specific fields that comprise this
|
||||
identifier. It should attempt to canonicalise the identifier as much
|
||||
as reasonably possible given the network type.
|
||||
operationId: queryLocationByProtocol
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
type: string
|
||||
description: The protocol used to communicate to the third party network.
|
||||
required: true
|
||||
x-example: irc
|
||||
- in: query
|
||||
name: searchFields
|
||||
type: string
|
||||
description: |-
|
||||
One or more custom fields to help identify the third party
|
||||
location.
|
||||
responses:
|
||||
200:
|
||||
description: At least one portal room was found.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/location_batch.yaml
|
||||
404:
|
||||
description: No portal rooms were found.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
"/thirdparty/user/{protocol}":
|
||||
get:
|
||||
summary: Retrieve the Matrix User ID of a corresponding third party user.
|
||||
description: |-
|
||||
Retrieve a Matrix User ID linked to a user on the third party service, given
|
||||
a set of user parameters.
|
||||
operationId: queryUserByProtocol
|
||||
parameters:
|
||||
- in: path
|
||||
name: protocol
|
||||
type: string
|
||||
description: |-
|
||||
The name of the protocol.
|
||||
required: true
|
||||
x-example: irc
|
||||
- in: query
|
||||
name: field1, field2...
|
||||
type: string
|
||||
description: |-
|
||||
One or more custom fields that are passed to the AS to help identify the user.
|
||||
responses:
|
||||
200:
|
||||
description: The Matrix User IDs found with the given parameters.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/user_batch.yaml
|
||||
404:
|
||||
description: The Matrix User ID was not found
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
"/thirdparty/location":
|
||||
get:
|
||||
summary: Reverse-lookup third party locations given a Matrix room alias.
|
||||
description: |-
|
||||
Retreive an array of third party network locations from a Matrix room
|
||||
alias.
|
||||
operationId: queryLocationByAlias
|
||||
parameters:
|
||||
- in: query
|
||||
name: alias
|
||||
type: string
|
||||
description: The Matrix room alias to look up.
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
All found third party locations.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/location_batch.yaml
|
||||
404:
|
||||
description: The Matrix room alias was not found
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
"/thirdparty/user":
|
||||
get:
|
||||
summary: Reverse-lookup third party users given a Matrix User ID.
|
||||
description: |-
|
||||
Retreive an array of third party users from a Matrix User ID.
|
||||
operationId: queryUserByID
|
||||
parameters:
|
||||
- in: query
|
||||
name: userid
|
||||
type: string
|
||||
description: The Matrix User ID to look up.
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
An array of third party users.
|
||||
schema:
|
||||
$ref: ../application-service/definitions/user_batch.yaml
|
||||
404:
|
||||
description: The Matrix User ID was not found
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
@ -0,0 +1,40 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# TODO: Address any concerns about this being inaccurate (flagged as such in the EDUs section)
|
||||
|
||||
type: object
|
||||
title: Ephemeral Data Unit
|
||||
description: An ephemeral data unit
|
||||
example:
|
||||
$ref: "../examples/edu.json"
|
||||
properties:
|
||||
edu_type:
|
||||
type: string
|
||||
description: The type of ephemeral message.
|
||||
example: "m.presence"
|
||||
required: true
|
||||
origin:
|
||||
type: string
|
||||
description: The server name sending the ephemeral message.
|
||||
example: "matrix.org"
|
||||
required: true
|
||||
destination:
|
||||
type: string
|
||||
description: The server name receiving the ephemeral message.
|
||||
example: "elsewhere.com"
|
||||
required: true
|
||||
content:
|
||||
type: object
|
||||
description: The content of the ephemeral message.
|
@ -0,0 +1,96 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
type: object
|
||||
title: Server Keys
|
||||
description: Server keys
|
||||
example:
|
||||
$ref: "../examples/server_key.json"
|
||||
properties:
|
||||
server_name:
|
||||
type: string
|
||||
description: DNS name of the homeserver.
|
||||
required: true # TODO: Verify
|
||||
example: "example.org"
|
||||
verify_keys:
|
||||
type: object
|
||||
description: Public keys of the homeserver for verifying digital signatures.
|
||||
required: true # TODO: Verify
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Verify Key
|
||||
example: {
|
||||
"ed25519:auto2": {
|
||||
"key": "Base+64+Encoded+Signature+Verification+Key"
|
||||
}
|
||||
}
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
description: The key
|
||||
required: true
|
||||
example: "Base+64+Encoded+Signature+Verification+Key"
|
||||
old_verify_keys:
|
||||
type: object
|
||||
description: The public keys that the server used to use and when it stopped using them.
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Old Verify Key
|
||||
example: {
|
||||
"ed25519:auto1": {
|
||||
"expired_ts": 922834800000,
|
||||
"key": "Base+64+Encoded+Signature+Verification+Key"
|
||||
}
|
||||
}
|
||||
properties:
|
||||
expired_ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: The expiration time.
|
||||
required: true
|
||||
example: 922834800000
|
||||
key:
|
||||
type: string
|
||||
description: The key.
|
||||
required: true
|
||||
example: "Base+64+Encoded+Signature+Verification+Key"
|
||||
signatures:
|
||||
type: object
|
||||
description: Digital signatures for this object signed using the ``verify_keys``.
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Signed Server
|
||||
example: {
|
||||
"example.org": {
|
||||
"ad25519:auto2": "Base+64+Encoded+Signature+Verification+Key"
|
||||
}
|
||||
}
|
||||
additionalProperties:
|
||||
type: string
|
||||
name: Encoded Signature Verification Key
|
||||
tls_fingerprints:
|
||||
type: array
|
||||
description: Hashes of X.509 TLS certificates used by this server encoded as `Unpadded Base64`_.
|
||||
items:
|
||||
type: object
|
||||
title: TLS Fingerprint
|
||||
properties:
|
||||
sha256:
|
||||
type: string
|
||||
description: The encoded fingerprint.
|
||||
example: Base+64+Encoded+SHA-256-Fingerprint
|
||||
valid_until_ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: POSIX timestamp when the list of valid keys should be refreshed.
|
||||
example: 1052262000000
|
@ -0,0 +1,27 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
type: object
|
||||
description: Server keys
|
||||
example: {
|
||||
"server_keys": [{
|
||||
$ref: "../examples/server_key.json"
|
||||
}]
|
||||
}
|
||||
properties:
|
||||
server_keys:
|
||||
type: array
|
||||
title: Server Keys
|
||||
description: The server keys.
|
||||
items:
|
||||
$ref: "keys.yaml"
|
@ -0,0 +1,52 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
type: object
|
||||
title: Persistent Data Unit
|
||||
description: A persistent data unit (event)
|
||||
example:
|
||||
$ref: "../examples/pdu.json"
|
||||
allOf:
|
||||
- $ref: "unsigned_pdu.yaml"
|
||||
- type: object
|
||||
properties:
|
||||
hashes:
|
||||
type: object
|
||||
title: Event Hash
|
||||
description: Hashes of the PDU, following the algorithm specified in `Signing Events`_.
|
||||
example: {
|
||||
"sha256": "thishashcoversallfieldsincasethisisredacted"
|
||||
}
|
||||
properties:
|
||||
sha256:
|
||||
type: string
|
||||
description: The hash.
|
||||
example: thishashcoversallfieldsincasthisisredacted
|
||||
required: ['sha256']
|
||||
signatures:
|
||||
type: object
|
||||
description: |-
|
||||
Signatures of the redacted PDU, following the algorithm specified in `Signing Events`_.
|
||||
example: {
|
||||
"example.com": {
|
||||
"ed25519:key_version:": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus"
|
||||
}
|
||||
}
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Server Signatures
|
||||
additionalProperties:
|
||||
type: string
|
||||
required:
|
||||
- hashes
|
||||
- signatures
|
@ -0,0 +1,35 @@
|
||||
# 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: Transaction
|
||||
description: Transaction
|
||||
example:
|
||||
$ref: "../examples/transaction.json"
|
||||
properties:
|
||||
origin:
|
||||
type: string
|
||||
description: |-
|
||||
The ``server_name`` of the homeserver sending this transaction.
|
||||
example: "example.org"
|
||||
origin_server_ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Timestamp in milliseconds on originating homeserver when this transaction started.
|
||||
example: 1234567890
|
||||
pdus:
|
||||
type: array
|
||||
description: List of persistent updates to rooms.
|
||||
items:
|
||||
$ref: "pdu.yaml"
|
||||
required: ['origin', 'origin_server_ts', 'pdus']
|
@ -0,0 +1,118 @@
|
||||
# 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: Unsigned Persistent Data Unit
|
||||
description: An unsigned persistent data unit (event)
|
||||
example:
|
||||
$ref: "../examples/unsigned_pdu.json"
|
||||
properties:
|
||||
room_id:
|
||||
type: string
|
||||
description: Room identifier.
|
||||
example: "!abc123:matrix.org"
|
||||
sender:
|
||||
type: string
|
||||
description: The ID of the user sending the event.
|
||||
example: "@someone:matrix.org"
|
||||
origin:
|
||||
type: string
|
||||
description: The ``server_name`` of the homeserver that created this event.
|
||||
example: "matrix.org"
|
||||
origin_server_ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Timestamp in milliseconds on origin homeserver when this event was created.
|
||||
example: 1234567890
|
||||
type:
|
||||
type: string
|
||||
description: Event type
|
||||
example: "m.room.message"
|
||||
state_key:
|
||||
type: string
|
||||
description: |-
|
||||
If this key is present, the event is a state event, and it will replace previous events
|
||||
with the same ``type`` and ``state_key`` in the room state.
|
||||
example: "my_key"
|
||||
content:
|
||||
type: object
|
||||
description: The content of the event.
|
||||
example: {"key": "value"}
|
||||
prev_events:
|
||||
type: array
|
||||
description: |-
|
||||
Event IDs and hashes of the most recent events in the room that the homeserver was aware
|
||||
of when it made this event.
|
||||
items:
|
||||
type: array
|
||||
maxItems: 2
|
||||
minItems: 2
|
||||
items:
|
||||
- type: string
|
||||
title: Event ID
|
||||
example: "$abc123:matrix.org"
|
||||
- type: object
|
||||
title: Event Hash
|
||||
example: {
|
||||
"sha256": "abase64encodedsha256hashshouldbe43byteslong"
|
||||
}
|
||||
properties:
|
||||
sha256:
|
||||
type: string
|
||||
description: The event hash.
|
||||
example: abase64encodedsha256hashshouldbe43byteslong
|
||||
required: ['sha256']
|
||||
depth:
|
||||
type: integer
|
||||
description: The maximum depth of the ``prev_events``, plus one.
|
||||
example: 12
|
||||
auth_events:
|
||||
type: array
|
||||
description: Event IDs and hashes for the "auth events" of this event.
|
||||
items:
|
||||
type: array
|
||||
maxItems: 2
|
||||
minItems: 2
|
||||
items:
|
||||
- type: string
|
||||
title: Event ID
|
||||
example: "$abc123:matrix.org"
|
||||
- type: object
|
||||
title: Event Hash
|
||||
example: {
|
||||
"sha256": "abase64encodedsha256hashshouldbe43byteslong"
|
||||
}
|
||||
properties:
|
||||
sha256:
|
||||
type: string
|
||||
description: The event hash.
|
||||
example: abase64encodedsha256hashshouldbe43byteslong
|
||||
required: ['sha256']
|
||||
redacts:
|
||||
type: string
|
||||
description: For redaction events, the ID of the event being redacted.
|
||||
example: "$def456:matrix.org"
|
||||
unsigned:
|
||||
type: object
|
||||
description: Additional data added by the origin server but not covered by the ``signatures``.
|
||||
example: {"key": "value"}
|
||||
required:
|
||||
- room_id
|
||||
- sender
|
||||
- origin
|
||||
- origin_server_ts
|
||||
- type
|
||||
- content
|
||||
- prev_events
|
||||
- depth
|
||||
- auth_events
|
@ -0,0 +1,93 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
swagger: '2.0'
|
||||
info:
|
||||
title: "Matrix Federation Events API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8448
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/federation/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/state/{roomId}":
|
||||
get:
|
||||
summary: Get all the state of a given room
|
||||
description: |-
|
||||
Retrieves a snapshot of the entire current state of the given room.
|
||||
operationId: getRoomState
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
type: string
|
||||
description: The room ID to get state for.
|
||||
required: true
|
||||
x-example: "!abc123:matrix.org"
|
||||
responses:
|
||||
200:
|
||||
description: The room state for the room (kept under ``pdus``).
|
||||
schema:
|
||||
$ref: "definitions/transaction.yaml"
|
||||
"/event/{eventId}":
|
||||
get:
|
||||
summary: Get a single event
|
||||
description: |-
|
||||
Retrieves a single event.
|
||||
operationId: getEvent
|
||||
parameters:
|
||||
- in: path
|
||||
name: eventId
|
||||
type: string
|
||||
description: The event ID to get.
|
||||
required: true
|
||||
x-example: "$abc123:matrix.org"
|
||||
responses:
|
||||
200:
|
||||
description: A transaction containing a single PDU which is the event requested.
|
||||
schema:
|
||||
$ref: "definitions/transaction.yaml"
|
||||
"/backfill/{roomId}":
|
||||
get:
|
||||
summary: Retrieves the events which precede the given event
|
||||
description: |-
|
||||
Retreives a sliding-window history of previous PDUs that occurred in the given room.
|
||||
Starting from the PDU ID(s) given in the ``v`` argument, the PDUs that preceded it
|
||||
are retrieved, up to the total number given by the ``limit``.
|
||||
operationId: backfillRoom
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
type: string
|
||||
description: The room ID to backfill.
|
||||
required: true
|
||||
x-example: "!abc123:matrix.org"
|
||||
- in: query
|
||||
name: v
|
||||
type: string # TODO: The description says this is plural - figure out how to specify multiple, and spec it
|
||||
description: The event ID to backfill from.
|
||||
required: true
|
||||
x-example: "$abc123:matrix.org"
|
||||
- in: query
|
||||
name: limit
|
||||
type: integer
|
||||
description: The maximum number of events to retrieve.
|
||||
required: true
|
||||
x-example: 10
|
||||
responses:
|
||||
200:
|
||||
description: A transaction containing the PDUs that preceded the given event(s).
|
||||
schema:
|
||||
$ref: "definitions/transaction.yaml"
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"edu_type": "m.presence",
|
||||
"origin": "blue",
|
||||
"destination": "orange",
|
||||
"content": {
|
||||
"key": "value"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"$ref": "unsigned_pdu.json",
|
||||
"hashes": {
|
||||
"sha256": "thishashcoversallfieldsincasethisisredacted"
|
||||
},
|
||||
"signatures": {
|
||||
"example.com": {
|
||||
"ed25519:key_version:": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
{
|
||||
"server_name": "example.org",
|
||||
"verify_keys": {
|
||||
"ed25519:auto2": {
|
||||
"key": "Base+64+Encoded+Signature+Verification+Key"
|
||||
}
|
||||
},
|
||||
"old_verify_keys": {
|
||||
"ed25519:auto1": {
|
||||
"expired_ts": 922834800000,
|
||||
"key": "Base+64+Encoded+Old+Verify+Key"
|
||||
}
|
||||
},
|
||||
"signatures": {
|
||||
"example.org": {
|
||||
"ed25519:auto2": "Base+64+Encoded+Signature"
|
||||
}
|
||||
},
|
||||
"tls_fingerprints": [{
|
||||
"sha256": "Base+64+Encoded+SHA-256-Fingerprint"
|
||||
}],
|
||||
"valid_until_ts": 1052262000000
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"origin": "matrix.org",
|
||||
"origin_server_ts": 1234567890,
|
||||
"pdus": [{"$ref": "pdu.json"}]
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"room_id": "!UcYsUzyxTGDxLBEvLy:example.org",
|
||||
"sender": "@alice:example.com",
|
||||
"origin": "example.com",
|
||||
"event_id": "$a4ecee13e2accdadf56c1025:example.com",
|
||||
"origin_server_ts": 1404838188000,
|
||||
"type": "m.room.message",
|
||||
"prev_events": [
|
||||
[
|
||||
"$af232176:example.org",
|
||||
{"sha256": "abase64encodedsha256hashshouldbe43byteslong"}
|
||||
]
|
||||
],
|
||||
"content": {
|
||||
"key": "value"
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
# 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 Key Exchange API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8448
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/key/v2
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/query/{serverName}/{keyId}":
|
||||
get:
|
||||
summary: Retrieve a server key.
|
||||
description: Retrieve a server key.
|
||||
operationId: perspectivesKeyQuery
|
||||
parameters:
|
||||
- in: path
|
||||
name: serverName
|
||||
type: string
|
||||
description: Server name.
|
||||
required: true
|
||||
x-example: matrix.org
|
||||
- in: path
|
||||
name: keyId
|
||||
type: string
|
||||
description: Key ID.
|
||||
required: true
|
||||
x-example: TODO # No examples in spec so far
|
||||
- in: query
|
||||
name: minimum_valid_until_ts
|
||||
type: integer
|
||||
format: int64
|
||||
description: Minimum Valid Until Milliseconds.
|
||||
required: true # TODO: Verify
|
||||
x-example: 1234567890
|
||||
responses:
|
||||
200:
|
||||
description: The keys for the server
|
||||
schema:
|
||||
$ref: "definitions/keys_query_response.yaml"
|
||||
"/query":
|
||||
post:
|
||||
summary: Retrieve a server key
|
||||
description: Retrieve a server key.
|
||||
operationId: bulkPerspectivesKeyQuery
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
type: object
|
||||
# TODO: Improve example
|
||||
example: {
|
||||
"server_keys": {
|
||||
"{server_name}": {
|
||||
"{key_id}": {
|
||||
"minimum_valid_until_ts": 1234567890
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
properties:
|
||||
server_keys:
|
||||
type: object
|
||||
description: The query criteria.
|
||||
additionalProperties:
|
||||
type: object
|
||||
name: ServerName
|
||||
description: The server names to query.
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Query Criteria
|
||||
description: The server keys to query.
|
||||
properties:
|
||||
minimum_valid_until_ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Minimum Valid Until MS.
|
||||
example: 1234567890
|
||||
required: ['server_keys']
|
||||
responses:
|
||||
200:
|
||||
description: The keys for the server.
|
||||
schema:
|
||||
$ref: "definitions/keys_query_response.yaml"
|
@ -0,0 +1,42 @@
|
||||
# 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 Key Exchange API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8448
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/key/v2
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/server/{keyId}":
|
||||
get:
|
||||
summary: Get the server's key
|
||||
description: Get the server's key.
|
||||
operationId: getServerKey
|
||||
parameters:
|
||||
- in: path
|
||||
name: keyId
|
||||
type: string
|
||||
description: Key ID
|
||||
required: false
|
||||
x-example: TODO # No examples in the spec so far
|
||||
responses:
|
||||
200:
|
||||
description: The server's keys.
|
||||
schema:
|
||||
$ref: "definitions/keys.yaml"
|
@ -0,0 +1,44 @@
|
||||
# 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 Query API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8448
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/federation/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/query/{queryType}":
|
||||
get:
|
||||
summary: Query for information
|
||||
description: |-
|
||||
Performs a single query request on the receiving homeserver. The query string
|
||||
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
|
||||
parameters:
|
||||
- in: path
|
||||
name: queryType
|
||||
type: string
|
||||
description: The type of query to make
|
||||
required: true
|
||||
x-example: profile
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
The query response. The schema varies depending on the query being made.
|
@ -0,0 +1,190 @@
|
||||
# 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 Third Party Invites API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8448
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/federation/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/exchange_third_party_invite/{roomId}":
|
||||
put:
|
||||
summary: Request a server to auth a third party invite event
|
||||
description: |-
|
||||
The receiving server will verify the partial ``m.room.member`` event
|
||||
given in the request body. If valid, the receiving server will issue
|
||||
an invite as per the `Inviting to a room`_ section before returning a
|
||||
response to this request.
|
||||
operationId: exchangeThirdPartyInvite
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
type: string
|
||||
description: The room ID to exchange a third party invite in
|
||||
required: true
|
||||
x-example: "!abc123:matrix.org"
|
||||
- in: body
|
||||
name: body
|
||||
type: object
|
||||
description: A partial ``m.room.member`` event
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
description: The event type. Must be ``m.room.member``
|
||||
example: "m.room.member"
|
||||
room_id:
|
||||
type: string
|
||||
description: |-
|
||||
The room ID the event is for. Must match the ID given in
|
||||
the path.
|
||||
example: "!abc123:matrix.org"
|
||||
sender:
|
||||
type: string
|
||||
description: |-
|
||||
The user ID of the user who sent the original ``m.room.third_party_invite``
|
||||
event.
|
||||
example: "@joe:matrix.org"
|
||||
state_key:
|
||||
type: string
|
||||
description: The user ID of the invited user
|
||||
example: "@someone:example.org"
|
||||
content:
|
||||
type: object
|
||||
description: The event content
|
||||
title: Event Content
|
||||
properties:
|
||||
membership:
|
||||
type: string
|
||||
description: The membership state. Must be ``invite``
|
||||
example: invite
|
||||
third_party_invite:
|
||||
type: object
|
||||
description: The third party invite
|
||||
properties:
|
||||
display_name:
|
||||
type: string
|
||||
description: |-
|
||||
A name which can be displayed to represent the user instead of their
|
||||
third party identifier.
|
||||
example: "alice"
|
||||
signed:
|
||||
type: object
|
||||
description: |-
|
||||
A block of content which has been signed, which servers can use to
|
||||
verify the event.
|
||||
properties:
|
||||
signatures:
|
||||
type: object
|
||||
description: The server signatures for this event.
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Server Signatures
|
||||
additionalProperties:
|
||||
type: string
|
||||
example: {
|
||||
"magic.forest": {
|
||||
"ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg"
|
||||
}
|
||||
}
|
||||
mxid:
|
||||
type: string
|
||||
description: The invited matrix user ID
|
||||
example: "@alice:localhost"
|
||||
token:
|
||||
type: string
|
||||
description: The token used to verify the event
|
||||
example: abc123
|
||||
required: ['signatures', 'mxid', 'token']
|
||||
example: {
|
||||
"mxid": "@alice:localhost",
|
||||
"token": "abc123",
|
||||
"signatures": {
|
||||
"magic.forest": {
|
||||
"ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg"
|
||||
}
|
||||
}
|
||||
}
|
||||
required: ['display_name', 'signed']
|
||||
example: {
|
||||
"display_name": "alice",
|
||||
"signed": {
|
||||
"mxid": "@alice:localhost",
|
||||
"token": "abc123",
|
||||
"signatures": {
|
||||
"magic.forest": {
|
||||
"ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
required: ['membership', 'third_party_invite']
|
||||
example: {
|
||||
"membership": "invite",
|
||||
"third_party_invite": {
|
||||
"display_name": "alice",
|
||||
"signed": {
|
||||
"mxid": "@alice:localhost",
|
||||
"token": "abc123",
|
||||
"signatures": {
|
||||
"magic.forest": {
|
||||
"ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
required:
|
||||
- type
|
||||
- room_id
|
||||
- sender
|
||||
- state_key
|
||||
- content
|
||||
example: {
|
||||
"type": "m.room.member",
|
||||
"room_id": "!abc123:matrix.org",
|
||||
"sender": "@joe:matrix.org",
|
||||
"state_key": "@someone:example.org",
|
||||
"content": {
|
||||
"membership": "invite",
|
||||
"third_party_invite": {
|
||||
"display_name": "alice",
|
||||
"signed": {
|
||||
"mxid": "@alice:localhost",
|
||||
"token": "abc123",
|
||||
"signatures": {
|
||||
"magic.forest": {
|
||||
"ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: The invite has been issued successfully.
|
||||
examples:
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
||||
description: An empty object
|
||||
example: {}
|
@ -0,0 +1,64 @@
|
||||
# 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 Transaction API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8448
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/federation/v1
|
||||
produces:
|
||||
- application/json
|
||||
paths:
|
||||
"/send/{txnId}":
|
||||
put:
|
||||
summary: Send a transaction
|
||||
description: |-
|
||||
Push messages representing live activity to another server. The destination name
|
||||
will be set to that of the receiving server itself. Each embedded PDU in the
|
||||
transaction body will be processed.
|
||||
operationId: sendTransaction
|
||||
parameters:
|
||||
- in: path
|
||||
name: txnId
|
||||
type: string
|
||||
# TODO: "Overrides any ID given in the JSON body" - What does this mean?
|
||||
description: |-
|
||||
The transaction ID. Overrides any ID given in the JSON body.
|
||||
required: true
|
||||
x-example: TODO # No examples in the spec so far
|
||||
- in: body
|
||||
name: body
|
||||
type: object
|
||||
required: true
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: "definitions/transaction.yaml"
|
||||
- type: object
|
||||
properties:
|
||||
edus:
|
||||
type: array
|
||||
description: List of ephemeral messages. May be omitted if there are no ephemeral messages to be sent.
|
||||
items:
|
||||
$ref: "definitions/edu.yaml"
|
||||
example: {
|
||||
"$ref": "examples/transaction.json",
|
||||
"edus": [{"$ref": "edu.json"}] # Relative to the examples directory
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
# TODO: Spec this (and figure out what it is)
|
||||
description: TODO
|
@ -0,0 +1,55 @@
|
||||
<!-- Note: This is a markdown file so the build script's RST processing doesn't grab it -->
|
||||
|
||||
# Changelogs
|
||||
|
||||
[Towncrier](https://github.com/hawkowl/towncrier) is used to manage the changelog and
|
||||
keep it up to date. Because of this, updating a changelog is really easy.
|
||||
|
||||
## How to update a changelog when releasing an API
|
||||
|
||||
1. Ensure you're in your Python 3 virtual environment
|
||||
2. `cd` your way to the API you're releasing (eg: `cd changelogs/client_server`)
|
||||
3. Run `towncrier --version "r0.4.0" --name "client-server" --yes` substituting the
|
||||
variables as approprite. Note that `--name` is required although the value is ignored.
|
||||
4. Commit the changes and finish the release process.
|
||||
|
||||
## How to prepare a changelog for a new API
|
||||
|
||||
For this example, we're going to pretend that the `server_server` API doesn't exist.
|
||||
|
||||
1. Create the file `changelogs/server_server.rst`
|
||||
2. Create the folder `changelogs/server_server`
|
||||
3. In the new folder, create a `pyproject.toml` file with these contents:
|
||||
```toml
|
||||
[tool.towncrier]
|
||||
filename = "../server_server.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
|
||||
```
|
||||
4. Create a `.gitignore` in `changelogs/server_server/newsfragments` with the contents `!.gitignore`
|
@ -0,0 +1 @@
|
||||
!.gitignore
|
@ -0,0 +1 @@
|
||||
``POST /user_directory/search``
|
@ -0,0 +1 @@
|
||||
Mark ``home_server`` return field for ``/login`` and ``/register`` endpoints as deprecated
|
@ -0,0 +1 @@
|
||||
Add ``token`` parameter to the ``/keys/query`` endpoint
|
@ -0,0 +1 @@
|
||||
Fix response format of ``/keys/changes`` endpoint
|
@ -0,0 +1 @@
|
||||
Clarify default values for some fields on the ``/search`` API
|
@ -0,0 +1 @@
|
||||
``GET /rooms/{roomId}/event/{eventId}``
|
@ -0,0 +1 @@
|
||||
Fix the representation of ``m.presence`` events
|
@ -0,0 +1 @@
|
||||
Clarify that ``m.tag`` ordering is done with numbers, not strings
|
@ -0,0 +1 @@
|
||||
Add the room visibility options for the room directory
|
@ -0,0 +1 @@
|
||||
Add spec for ignoring users
|
@ -0,0 +1 @@
|
||||
Add the ``/register/available`` endpoint for username availability
|
@ -0,0 +1 @@
|
||||
Clarify that ``/account/whoami`` should consider application services
|
@ -0,0 +1,3 @@
|
||||
Update ``ImageInfo`` and ``ThumbnailInfo`` dimension schema descriptions
|
||||
to clarify that they relate to intended display size, as opposed to the
|
||||
intrinsic size of the image file.
|
@ -0,0 +1 @@
|
||||
Add sticker messages
|
@ -0,0 +1 @@
|
||||
``POST /delete_devices``
|
@ -0,0 +1 @@
|
||||
Mark ``GET /rooms/{roomId}/members`` as requiring authentication
|
@ -0,0 +1 @@
|
||||
Document ``/logout/all`` endpoint
|
@ -0,0 +1 @@
|
||||
Add report content API
|
@ -0,0 +1 @@
|
||||
Add ``allow_remote`` to the content repo to avoid routing loops
|
@ -0,0 +1 @@
|
||||
Document `highlights` field in /search response
|
@ -0,0 +1 @@
|
||||
Describe ``StateEvent`` for ``/createRoom``
|
@ -0,0 +1 @@
|
||||
``GET /thirdparty/*`` Endpoints
|
@ -0,0 +1 @@
|
||||
Document the GET version of ``/login``
|
@ -0,0 +1 @@
|
||||
Describe how the ``reason`` is handled for kicks/bans
|
@ -0,0 +1 @@
|
||||
Document the ``server_name`` parameter on ``/join/{roomIdOrAlias}``
|
@ -0,0 +1 @@
|
||||
Document the CORS/preflight headers
|
@ -0,0 +1 @@
|
||||
Mark ``GET /presence/{userId}/status`` as requiring authentication
|
@ -0,0 +1 @@
|
||||
Describe the rate limit error response schema
|
@ -0,0 +1 @@
|
||||
Clarify that clients must leave rooms before forgetting them
|
@ -0,0 +1 @@
|
||||
Document guest access in ``/createRoom`` presets
|
@ -0,0 +1 @@
|
||||
Define what a ``RoomEvent`` is on ``/rooms/{roomId}/messages``
|
@ -0,0 +1 @@
|
||||
Clarify the request and result types on ``/search``
|
@ -0,0 +1 @@
|
||||
Document message formats on ``m.text`` and ``m.emote`` messages
|
@ -0,0 +1 @@
|
||||
Clarify some of the properties on the search result
|
@ -0,0 +1,30 @@
|
||||
[tool.towncrier]
|
||||
filename = "../client_server.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
|
@ -0,0 +1,9 @@
|
||||
[ tool.giles ]
|
||||
|
||||
[ tool.giles.circleci_artifacts.docs ]
|
||||
url = "gen/index.html"
|
||||
message = "Click details to preview the HTML documentation."
|
||||
|
||||
[ tool.giles.circleci_artifacts.swagger ]
|
||||
url = "client-server/index.html"
|
||||
message = "Click to preview the swagger build."
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue