mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-19 17:44:08 +02:00
Apply event format warnings to the remainder of the s2s spec
This commit is contained in:
parent
d94a70f49d
commit
33406e4662
|
|
@ -130,6 +130,6 @@ paths:
|
||||||
examples:
|
examples:
|
||||||
application/json: {
|
application/json: {
|
||||||
"events": [
|
"events": [
|
||||||
{"see_room_version_spec": "The event format changes depending on the room version."}
|
{"$ref": "examples/minimal_pdu.json"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright 2018 New Vector Ltd
|
# Copyright 2018-2019 New Vector Ltd
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
|
@ -13,15 +13,14 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
type: object
|
type: object
|
||||||
title: Invite Event
|
title: Invite Event
|
||||||
description: An invite event
|
description: |-
|
||||||
|
An invite event. Note that events have a different version depending on the
|
||||||
|
room version - check the `room version specification`_ for precise event formats.
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: "pdu.yaml"
|
|
||||||
- type: object
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
# Note: we override a bunch of parameters to change their descriptions
|
|
||||||
sender:
|
sender:
|
||||||
type: string
|
type: string
|
||||||
# TODO: Verify/clarify this - it doesn't seem right, given this is a 'regular' invite
|
|
||||||
description: |-
|
description: |-
|
||||||
The matrix ID of the user who sent the original ``m.room.third_party_invite``.
|
The matrix ID of the user who sent the original ``m.room.third_party_invite``.
|
||||||
example: "@someone:example.org"
|
example: "@someone:example.org"
|
||||||
|
|
@ -46,7 +45,7 @@ allOf:
|
||||||
type: object
|
type: object
|
||||||
title: Membership Event Content
|
title: Membership Event Content
|
||||||
description: |-
|
description: |-
|
||||||
The content of the event, matching what is available in the
|
The content of the event, matching what is available in the
|
||||||
`Client-Server API`_. Must include a ``membership`` of ``invite``.
|
`Client-Server API`_. Must include a ``membership`` of ``invite``.
|
||||||
example: {"membership": "invite"}
|
example: {"membership": "invite"}
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -55,33 +54,10 @@ allOf:
|
||||||
description: The value ``invite``.
|
description: The value ``invite``.
|
||||||
example: "invite"
|
example: "invite"
|
||||||
required: ['membership']
|
required: ['membership']
|
||||||
auth_events:
|
|
||||||
type: array
|
|
||||||
description: |-
|
|
||||||
An event reference list containing the authorization events that would
|
|
||||||
allow the member to be invited to the room.
|
|
||||||
items:
|
|
||||||
type: array
|
|
||||||
maxItems: 2
|
|
||||||
minItems: 2
|
|
||||||
items:
|
|
||||||
- type: string
|
|
||||||
title: Event ID
|
|
||||||
example: "$abc123:matrix.org"
|
|
||||||
- type: object
|
|
||||||
title: Event Hash
|
|
||||||
example: {
|
|
||||||
"sha256": "abase64encodedsha256hashshouldbe43byteslong"
|
|
||||||
}
|
|
||||||
properties:
|
|
||||||
sha256:
|
|
||||||
type: string
|
|
||||||
description: The event hash.
|
|
||||||
example: abase64encodedsha256hashshouldbe43byteslong
|
|
||||||
required: ['sha256']
|
|
||||||
redacts:
|
|
||||||
type: string
|
|
||||||
description: Not used.
|
|
||||||
required:
|
required:
|
||||||
# Every other field is already flagged as required by the $ref
|
|
||||||
- state_key
|
- state_key
|
||||||
|
- sender
|
||||||
|
- origin
|
||||||
|
- origin_server_ts
|
||||||
|
- type
|
||||||
|
- content
|
||||||
|
|
|
||||||
|
|
@ -42,5 +42,6 @@ properties:
|
||||||
The `PDUs <#pdus>`_ contained in the transaction. The event format varies depending
|
The `PDUs <#pdus>`_ contained in the transaction. The event format varies depending
|
||||||
on the room version - check the `room version specification`_ for precise event formats.
|
on the room version - check the `room version specification`_ for precise event formats.
|
||||||
properties: []
|
properties: []
|
||||||
example: {"see_room_version_spec": "The event format changes depending on the room version."}
|
example:
|
||||||
|
$ref: "../examples/minimal_pdu.json"
|
||||||
required: ['origin', 'origin_server_ts', 'pdus']
|
required: ['origin', 'origin_server_ts', 'pdus']
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ host: localhost:8448
|
||||||
schemes:
|
schemes:
|
||||||
- https
|
- https
|
||||||
basePath: /_matrix/federation/v1
|
basePath: /_matrix/federation/v1
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
|
|
@ -58,10 +58,19 @@ paths:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
The full set of authorization events that make up the state of
|
The full set of authorization events that make up the state of
|
||||||
the room, and their authorization events, recursively.
|
the room, and their authorization events, recursively. Note that
|
||||||
|
events have a different version depending on the room version -
|
||||||
|
check the `room version specification`_ for precise event formats.
|
||||||
items:
|
items:
|
||||||
$ref: "definitions/pdu.yaml"
|
type: object
|
||||||
example: [{"$ref": "examples/pdu.json"}]
|
title: PDU
|
||||||
|
description: |-
|
||||||
|
The `PDUs <#pdus>`_ contained in the auth chain. The event format
|
||||||
|
varies depending on the room version - check the `room version specification`_
|
||||||
|
for precise event formats.
|
||||||
|
properties: []
|
||||||
|
example:
|
||||||
|
$ref: "examples/minimal_pdu.json"
|
||||||
required: ['auth_chain']
|
required: ['auth_chain']
|
||||||
"/query_auth/{roomId}/{eventId}":
|
"/query_auth/{roomId}/{eventId}":
|
||||||
post:
|
post:
|
||||||
|
|
@ -98,10 +107,20 @@ paths:
|
||||||
properties:
|
properties:
|
||||||
auth_chain:
|
auth_chain:
|
||||||
type: array
|
type: array
|
||||||
description: The auth chain (the "remote auth").
|
description: |-
|
||||||
|
The auth chain (the "remote auth"). Note that events have a different
|
||||||
|
version depending on the room version - check the `room version specification`_
|
||||||
|
for precise event formats.
|
||||||
items:
|
items:
|
||||||
$ref: "definitions/pdu.yaml"
|
type: object
|
||||||
example: [{"$ref": "examples/pdu.json"}]
|
title: PDU
|
||||||
|
description: |-
|
||||||
|
The `PDUs <#pdus>`_ contained in the auth chain. The event format
|
||||||
|
varies depending on the room version - check the `room version specification`_
|
||||||
|
for precise event formats.
|
||||||
|
properties: []
|
||||||
|
example:
|
||||||
|
$ref: "examples/minimal_pdu.json"
|
||||||
missing:
|
missing:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
|
|
@ -142,14 +161,23 @@ paths:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
The auth chain the receiver has, and used to determine the auth
|
The auth chain the receiver has, and used to determine the auth
|
||||||
chain differences (the "local auth").
|
chain differences (the "local auth"). Note that events have a different
|
||||||
|
version depending on the room version - check the `room version specification`_
|
||||||
|
for precise event formats.
|
||||||
items:
|
items:
|
||||||
$ref: "definitions/pdu.yaml"
|
type: object
|
||||||
example: [{"$ref": "examples/pdu.json"}]
|
title: PDU
|
||||||
|
description: |-
|
||||||
|
The `PDUs <#pdus>`_ contained in the auth chain. The event format
|
||||||
|
varies depending on the room version - check the `room version specification`_
|
||||||
|
for precise event formats.
|
||||||
|
properties: []
|
||||||
|
example:
|
||||||
|
$ref: "examples/minimal_pdu.json"
|
||||||
missing:
|
missing:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
The list of event IDs that the receiver believes it is missing,
|
The list of event IDs that the receiver believes it is missing,
|
||||||
after comparing the "remote auth" and "local auth" chains.
|
after comparing the "remote auth" and "local auth" chains.
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
|
|
||||||
|
|
@ -59,17 +59,35 @@ paths:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
The full set of authorization events that make up the state
|
The full set of authorization events that make up the state
|
||||||
of the room, and their authorization events, recursively.
|
of the room, and their authorization events, recursively. Note that
|
||||||
|
events have a different version depending on the room version -
|
||||||
|
check the `room version specification`_ for precise event formats.
|
||||||
items:
|
items:
|
||||||
$ref: "definitions/pdu.yaml"
|
type: object
|
||||||
example: [{"$ref": "examples/pdu.json"}]
|
title: PDU
|
||||||
|
description: |-
|
||||||
|
The `PDUs <#pdus>`_ contained in the auth chain. The event format
|
||||||
|
varies depending on the room version - check the `room version specification`_
|
||||||
|
for precise event formats.
|
||||||
|
properties: []
|
||||||
|
example:
|
||||||
|
$ref: "examples/minimal_pdu.json"
|
||||||
pdus:
|
pdus:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
The fully resolved state of the room at the given event.
|
The fully resolved state of the room at the given event. Note that
|
||||||
|
events have a different version depending on the room version -
|
||||||
|
check the `room version specification`_ for precise event formats.
|
||||||
items:
|
items:
|
||||||
$ref: "definitions/pdu.yaml"
|
type: object
|
||||||
example: [{"$ref": "examples/pdu.json"}]
|
title: PDU
|
||||||
|
description: |-
|
||||||
|
The `PDUs <#pdus>`_ for the fully resolved state of the room. The event format
|
||||||
|
varies depending on the room version - check the `room version specification`_
|
||||||
|
for precise event formats.
|
||||||
|
properties: []
|
||||||
|
example:
|
||||||
|
$ref: "examples/minimal_pdu.json"
|
||||||
required: ['auth_chain', 'pdus']
|
required: ['auth_chain', 'pdus']
|
||||||
"/state_ids/{roomId}":
|
"/state_ids/{roomId}":
|
||||||
get:
|
get:
|
||||||
|
|
|
||||||
7
api/server-server/examples/minimal_pdu.json
Normal file
7
api/server-server/examples/minimal_pdu.json
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"type": "m.room.minimal_pdu",
|
||||||
|
"room_id": "!somewhere:example.org",
|
||||||
|
"content": {
|
||||||
|
"see_room_version_spec": "The event format changes depending on the room version."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
"origin": "matrix.org",
|
"origin": "matrix.org",
|
||||||
"origin_server_ts": 1234567890,
|
"origin_server_ts": 1234567890,
|
||||||
"pdus": [{
|
"pdus": [{
|
||||||
"see_room_version_spec": "The event format changes depending on the room version."
|
"$ref": "minimal_pdu.json"
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,11 @@ paths:
|
||||||
Servers should prefer to use the v2 API for invites instead of the v1 API. Servers
|
Servers should prefer to use the v2 API for invites instead of the v1 API. Servers
|
||||||
which receive a v1 invite request must assume that the room version is either ``"1"``
|
which receive a v1 invite request must assume that the room version is either ``"1"``
|
||||||
or ``"2"``.
|
or ``"2"``.
|
||||||
|
|
||||||
|
Note that events have a different version depending on the room version - check the
|
||||||
|
`room version specification`_ for precise event formats. **The request and response
|
||||||
|
bodies here describe the common event fields in more detail and may be missing other
|
||||||
|
required fields for a PDU.**
|
||||||
operationId: sendInviteV1
|
operationId: sendInviteV1
|
||||||
security:
|
security:
|
||||||
- signedRequest: []
|
- signedRequest: []
|
||||||
|
|
@ -107,7 +112,7 @@ paths:
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
example: {
|
example: {
|
||||||
"$ref": "examples/pdu.json",
|
"$ref": "examples/minimal_pdu.json",
|
||||||
"type": "m.room.member",
|
"type": "m.room.member",
|
||||||
"state_key": "@joe:elsewhere.com",
|
"state_key": "@joe:elsewhere.com",
|
||||||
"unsigned": {
|
"unsigned": {
|
||||||
|
|
@ -143,7 +148,8 @@ paths:
|
||||||
200:
|
200:
|
||||||
description: |-
|
description: |-
|
||||||
The event with the invited server's signature added. All other fields of the events
|
The event with the invited server's signature added. All other fields of the events
|
||||||
should remain untouched.
|
should remain untouched. Note that events have a different version depending on the
|
||||||
|
room version - check the `room version specification`_ for precise event formats.
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
minItems: 2
|
minItems: 2
|
||||||
|
|
@ -164,7 +170,7 @@ paths:
|
||||||
200,
|
200,
|
||||||
{
|
{
|
||||||
"event": {
|
"event": {
|
||||||
"$ref": "examples/pdu.json",
|
"$ref": "examples/minimal_pdu.json",
|
||||||
"type": "m.room.member",
|
"type": "m.room.member",
|
||||||
"state_key": "@someone:example.org",
|
"state_key": "@someone:example.org",
|
||||||
"unsigned": {
|
"unsigned": {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,11 @@ paths:
|
||||||
This endpoint is preferred over the v1 API as it is more useful for servers. Senders
|
This endpoint is preferred over the v1 API as it is more useful for servers. Senders
|
||||||
which receive a 400 or 404 response to this endpoint should retry using the v1
|
which receive a 400 or 404 response to this endpoint should retry using the v1
|
||||||
API as the server may be older, if the room version is "1" or "2".
|
API as the server may be older, if the room version is "1" or "2".
|
||||||
|
|
||||||
|
Note that events have a different version depending on the room version - check the
|
||||||
|
`room version specification`_ for precise event formats. **The request and response
|
||||||
|
bodies here describe the common event fields in more detail and may be missing other
|
||||||
|
required fields for a PDU.**
|
||||||
operationId: sendInviteV2
|
operationId: sendInviteV2
|
||||||
security:
|
security:
|
||||||
- signedRequest: []
|
- signedRequest: []
|
||||||
|
|
@ -111,7 +116,7 @@ paths:
|
||||||
example: {
|
example: {
|
||||||
"room_version": "2",
|
"room_version": "2",
|
||||||
"event": {
|
"event": {
|
||||||
"$ref": "examples/pdu.json",
|
"$ref": "examples/minimal_pdu.json",
|
||||||
"type": "m.room.member",
|
"type": "m.room.member",
|
||||||
"state_key": "@joe:elsewhere.com",
|
"state_key": "@joe:elsewhere.com",
|
||||||
"content": {
|
"content": {
|
||||||
|
|
@ -146,7 +151,8 @@ paths:
|
||||||
200:
|
200:
|
||||||
description: |-
|
description: |-
|
||||||
The event with the invited server's signature added. All other fields of the events
|
The event with the invited server's signature added. All other fields of the events
|
||||||
should remain untouched.
|
should remain untouched. Note that events have a different version depending on the
|
||||||
|
room version - check the `room version specification`_ for precise event formats.
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
description: An object containing the signed invite event.
|
description: An object containing the signed invite event.
|
||||||
|
|
@ -158,7 +164,7 @@ paths:
|
||||||
examples:
|
examples:
|
||||||
application/json: {
|
application/json: {
|
||||||
"event": {
|
"event": {
|
||||||
"$ref": "examples/pdu.json",
|
"$ref": "examples/minimal_pdu.json",
|
||||||
"type": "m.room.member",
|
"type": "m.room.member",
|
||||||
"state_key": "@someone:example.org",
|
"state_key": "@someone:example.org",
|
||||||
"unsigned": {
|
"unsigned": {
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,11 @@ paths:
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: |-
|
description: |-
|
||||||
A template to be used for the rest of the `Joining Rooms`_ handshake.
|
A template to be used for the rest of the `Joining Rooms`_ handshake. Note that
|
||||||
|
events have a different version depending on the room version - check the
|
||||||
|
`room version specification`_ for precise event formats. **The response body
|
||||||
|
here describes the common event fields in more detail and may be missing other
|
||||||
|
required fields for a PDU.**
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -72,96 +76,61 @@ paths:
|
||||||
the room version is assumed to be either "1" or "2".
|
the room version is assumed to be either "1" or "2".
|
||||||
example: "2"
|
example: "2"
|
||||||
event:
|
event:
|
||||||
allOf:
|
description: |-
|
||||||
- $ref: "definitions/unsigned_pdu.yaml"
|
An unsigned template event. Note that events have a different version
|
||||||
- description: |-
|
depending on the room version - check the `room version specification`_
|
||||||
An unsigned template event.
|
for precise event formats.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
sender:
|
||||||
|
type: string
|
||||||
|
description: The user ID of the joining member.
|
||||||
|
example: "@someone:example.org"
|
||||||
|
origin:
|
||||||
|
type: string
|
||||||
|
description: The name of the resident homeserver.
|
||||||
|
example: "matrix.org"
|
||||||
|
origin_server_ts:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
description: A timestamp added by the resident homeserver.
|
||||||
|
example: 1234567890
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
description: The value ``m.room.member``.
|
||||||
|
example: "m.room.member"
|
||||||
|
state_key:
|
||||||
|
type: string
|
||||||
|
description: The user ID of the joining member.
|
||||||
|
example: "@someone:example.org"
|
||||||
|
content:
|
||||||
type: object
|
type: object
|
||||||
|
title: Membership Event Content
|
||||||
|
description: The content of the event.
|
||||||
|
example: {"membership": "join"}
|
||||||
properties:
|
properties:
|
||||||
# Note: we override a bunch of parameters to change their descriptions
|
membership:
|
||||||
sender:
|
|
||||||
type: string
|
type: string
|
||||||
description: The user ID of the joining member.
|
description: The value ``join``.
|
||||||
example: "@someone:example.org"
|
example: "join"
|
||||||
origin:
|
required: ['membership']
|
||||||
type: string
|
required:
|
||||||
description: The name of the resident homeserver.
|
- state_key
|
||||||
example: "matrix.org"
|
- origin
|
||||||
origin_server_ts:
|
- origin_server_ts
|
||||||
type: integer
|
- type
|
||||||
format: int64
|
- state_key
|
||||||
description: A timestamp added by the resident homeserver.
|
- content
|
||||||
example: 1234567890
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
description: The value ``m.room.member``.
|
|
||||||
example: "m.room.member"
|
|
||||||
state_key:
|
|
||||||
type: string
|
|
||||||
description: The user ID of the joining member.
|
|
||||||
example: "@someone:example.org"
|
|
||||||
content:
|
|
||||||
type: object
|
|
||||||
title: Membership Event Content
|
|
||||||
description: The content of the event.
|
|
||||||
example: {"membership": "join"}
|
|
||||||
properties:
|
|
||||||
membership:
|
|
||||||
type: string
|
|
||||||
description: The value ``join``.
|
|
||||||
example: "join"
|
|
||||||
required: ['membership']
|
|
||||||
depth:
|
|
||||||
type: integer
|
|
||||||
description: This field must be present but is ignored; it may be 0.
|
|
||||||
example: 12
|
|
||||||
auth_events:
|
|
||||||
type: array
|
|
||||||
description: |-
|
|
||||||
An event reference list containing the authorization events that would
|
|
||||||
allow the member to join the room. This should normally be the
|
|
||||||
``m.room.create``, ``m.room.power_levels``, and ``m.room.join_rules``
|
|
||||||
events.
|
|
||||||
items:
|
|
||||||
type: array
|
|
||||||
maxItems: 2
|
|
||||||
minItems: 2
|
|
||||||
items:
|
|
||||||
- type: string
|
|
||||||
title: Event ID
|
|
||||||
example: "$abc123:matrix.org"
|
|
||||||
- type: object
|
|
||||||
title: Event Hash
|
|
||||||
example: {
|
|
||||||
"sha256": "abase64encodedsha256hashshouldbe43byteslong"
|
|
||||||
}
|
|
||||||
properties:
|
|
||||||
sha256:
|
|
||||||
type: string
|
|
||||||
description: The event hash.
|
|
||||||
example: abase64encodedsha256hashshouldbe43byteslong
|
|
||||||
required: ['sha256']
|
|
||||||
redacts:
|
|
||||||
type: string
|
|
||||||
description: Not used.
|
|
||||||
required:
|
|
||||||
# Every other field is already flagged as required by the $ref
|
|
||||||
- state_key
|
|
||||||
examples:
|
examples:
|
||||||
application/json: {
|
application/json: {
|
||||||
"room_version": "2",
|
"room_version": "2",
|
||||||
"event": {
|
"event": {
|
||||||
"$ref": "examples/unsigned_pdu.json",
|
"$ref": "examples/minimal_pdu.json",
|
||||||
"type": "m.room.member",
|
"type": "m.room.member",
|
||||||
"state_key": "@someone:example.org",
|
"state_key": "@someone:example.org",
|
||||||
"content": {
|
"content": {
|
||||||
"membership": "join"
|
"membership": "join"
|
||||||
},
|
}
|
||||||
"auth_events": [
|
|
||||||
["$room_cre4te_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}],
|
|
||||||
["$room_j0in_rul3s_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}],
|
|
||||||
["$room_p0wer_l3vels_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}]
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
400:
|
400:
|
||||||
|
|
@ -193,7 +162,12 @@ paths:
|
||||||
summary: Submit a signed join event to a resident server
|
summary: Submit a signed join event to a resident server
|
||||||
description: |-
|
description: |-
|
||||||
Submits a signed join event to the resident server for it
|
Submits a signed join event to the resident server for it
|
||||||
to accept it into the room's graph.
|
to accept it into the room's graph. Note that events have
|
||||||
|
a different version depending on the room version - check
|
||||||
|
the `room version specification`_ for precise event formats.
|
||||||
|
**The request and response body here describes the common
|
||||||
|
event fields in more detail and may be missing other required
|
||||||
|
fields for a PDU.**
|
||||||
operationId: sendJoin
|
operationId: sendJoin
|
||||||
security:
|
security:
|
||||||
- signedRequest: []
|
- signedRequest: []
|
||||||
|
|
@ -215,79 +189,50 @@ paths:
|
||||||
type: object
|
type: object
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
type: object
|
||||||
- $ref: "definitions/pdu.yaml"
|
properties:
|
||||||
- type: object
|
sender:
|
||||||
|
type: string
|
||||||
|
description: The user ID of the joining member.
|
||||||
|
example: "@someone:example.org"
|
||||||
|
origin:
|
||||||
|
type: string
|
||||||
|
description: The name of the joining homeserver.
|
||||||
|
example: "matrix.org"
|
||||||
|
origin_server_ts:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
description: A timestamp added by the joining homeserver.
|
||||||
|
example: 1234567890
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
description: The value ``m.room.member``.
|
||||||
|
example: "m.room.member"
|
||||||
|
state_key:
|
||||||
|
type: string
|
||||||
|
description: The user ID of the joining member.
|
||||||
|
example: "@someone:example.org"
|
||||||
|
content:
|
||||||
|
type: object
|
||||||
|
title: Membership Event Content
|
||||||
|
description: The content of the event.
|
||||||
|
example: {"membership": "join"}
|
||||||
properties:
|
properties:
|
||||||
# Note: we override a bunch of parameters to change their descriptions
|
membership:
|
||||||
sender:
|
|
||||||
type: string
|
type: string
|
||||||
description: The user ID of the joining member.
|
description: The value ``join``.
|
||||||
example: "@someone:example.org"
|
example: "join"
|
||||||
origin:
|
required: ['membership']
|
||||||
type: string
|
required:
|
||||||
description: The name of the joining homeserver.
|
- state_key
|
||||||
example: "matrix.org"
|
- sender
|
||||||
origin_server_ts:
|
- origin
|
||||||
type: integer
|
- origin_server_ts
|
||||||
format: int64
|
- type
|
||||||
description: A timestamp added by the joining homeserver.
|
- state_key
|
||||||
example: 1234567890
|
- content
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
description: The value ``m.room.member``.
|
|
||||||
example: "m.room.member"
|
|
||||||
state_key:
|
|
||||||
type: string
|
|
||||||
description: The user ID of the joining member.
|
|
||||||
example: "@someone:example.org"
|
|
||||||
content:
|
|
||||||
type: object
|
|
||||||
title: Membership Event Content
|
|
||||||
description: The content of the event.
|
|
||||||
example: {"membership": "join"}
|
|
||||||
properties:
|
|
||||||
membership:
|
|
||||||
type: string
|
|
||||||
description: The value ``join``.
|
|
||||||
example: "join"
|
|
||||||
required: ['membership']
|
|
||||||
depth:
|
|
||||||
type: integer
|
|
||||||
description: This field must be present but is ignored; it may be 0.
|
|
||||||
example: 12
|
|
||||||
auth_events:
|
|
||||||
type: array
|
|
||||||
description: |-
|
|
||||||
An event reference list containing the authorization events that would
|
|
||||||
allow the member to join the room.
|
|
||||||
items:
|
|
||||||
type: array
|
|
||||||
maxItems: 2
|
|
||||||
minItems: 2
|
|
||||||
items:
|
|
||||||
- type: string
|
|
||||||
title: Event ID
|
|
||||||
example: "$abc123:matrix.org"
|
|
||||||
- type: object
|
|
||||||
title: Event Hash
|
|
||||||
example: {
|
|
||||||
"sha256": "abase64encodedsha256hashshouldbe43byteslong"
|
|
||||||
}
|
|
||||||
properties:
|
|
||||||
sha256:
|
|
||||||
type: string
|
|
||||||
description: The event hash.
|
|
||||||
example: abase64encodedsha256hashshouldbe43byteslong
|
|
||||||
required: ['sha256']
|
|
||||||
redacts:
|
|
||||||
type: string
|
|
||||||
description: Not used.
|
|
||||||
required:
|
|
||||||
# Every other field is already flagged as required by the $ref
|
|
||||||
- state_key
|
|
||||||
example: {
|
example: {
|
||||||
"$ref": "examples/pdu.json",
|
"$ref": "examples/minimal_pdu.json",
|
||||||
"type": "m.room.member",
|
"type": "m.room.member",
|
||||||
"state_key": "@someone:example.org",
|
"state_key": "@someone:example.org",
|
||||||
"content": {
|
"content": {
|
||||||
|
|
@ -315,11 +260,20 @@ paths:
|
||||||
description: The resident server's DNS name.
|
description: The resident server's DNS name.
|
||||||
auth_chain:
|
auth_chain:
|
||||||
type: array
|
type: array
|
||||||
description: The auth chain.
|
description: |-
|
||||||
|
The auth chain. Note that events have a different version depending on
|
||||||
|
the room version - check the `room version specification`_ for precise
|
||||||
|
event formats.
|
||||||
items:
|
items:
|
||||||
type: object
|
type: object
|
||||||
schema:
|
title: PDU
|
||||||
$ref: "definitions/pdu.yaml"
|
description: |-
|
||||||
|
The `PDUs <#pdus>`_ contained in the auth chain. The event format
|
||||||
|
varies depending on the room version - check the `room version specification`_
|
||||||
|
for precise event formats.
|
||||||
|
properties: []
|
||||||
|
example:
|
||||||
|
$ref: "examples/minimal_pdu.json"
|
||||||
state:
|
state:
|
||||||
type: array
|
type: array
|
||||||
description: The room state.
|
description: The room state.
|
||||||
|
|
@ -333,7 +287,7 @@ paths:
|
||||||
200,
|
200,
|
||||||
{
|
{
|
||||||
"origin": "matrix.org",
|
"origin": "matrix.org",
|
||||||
"auth_chain": [{"$ref": "examples/pdu.json"}],
|
"auth_chain": [{"$ref": "examples/minimal_pdu.json"}],
|
||||||
"state": [{"$ref": "examples/pdu.json"}]
|
"state": [{"$ref": "examples/minimal_pdu.json"}]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,11 @@ paths:
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: |-
|
description: |-
|
||||||
A template to be used to call ``/send_leave``.
|
A template to be used to call ``/send_leave``. Note that
|
||||||
|
events have a different version depending on the room version - check the
|
||||||
|
`room version specification`_ for precise event formats. **The response body
|
||||||
|
here describes the common event fields in more detail and may be missing other
|
||||||
|
required fields for a PDU.**
|
||||||
schema:
|
schema:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
|
|
@ -64,92 +68,62 @@ paths:
|
||||||
the room version is assumed to be either "1" or "2".
|
the room version is assumed to be either "1" or "2".
|
||||||
example: "2"
|
example: "2"
|
||||||
event:
|
event:
|
||||||
allOf:
|
description: |-
|
||||||
- $ref: "definitions/unsigned_pdu.yaml"
|
An unsigned template event. Note that events have a different version
|
||||||
- description: |-
|
depending on the room version - check the `room version specification`_
|
||||||
An unsigned template event.
|
for precise event formats.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
sender:
|
||||||
|
type: string
|
||||||
|
description: The user ID of the leaving member.
|
||||||
|
example: "@someone:example.org"
|
||||||
|
origin:
|
||||||
|
type: string
|
||||||
|
description: The name of the resident homeserver.
|
||||||
|
example: "matrix.org"
|
||||||
|
origin_server_ts:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
description: A timestamp added by the resident homeserver.
|
||||||
|
example: 1234567890
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
description: The value ``m.room.member``.
|
||||||
|
example: "m.room.member"
|
||||||
|
state_key:
|
||||||
|
type: string
|
||||||
|
description: The user ID of the leaving member.
|
||||||
|
example: "@someone:example.org"
|
||||||
|
content:
|
||||||
type: object
|
type: object
|
||||||
|
title: Membership Event Content
|
||||||
|
description: The content of the event.
|
||||||
|
example: {"membership": "leave"}
|
||||||
properties:
|
properties:
|
||||||
# Note: we override a bunch of parameters to change their descriptions
|
membership:
|
||||||
sender:
|
|
||||||
type: string
|
type: string
|
||||||
description: The user ID of the leaving member.
|
description: The value ``leave``.
|
||||||
example: "@someone:example.org"
|
example: "leave"
|
||||||
origin:
|
required: ['membership']
|
||||||
type: string
|
required:
|
||||||
description: The name of the resident homeserver.
|
- state_key
|
||||||
example: "matrix.org"
|
- sender
|
||||||
origin_server_ts:
|
- origin
|
||||||
type: integer
|
- origin_server_ts
|
||||||
format: int64
|
- type
|
||||||
description: A timestamp added by the resident homeserver.
|
- state_key
|
||||||
example: 1234567890
|
- content
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
description: The value ``m.room.member``.
|
|
||||||
example: "m.room.member"
|
|
||||||
state_key:
|
|
||||||
type: string
|
|
||||||
description: The user ID of the leaving member.
|
|
||||||
example: "@someone:example.org"
|
|
||||||
content:
|
|
||||||
type: object
|
|
||||||
title: Membership Event Content
|
|
||||||
description: The content of the event.
|
|
||||||
example: {"membership": "leave"}
|
|
||||||
properties:
|
|
||||||
membership:
|
|
||||||
type: string
|
|
||||||
description: The value ``leave``.
|
|
||||||
example: "leave"
|
|
||||||
required: ['membership']
|
|
||||||
auth_events:
|
|
||||||
type: array
|
|
||||||
description: |-
|
|
||||||
An event reference list containing the authorization events that would
|
|
||||||
allow the member to leave the room. This should normally be the
|
|
||||||
``m.room.create``, ``m.room.power_levels``, and ``m.room.join_rules``
|
|
||||||
events.
|
|
||||||
items:
|
|
||||||
type: array
|
|
||||||
maxItems: 2
|
|
||||||
minItems: 2
|
|
||||||
items:
|
|
||||||
- type: string
|
|
||||||
title: Event ID
|
|
||||||
example: "$abc123:matrix.org"
|
|
||||||
- type: object
|
|
||||||
title: Event Hash
|
|
||||||
example: {
|
|
||||||
"sha256": "abase64encodedsha256hashshouldbe43byteslong"
|
|
||||||
}
|
|
||||||
properties:
|
|
||||||
sha256:
|
|
||||||
type: string
|
|
||||||
description: The event hash.
|
|
||||||
example: abase64encodedsha256hashshouldbe43byteslong
|
|
||||||
required: ['sha256']
|
|
||||||
redacts:
|
|
||||||
type: string
|
|
||||||
description: Not used.
|
|
||||||
required:
|
|
||||||
# Every other field is already flagged as required by the $ref
|
|
||||||
- state_key
|
|
||||||
examples:
|
examples:
|
||||||
application/json: {
|
application/json: {
|
||||||
"room_version": "2",
|
"room_version": "2",
|
||||||
"event": {
|
"event": {
|
||||||
"$ref": "examples/unsigned_pdu.json",
|
"$ref": "examples/minimal_pdu.json",
|
||||||
"type": "m.room.member",
|
"type": "m.room.member",
|
||||||
"state_key": "@someone:example.org",
|
"state_key": "@someone:example.org",
|
||||||
"content": {
|
"content": {
|
||||||
"membership": "leave"
|
"membership": "leave"
|
||||||
},
|
}
|
||||||
"auth_events": [
|
|
||||||
["$room_cre4te_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}],
|
|
||||||
["$room_j0in_rul3s_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}],
|
|
||||||
["$room_p0wer_l3vels_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}]
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
403:
|
403:
|
||||||
|
|
@ -167,7 +141,12 @@ paths:
|
||||||
summary: Submit a signed leave event to a resident server
|
summary: Submit a signed leave event to a resident server
|
||||||
description: |-
|
description: |-
|
||||||
Submits a signed leave event to the resident server for it
|
Submits a signed leave event to the resident server for it
|
||||||
to accept it into the room's graph.
|
to accept it into the room's graph. Note that events have
|
||||||
|
a different version depending on the room version - check
|
||||||
|
the `room version specification`_ for precise event formats.
|
||||||
|
**The request and response body here describes the common
|
||||||
|
event fields in more detail and may be missing other required
|
||||||
|
fields for a PDU.**
|
||||||
operationId: sendLeave
|
operationId: sendLeave
|
||||||
security:
|
security:
|
||||||
- signedRequest: []
|
- signedRequest: []
|
||||||
|
|
@ -189,79 +168,54 @@ paths:
|
||||||
type: object
|
type: object
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
type: object
|
||||||
- $ref: "definitions/pdu.yaml"
|
properties:
|
||||||
- type: object
|
sender:
|
||||||
|
type: string
|
||||||
|
description: The user ID of the leaving member.
|
||||||
|
example: "@someone:example.org"
|
||||||
|
origin:
|
||||||
|
type: string
|
||||||
|
description: The name of the leaving homeserver.
|
||||||
|
example: "matrix.org"
|
||||||
|
origin_server_ts:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
description: A timestamp added by the leaving homeserver.
|
||||||
|
example: 1234567890
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
description: The value ``m.room.member``.
|
||||||
|
example: "m.room.member"
|
||||||
|
state_key:
|
||||||
|
type: string
|
||||||
|
description: The user ID of the leaving member.
|
||||||
|
example: "@someone:example.org"
|
||||||
|
content:
|
||||||
|
type: object
|
||||||
|
title: Membership Event Content
|
||||||
|
description: The content of the event.
|
||||||
|
example: {"membership": "leave"}
|
||||||
properties:
|
properties:
|
||||||
# Note: we override a bunch of parameters to change their descriptions
|
membership:
|
||||||
sender:
|
|
||||||
type: string
|
type: string
|
||||||
description: The user ID of the leaving member.
|
description: The value ``leave``.
|
||||||
example: "@someone:example.org"
|
example: "leave"
|
||||||
origin:
|
required: ['membership']
|
||||||
type: string
|
depth:
|
||||||
description: The name of the leaving homeserver.
|
type: integer
|
||||||
example: "matrix.org"
|
description: This field must be present but is ignored; it may be 0.
|
||||||
origin_server_ts:
|
example: 12
|
||||||
type: integer
|
required:
|
||||||
format: int64
|
- state_key
|
||||||
description: A timestamp added by the leaving homeserver.
|
- sender
|
||||||
example: 1234567890
|
- origin
|
||||||
type:
|
- origin_server_ts
|
||||||
type: string
|
- type
|
||||||
description: The value ``m.room.member``.
|
- state_key
|
||||||
example: "m.room.member"
|
- content
|
||||||
state_key:
|
|
||||||
type: string
|
|
||||||
description: The user ID of the leaving member.
|
|
||||||
example: "@someone:example.org"
|
|
||||||
content:
|
|
||||||
type: object
|
|
||||||
title: Membership Event Content
|
|
||||||
description: The content of the event.
|
|
||||||
example: {"membership": "leave"}
|
|
||||||
properties:
|
|
||||||
membership:
|
|
||||||
type: string
|
|
||||||
description: The value ``leave``.
|
|
||||||
example: "leave"
|
|
||||||
required: ['membership']
|
|
||||||
depth:
|
|
||||||
type: integer
|
|
||||||
description: This field must be present but is ignored; it may be 0.
|
|
||||||
example: 12
|
|
||||||
auth_events:
|
|
||||||
type: array
|
|
||||||
description: |-
|
|
||||||
An event reference list containing the authorization events that would
|
|
||||||
allow the member to leave the room.
|
|
||||||
items:
|
|
||||||
type: array
|
|
||||||
maxItems: 2
|
|
||||||
minItems: 2
|
|
||||||
items:
|
|
||||||
- type: string
|
|
||||||
title: Event ID
|
|
||||||
example: "$abc123:matrix.org"
|
|
||||||
- type: object
|
|
||||||
title: Event Hash
|
|
||||||
example: {
|
|
||||||
"sha256": "abase64encodedsha256hashshouldbe43byteslong"
|
|
||||||
}
|
|
||||||
properties:
|
|
||||||
sha256:
|
|
||||||
type: string
|
|
||||||
description: The event hash.
|
|
||||||
example: abase64encodedsha256hashshouldbe43byteslong
|
|
||||||
required: ['sha256']
|
|
||||||
redacts:
|
|
||||||
type: string
|
|
||||||
description: Not used.
|
|
||||||
required:
|
|
||||||
# Every other field is already flagged as required by the $ref
|
|
||||||
- state_key
|
|
||||||
example: {
|
example: {
|
||||||
"$ref": "examples/pdu.json",
|
"$ref": "examples/minimal_pdu.json",
|
||||||
"type": "m.room.member",
|
"type": "m.room.member",
|
||||||
"state_key": "@someone:example.org",
|
"state_key": "@someone:example.org",
|
||||||
"content": {
|
"content": {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,9 @@ paths:
|
||||||
|
|
||||||
The sending server must wait and retry for a 200 OK response before sending a
|
The sending server must wait and retry for a 200 OK response before sending a
|
||||||
transaction with a different ``txnId`` to the receiving server.
|
transaction with a different ``txnId`` to the receiving server.
|
||||||
|
|
||||||
|
Note that events have a different version depending on the room version - check
|
||||||
|
the `room version specification`_ for precise event formats.
|
||||||
operationId: sendTransaction
|
operationId: sendTransaction
|
||||||
security:
|
security:
|
||||||
- signedRequest: []
|
- signedRequest: []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue