Merge branch 'master' into travis/spec/MSC2320-identity-versions
This commit is contained in:
commit
fc6aa30000
62 changed files with 1858 additions and 261 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2018 New Vector Ltd
|
||||
# Copyright 2018, 2021 The Matrix.org Foundation C.I.C.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -69,6 +69,13 @@ properties:
|
|||
avatar_url:
|
||||
type: string
|
||||
description: The URL for the room's avatar, if one is set.
|
||||
join_rule:
|
||||
type: string
|
||||
description: |-
|
||||
The room's join rule. When not present, the room is assumed to
|
||||
be `public`. Note that rooms with `invite` join rules are not
|
||||
expected here, but rooms with `knock` rules are given their
|
||||
near-public nature.
|
||||
next_batch:
|
||||
type: string
|
||||
description: |-
|
||||
|
@ -90,13 +97,14 @@ example: {
|
|||
"chunk": [
|
||||
{
|
||||
"aliases": ["#murrays:cheese.bar"],
|
||||
"avatar_url": "mxc://bleeker.street/CHEDDARandBRIE",
|
||||
"avatar_url": "mxc://bleecker.street/CHEDDARandBRIE",
|
||||
"guest_can_join": false,
|
||||
"name": "CHEESE",
|
||||
"num_joined_members": 37,
|
||||
"room_id": "!ol19s:bleecker.street",
|
||||
"topic": "Tasty tasty cheese",
|
||||
"world_readable": true
|
||||
"world_readable": true,
|
||||
"join_rule": "public"
|
||||
}
|
||||
],
|
||||
"next_batch": "p190q",
|
||||
|
|
124
data/api/client-server/knocking.yaml
Normal file
124
data/api/client-server/knocking.yaml
Normal file
|
@ -0,0 +1,124 @@
|
|||
# Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
swagger: '2.0'
|
||||
info:
|
||||
title: "Matrix Client-Server Room Knocking 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:
|
||||
"/knock/{roomIdOrAlias}":
|
||||
post:
|
||||
summary: Knock on a room, requesting permission to join.
|
||||
description: |-
|
||||
*Note that this API takes either a room ID or alias, unlike other membership APIs.*
|
||||
|
||||
This API "knocks" on the room to ask for permission to join, if the user
|
||||
is allowed to knock on the room. Acceptance of the knock happens out of
|
||||
band from this API, meaning that the client will have to watch for updates
|
||||
regarding the acceptance/rejection of the knock.
|
||||
|
||||
If the room history settings allow, the user will still be able to see
|
||||
history of the room while being in the "knock" state. The user will have
|
||||
to accept the invitation to join the room (acceptance of knock) to see
|
||||
messages reliably. See the `/join` endpoints for more information about
|
||||
history visibility to the user.
|
||||
|
||||
The knock will appear as an entry in the response of the
|
||||
[`/sync`](/client-server-api/#get_matrixclientr0sync) API.
|
||||
operationId: knockRoom
|
||||
security:
|
||||
- accessToken: []
|
||||
parameters:
|
||||
- in: path
|
||||
type: string
|
||||
name: roomIdOrAlias
|
||||
description: The room identifier or alias to knock upon.
|
||||
required: true
|
||||
x-example: "#monkeys:matrix.org"
|
||||
- in: query
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
name: server_name
|
||||
description: |-
|
||||
The servers to attempt to knock on the room through. One of the servers
|
||||
must be participating in the room.
|
||||
x-example: ["matrix.org", "elsewhere.ca"]
|
||||
- in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
reason:
|
||||
type: string
|
||||
description: |-
|
||||
Optional reason to be included as the `reason` on the subsequent
|
||||
membership event.
|
||||
example: "Looking for support"
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
The room has been knocked upon.
|
||||
|
||||
The knocked room ID must be returned in the `room_id` field.
|
||||
examples:
|
||||
application/json: {
|
||||
"room_id": "!d41d8cd:matrix.org"
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
room_id:
|
||||
type: string
|
||||
description: The knocked room ID.
|
||||
required: ["room_id"]
|
||||
403:
|
||||
description: |-
|
||||
You do not have permission to knock on the room. A meaningful `errcode`
|
||||
and description error text will be returned. Example reasons for rejection are:
|
||||
|
||||
- The room is not set up for knocking.
|
||||
- The user has been banned from the room.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN", "error": "You are not allowed to knock on this room."
|
||||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
404:
|
||||
description: |-
|
||||
The room could not be found or resolved to a room ID.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND", "error": "That room does not appear to exist."
|
||||
}
|
||||
schema:
|
||||
"$ref": "definitions/errors/error.yaml"
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
"$ref": "definitions/errors/rate_limited.yaml"
|
||||
tags:
|
||||
- Room membership
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2016 OpenMarket Ltd
|
||||
# Copyright 2016, 2021 The Matrix.org Foundation C.I.C.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -281,6 +281,28 @@ paths:
|
|||
items:
|
||||
$ref: "../../event-schemas/schema/stripped_state.yaml"
|
||||
type: array
|
||||
knock:
|
||||
title: Knocked rooms
|
||||
type: object
|
||||
description: |-
|
||||
The rooms that the user has knocked upon, mapped as room ID to room information.
|
||||
additionalProperties:
|
||||
title: Knocked Room
|
||||
type: object
|
||||
properties:
|
||||
knock_state:
|
||||
title: KnockState
|
||||
type: object
|
||||
description: |-
|
||||
The state of a room that the user has knocked upon. The state
|
||||
events contained here have the same restrictions as `InviteState`
|
||||
above.
|
||||
properties:
|
||||
events:
|
||||
description: The StrippedState events that form the knock state.
|
||||
items:
|
||||
$ref: "../../event-schemas/schema/stripped_state.yaml"
|
||||
type: array
|
||||
leave:
|
||||
title: Left rooms
|
||||
type: object
|
||||
|
@ -436,6 +458,26 @@ paths:
|
|||
}
|
||||
}
|
||||
},
|
||||
"knock": {
|
||||
"!223asd456:example.com": {
|
||||
"invite_state": {
|
||||
"events": [
|
||||
{
|
||||
"sender": "@alice:example.com",
|
||||
"type": "m.room.name",
|
||||
"state_key": "",
|
||||
"content": {"name": "My Room Name"}
|
||||
},
|
||||
{
|
||||
"sender": "@bob:example.com",
|
||||
"type": "m.room.member",
|
||||
"state_key": "@bob:example.com",
|
||||
"content": {"membership": "knock"}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"leave": {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ allOf:
|
|||
sender:
|
||||
type: string
|
||||
description: User ID of the sender.
|
||||
example: "john@example.com"
|
||||
example: "@john:example.com"
|
||||
type:
|
||||
type: string
|
||||
description: Event type for the message.
|
||||
|
@ -59,7 +59,7 @@ allOf:
|
|||
title: Device Message Contents
|
||||
properties: {}
|
||||
example: {
|
||||
"alice@example.org": {
|
||||
"@alice:example.org": {
|
||||
"IWHQUZUIAH": {
|
||||
"algorithm": "m.megolm.v1.aes-sha2",
|
||||
"room_id": "!Cuyf34gef24t:localhost",
|
||||
|
|
322
data/api/server-server/knocks.yaml
Normal file
322
data/api/server-server/knocks.yaml
Normal file
|
@ -0,0 +1,322 @@
|
|||
# Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||
#
|
||||
# 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 Knock Room API"
|
||||
version: "1.0.0"
|
||||
host: localhost:8448
|
||||
schemes:
|
||||
- https
|
||||
basePath: /_matrix/federation/v1
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
securityDefinitions:
|
||||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/make_knock/{roomId}/{userId}":
|
||||
get:
|
||||
summary: Get information required to make a knock event for a room.
|
||||
description: |-
|
||||
Asks the receiving server to return information that the sending
|
||||
server will need to prepare a knock event for the room.
|
||||
operationId: makeKnock
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
type: string
|
||||
description: The room ID that is about to be knocked.
|
||||
required: true
|
||||
x-example: "!abc123:example.org"
|
||||
- in: path
|
||||
name: userId
|
||||
type: string
|
||||
description: The user ID the knock event will be for.
|
||||
required: true
|
||||
x-example: "@someone:example.org"
|
||||
- in: query
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
name: ver
|
||||
description: |-
|
||||
The room versions the sending server has support for.
|
||||
required: true # knocking was supported in v7
|
||||
x-example: ["1", "7"]
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
A template to be used for the rest of the [Knocking Rooms](/server-server-api/#knocking-rooms)
|
||||
handshake. Note that events have a different format depending on room version - check the
|
||||
[room version specification](/#room-versions) 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:
|
||||
type: object
|
||||
properties:
|
||||
room_version:
|
||||
type: string
|
||||
description: |-
|
||||
The version of the room where the server is trying to knock.
|
||||
example: "7"
|
||||
event:
|
||||
description: |-
|
||||
An unsigned template event. Note that events have a different format
|
||||
depending on the room version - check the [room version specification](/#room-versions)
|
||||
for precise event formats.
|
||||
type: object
|
||||
title: Event Template
|
||||
properties:
|
||||
sender:
|
||||
type: string
|
||||
description: The user ID of the knocking 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 knocking member.
|
||||
example: "@someone:example.org"
|
||||
content:
|
||||
type: object
|
||||
title: Membership Event Content
|
||||
description: The content of the event.
|
||||
example: {"membership": "knock"}
|
||||
properties:
|
||||
membership:
|
||||
type: string
|
||||
description: The value `knock`.
|
||||
example: "knock"
|
||||
required: ['membership']
|
||||
required:
|
||||
- state_key
|
||||
- origin
|
||||
- origin_server_ts
|
||||
- type
|
||||
- content
|
||||
- sender
|
||||
required:
|
||||
- room_version # knocking was added in v7
|
||||
- event
|
||||
examples:
|
||||
application/json: {
|
||||
"room_version": "7",
|
||||
"event": {
|
||||
"$ref": "examples/minimal_pdu.json",
|
||||
"type": "m.room.member",
|
||||
"state_key": "@someone:example.org",
|
||||
"origin": "example.org",
|
||||
"origin_server_ts": 1549041175876,
|
||||
"sender": "@someone:example.org",
|
||||
"content": {
|
||||
"membership": "knock"
|
||||
}
|
||||
}
|
||||
}
|
||||
400:
|
||||
description: |-
|
||||
The request is invalid or the room the server is attempting
|
||||
to knock upon has a version that is not listed in the `ver`
|
||||
parameters.
|
||||
|
||||
The error should be passed through to clients so that they
|
||||
may give better feedback to users.
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: "../client-server/definitions/errors/error.yaml"
|
||||
- type: object
|
||||
properties:
|
||||
room_version:
|
||||
type: string
|
||||
description: |-
|
||||
The version of the room. Required if the `errcode`
|
||||
is `M_INCOMPATIBLE_ROOM_VERSION`.
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_INCOMPATIBLE_ROOM_VERSION",
|
||||
"error": "Your homeserver does not support the features required to knock on this room",
|
||||
"room_version": "7"
|
||||
}
|
||||
404:
|
||||
description: |-
|
||||
The room that the knocking server is attempting to knock upon is unknown
|
||||
to the receiving server.
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: "../client-server/definitions/errors/error.yaml"
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND",
|
||||
"error": "Unknown room",
|
||||
}
|
||||
403:
|
||||
description: |-
|
||||
The knocking server or user is not permitted to knock on the room, such as when the
|
||||
server/user is banned or the room is not set up for receiving knocks.
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: "../client-server/definitions/errors/error.yaml"
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "You are not permitted to knock on this room",
|
||||
}
|
||||
|
||||
"/send_knock/{roomId}/{eventId}":
|
||||
put:
|
||||
summary: Submit a signed knock event to a resident server.
|
||||
description: |-
|
||||
Submits a signed knock event to the resident server for it to
|
||||
accept into the room's graph. Note that events have
|
||||
a different format depending on the room version - check
|
||||
the [room version specification](/#room-versions) for precise event formats.
|
||||
**The request and response body here describe the common
|
||||
event fields in more detail and may be missing other required
|
||||
fields for a PDU.**
|
||||
operationId: sendKnock
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: roomId
|
||||
type: string
|
||||
description: The room ID that is about to be knocked upon.
|
||||
required: true
|
||||
x-example: "!abc123:example.org"
|
||||
- in: path
|
||||
name: eventId
|
||||
type: string
|
||||
description: The event ID for the knock event.
|
||||
required: true
|
||||
x-example: "$abc123:example.org"
|
||||
- in: body
|
||||
name: body
|
||||
type: object
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
sender:
|
||||
type: string
|
||||
description: The user ID of the knocking member.
|
||||
example: "@someone:example.org"
|
||||
origin:
|
||||
type: string
|
||||
description: The name of the knocking homeserver.
|
||||
example: "matrix.org"
|
||||
origin_server_ts:
|
||||
type: integer
|
||||
format: int64
|
||||
description: A timestamp added by the knocking 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 knocking member.
|
||||
example: "@someone:example.org"
|
||||
content:
|
||||
type: object
|
||||
title: Membership Event Content
|
||||
description: The content of the event.
|
||||
example: {"membership": "knock"}
|
||||
properties:
|
||||
membership:
|
||||
type: string
|
||||
description: The value `knock`.
|
||||
example: "knock"
|
||||
required: ['membership']
|
||||
required:
|
||||
- state_key
|
||||
- sender
|
||||
- origin
|
||||
- origin_server_ts
|
||||
- type
|
||||
- content
|
||||
example: {
|
||||
"$ref": "examples/minimal_pdu.json",
|
||||
"type": "m.room.member",
|
||||
"state_key": "@someone:example.org",
|
||||
"origin": "example.org",
|
||||
"origin_server_ts": 1549041175876,
|
||||
"sender": "@someone:example.org",
|
||||
"content": {
|
||||
"membership": "knock"
|
||||
}
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: |-
|
||||
Information about the room to pass along to clients regarding the
|
||||
knock.
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
knock_room_state:
|
||||
type: array
|
||||
items:
|
||||
$ref: "../../event-schemas/schema/stripped_state.yaml"
|
||||
description: |-
|
||||
A list of simplified events to help the initiator of the knock identify
|
||||
the room. The recommended events to include are the join rules, canonical
|
||||
alias, avatar, name, and encryption state of the room.
|
||||
example:
|
||||
$ref: "../../event-schemas/examples/knock_room_state.json"
|
||||
required: ['knock_room_state']
|
||||
examples:
|
||||
application/json: {
|
||||
"knock_room_state": {"$ref": "../../event-schemas/examples/knock_room_state.json"}
|
||||
}
|
||||
404:
|
||||
description: |-
|
||||
The room that the knocking server is attempting to knock upon is unknown
|
||||
to the receiving server.
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: "../client-server/definitions/errors/error.yaml"
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND",
|
||||
"error": "Unknown room",
|
||||
}
|
||||
403:
|
||||
description: |-
|
||||
The knocking server or user is not permitted to knock on the room, such as when the
|
||||
server/user is banned or the room is not set up for receiving knocks.
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: "../client-server/definitions/errors/error.yaml"
|
||||
examples:
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "You are not permitted to knock on this room",
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2018 New Vector Ltd
|
||||
# Copyright 2018, 2021 The Matrix.org Foundation C.I.C.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -193,6 +193,13 @@ paths:
|
|||
avatar_url:
|
||||
type: string
|
||||
description: The URL for the room's avatar, if one is set.
|
||||
join_rule:
|
||||
type: string
|
||||
description: |-
|
||||
The room's join rule. When not present, the room is assumed to
|
||||
be `public`. Note that rooms with `invite` join rules are not
|
||||
expected here, but rooms with `knock` rules are given their
|
||||
near-public nature.
|
||||
next_batch:
|
||||
type: string
|
||||
description: |-
|
||||
|
@ -215,13 +222,14 @@ paths:
|
|||
"chunk": [
|
||||
{
|
||||
"aliases": ["#murrays:cheese.bar"],
|
||||
"avatar_url": "mxc://bleeker.street/CHEDDARandBRIE",
|
||||
"avatar_url": "mxc://bleecker.street/CHEDDARandBRIE",
|
||||
"guest_can_join": false,
|
||||
"name": "CHEESE",
|
||||
"num_joined_members": 37,
|
||||
"room_id": "!ol19s:bleecker.street",
|
||||
"topic": "Tasty tasty cheese",
|
||||
"world_readable": true
|
||||
"world_readable": true,
|
||||
"join_rule": "public"
|
||||
}
|
||||
],
|
||||
"next_batch": "p190q",
|
||||
|
|
18
data/event-schemas/examples/knock_room_state.json
Normal file
18
data/event-schemas/examples/knock_room_state.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
[
|
||||
{
|
||||
"type": "m.room.name",
|
||||
"sender": "@bob:example.org",
|
||||
"state_key": "",
|
||||
"content": {
|
||||
"name": "Example Room"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "m.room.join_rules",
|
||||
"sender": "@bob:example.org",
|
||||
"state_key": "",
|
||||
"content": {
|
||||
"join_rule": "knock"
|
||||
}
|
||||
}
|
||||
]
|
6
data/event-schemas/examples/m.key.verification.done.yaml
Normal file
6
data/event-schemas/examples/m.key.verification.done.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"type": "m.key.verification.done",
|
||||
"content": {
|
||||
"transaction_id": "S0meUniqueAndOpaqueString"
|
||||
}
|
||||
}
|
10
data/event-schemas/examples/m.key.verification.ready.yaml
Normal file
10
data/event-schemas/examples/m.key.verification.ready.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"type": "m.key.verification.ready",
|
||||
"content": {
|
||||
"from_device": "BobDevice1",
|
||||
"transaction_id": "S0meUniqueAndOpaqueString",
|
||||
"methods": [
|
||||
"m.sas.v1"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"$ref": "m.room.member.yaml",
|
||||
"content": {
|
||||
"membership": "knock",
|
||||
"avatar_url": "mxc://example.org/SEsfnsuifSDFSSEF",
|
||||
"displayname": "Alice Margatroid",
|
||||
"reason": "Looking for support"
|
||||
},
|
||||
"unsigned": {
|
||||
"age": 1234,
|
||||
"knock_room_state": {
|
||||
"$ref": "knock_room_state.json"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,16 +3,16 @@ allOf:
|
|||
- $ref: core-event-schema/event.yaml
|
||||
|
||||
description: |-
|
||||
Accepts a previously sent `m.key.verification.start` message. Typically sent as a
|
||||
[to-device](/client-server-api/#send-to-device-messaging) event.
|
||||
Accepts a previously sent `m.key.verification.start` message.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
An opaque identifier for the verification process. Must be the same as
|
||||
the one used for the `m.key.verification.start` message.
|
||||
Required when sent as a to-device message. An opaque identifier for
|
||||
the verification process. Must be the same as the one used for the
|
||||
`m.key.verification.start` message.
|
||||
key_agreement_protocol:
|
||||
type: string
|
||||
description: |-
|
||||
|
@ -43,8 +43,10 @@ properties:
|
|||
The hash (encoded as unpadded base64) of the concatenation of the device's
|
||||
ephemeral public key (encoded as unpadded base64) and the canonical JSON
|
||||
representation of the `m.key.verification.start` message.
|
||||
m.relates_to:
|
||||
allOf:
|
||||
- $ref: m.key.verification.m.relates_to.yaml
|
||||
required:
|
||||
- transaction_id
|
||||
- method
|
||||
- key_agreement_protocol
|
||||
- hash
|
||||
|
|
|
@ -3,14 +3,15 @@ allOf:
|
|||
- $ref: core-event-schema/event.yaml
|
||||
|
||||
description: |-
|
||||
Cancels a key verification process/request. Typically sent as a [to-device](/client-server-api/#send-to-device-messaging) event.
|
||||
Cancels a key verification process/request.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
The opaque identifier for the verification process/request.
|
||||
Required when sent as a to-device message. The opaque identifier for
|
||||
the verification process/request.
|
||||
reason:
|
||||
type: string
|
||||
description: |-
|
||||
|
@ -56,8 +57,10 @@ properties:
|
|||
gets an unexpected response with `m.unexpected_message`, the client should not
|
||||
respond again with `m.unexpected_message` to avoid the other device potentially
|
||||
sending another error response.
|
||||
m.relates_to:
|
||||
allOf:
|
||||
- $ref: m.key.verification.m.relates_to.yaml
|
||||
required:
|
||||
- transaction_id
|
||||
- code
|
||||
- reason
|
||||
type: object
|
||||
|
|
23
data/event-schemas/schema/m.key.verification.done.yaml
Normal file
23
data/event-schemas/schema/m.key.verification.done.yaml
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
allOf:
|
||||
- $ref: core-event-schema/event.yaml
|
||||
|
||||
description: |-
|
||||
Indicates that a verification process/request has completed successfully.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
Required when sent as a to-device message. The opaque identifier for
|
||||
the verification process/request.
|
||||
m.relates_to:
|
||||
allOf:
|
||||
- $ref: m.key.verification.m.relates_to.yaml
|
||||
type: object
|
||||
type:
|
||||
enum:
|
||||
- m.key.verification.done
|
||||
type: string
|
||||
type: object
|
|
@ -3,22 +3,24 @@ allOf:
|
|||
- $ref: core-event-schema/event.yaml
|
||||
|
||||
description: |-
|
||||
Sends the ephemeral public key for a device to the partner device. Typically sent as a
|
||||
[to-device](/client-server-api/#send-to-device-messaging) event.
|
||||
Sends the ephemeral public key for a device to the partner device.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
An opaque identifier for the verification process. Must be the same as
|
||||
the one used for the `m.key.verification.start` message.
|
||||
Required when sent as a to-device message. An opaque identifier for
|
||||
the verification process. Must be the same as the one used for the
|
||||
`m.key.verification.start` message.
|
||||
key:
|
||||
type: string
|
||||
description: |-
|
||||
The device's ephemeral public key, encoded as unpadded base64.
|
||||
m.relates_to:
|
||||
allOf:
|
||||
- $ref: m.key.verification.m.relates_to.yaml
|
||||
required:
|
||||
- transaction_id
|
||||
- key
|
||||
type: object
|
||||
type:
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
description: |-
|
||||
Required when sent as an in-room message. Indicates the
|
||||
`m.key.verification.request` that this message is related to. Note that for
|
||||
encrypted messages, this property should be in the unencrypted portion of the
|
||||
event.
|
||||
properties:
|
||||
rel_type:
|
||||
type: string
|
||||
enum:
|
||||
- m.reference
|
||||
description: |-
|
||||
The relationship type.
|
||||
event_id:
|
||||
type: string
|
||||
description: |-
|
||||
The event ID of the `m.key.verification.request` that this message is
|
||||
related to.
|
||||
type: object
|
||||
type: object
|
||||
title: VerificationRelatesTo
|
|
@ -3,16 +3,16 @@ allOf:
|
|||
- $ref: core-event-schema/event.yaml
|
||||
|
||||
description: |-
|
||||
Sends the MAC of a device's key to the partner device. Typically sent as a
|
||||
[to-device](/client-server-api/#send-to-device-messaging) event.
|
||||
Sends the MAC of a device's key to the partner device.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
An opaque identifier for the verification process. Must be the same as
|
||||
the one used for the `m.key.verification.start` message.
|
||||
Required when sent as a to-device message. An opaque identifier for
|
||||
the verification process. Must be the same as the one used for the
|
||||
`m.key.verification.start` message.
|
||||
mac:
|
||||
type: object
|
||||
description: |-
|
||||
|
@ -26,8 +26,10 @@ properties:
|
|||
description: |-
|
||||
The MAC of the comma-separated, sorted, list of key IDs given in the `mac`
|
||||
property, encoded as unpadded base64.
|
||||
m.relates_to:
|
||||
allOf:
|
||||
- $ref: m.key.verification.m.relates_to.yaml
|
||||
required:
|
||||
- transaction_id
|
||||
- mac
|
||||
- keys
|
||||
type: object
|
||||
|
|
40
data/event-schemas/schema/m.key.verification.ready.yaml
Normal file
40
data/event-schemas/schema/m.key.verification.ready.yaml
Normal file
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
allOf:
|
||||
- $ref: core-event-schema/event.yaml
|
||||
|
||||
description: |-
|
||||
Accepts a key verification request. Sent in response to an
|
||||
`m.key.verification.request` event.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
from_device:
|
||||
type: string
|
||||
description: |-
|
||||
The device ID which is accepting the request.
|
||||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
Required when sent as a to-device message. The transaction ID of the
|
||||
verification request, as given in the `m.key.verification.request`
|
||||
message.
|
||||
methods:
|
||||
type: array
|
||||
description: |-
|
||||
The verification methods supported by the sender, corresponding to
|
||||
the verification methods indicated in the
|
||||
`m.key.verification.request` message.
|
||||
items:
|
||||
type: string
|
||||
m.relates_to:
|
||||
allOf:
|
||||
- $ref: m.key.verification.m.relates_to.yaml
|
||||
required:
|
||||
- from_device
|
||||
- methods
|
||||
type: object
|
||||
type:
|
||||
enum:
|
||||
- m.key.verification.ready
|
||||
type: string
|
||||
type: object
|
|
@ -3,8 +3,7 @@ allOf:
|
|||
- $ref: core-event-schema/event.yaml
|
||||
|
||||
description: |-
|
||||
Requests a key verification with another user's devices. Typically sent as a
|
||||
[to-device](/client-server-api/#send-to-device-messaging) event.
|
||||
Requests a key verification with another user's devices.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
|
@ -15,8 +14,9 @@ properties:
|
|||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
An opaque identifier for the verification request. Must be unique
|
||||
with respect to the devices involved.
|
||||
Required when sent as a to-device message. An opaque identifier for
|
||||
the verification request. Must be unique with respect to the devices
|
||||
involved.
|
||||
methods:
|
||||
type: array
|
||||
description: |-
|
||||
|
@ -27,14 +27,13 @@ properties:
|
|||
type: integer
|
||||
format: int64
|
||||
description: |-
|
||||
The POSIX timestamp in milliseconds for when the request was made. If
|
||||
the request is in the future by more than 5 minutes or more than 10
|
||||
minutes in the past, the message should be ignored by the receiver.
|
||||
Required when sent as a to-device message. The POSIX timestamp in
|
||||
milliseconds for when the request was made. If the request is in the
|
||||
future by more than 5 minutes or more than 10 minutes in the past,
|
||||
the message should be ignored by the receiver.
|
||||
required:
|
||||
- from_device
|
||||
- transaction_id
|
||||
- methods
|
||||
- timestamp
|
||||
type: object
|
||||
type:
|
||||
enum:
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
allOf:
|
||||
- $ref: core-event-schema/event.yaml
|
||||
|
||||
description: |-
|
||||
Begins a key verification process using the `m.reciprocate.v1` method, after
|
||||
scanning a QR code.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
from_device:
|
||||
type: string
|
||||
description: |-
|
||||
The device ID which is initiating the process.
|
||||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
Required when sent as a to-device message. An opaque identifier for
|
||||
the verification process. Must be unique with respect to the devices
|
||||
involved. Must be the same as the `transaction_id` given in the
|
||||
`m.key.verification.request` if this process is originating from a
|
||||
request.
|
||||
method:
|
||||
type: string
|
||||
enum: ["m.reciprocate.v1"]
|
||||
description: |-
|
||||
The verification method to use.
|
||||
secret:
|
||||
type: string
|
||||
description: |-
|
||||
The shared secret from the QR code, encoded using unpadded base64.
|
||||
m.relates_to:
|
||||
allOf:
|
||||
- $ref: m.key.verification.m.relates_to.yaml
|
||||
required:
|
||||
- from_device
|
||||
- method
|
||||
- secret
|
||||
type: object
|
||||
type:
|
||||
enum:
|
||||
- m.key.verification.start
|
||||
type: string
|
||||
type: object
|
|
@ -3,7 +3,7 @@ allOf:
|
|||
- $ref: core-event-schema/event.yaml
|
||||
|
||||
description: |-
|
||||
Begins a SAS key verification process using the `m.sas.v1` method. Typically sent as a [to-device](/client-server-api/#send-to-device-messaging) event.
|
||||
Begins a SAS key verification process using the `m.sas.v1` method.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
|
@ -14,10 +14,11 @@ properties:
|
|||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
An opaque identifier for the verification process. Must be unique
|
||||
with respect to the devices involved. Must be the same as the
|
||||
`transaction_id` given in the `m.key.verification.request`
|
||||
if this process is originating from a request.
|
||||
Required when sent as a to-device message. An opaque identifier for
|
||||
the verification process. Must be unique with respect to the devices
|
||||
involved. Must be the same as the `transaction_id` given in the
|
||||
`m.key.verification.request` if this process is originating from a
|
||||
request.
|
||||
method:
|
||||
type: string
|
||||
enum: ["m.sas.v1"]
|
||||
|
@ -53,9 +54,11 @@ properties:
|
|||
items:
|
||||
type: string
|
||||
enum: ["decimal", "emoji"]
|
||||
m.relates_to:
|
||||
allOf:
|
||||
- $ref: m.key.verification.m.relates_to.yaml
|
||||
required:
|
||||
- from_device
|
||||
- transaction_id
|
||||
- method
|
||||
- key_agreement_protocols
|
||||
- hashes
|
||||
|
|
|
@ -16,10 +16,11 @@ properties:
|
|||
transaction_id:
|
||||
type: string
|
||||
description: |-
|
||||
An opaque identifier for the verification process. Must be unique
|
||||
with respect to the devices involved. Must be the same as the
|
||||
`transaction_id` given in the `m.key.verification.request`
|
||||
if this process is originating from a request.
|
||||
Required when sent as a to-device message. An opaque identifier for
|
||||
the verification process. Must be unique with respect to the devices
|
||||
involved. Must be the same as the `transaction_id` given in the
|
||||
`m.key.verification.request` if this process is originating from a
|
||||
request.
|
||||
method:
|
||||
type: string
|
||||
description: |-
|
||||
|
@ -30,9 +31,11 @@ properties:
|
|||
Optional method to use to verify the other user's key with. Applicable
|
||||
when the `method` chosen only verifies one user's key. This field will
|
||||
never be present if the `method` verifies keys both ways.
|
||||
m.relates_to:
|
||||
allOf:
|
||||
- $ref: m.key.verification.m.relates_to.yaml
|
||||
required:
|
||||
- from_device
|
||||
- transaction_id
|
||||
- method
|
||||
type: object
|
||||
type:
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
---
|
||||
allOf:
|
||||
- $ref: core-event-schema/state_event.yaml
|
||||
description: 'A room may be `public` meaning anyone can join the room without any prior action. Alternatively, it can be `invite` meaning that a user who wishes to join the room must first receive an invite to the room from someone already inside of the room. Currently, `knock` and `private` are reserved keywords which are not implemented.'
|
||||
description: |
|
||||
A room may be `public` meaning anyone can join the room without any prior action.
|
||||
Alternatively, it can be `invite` meaning that a user who wishes to join the room
|
||||
must first receive an invite to the room from someone already inside of the room.
|
||||
`knock` means that users are able to ask for permission to join the room, where
|
||||
they are either allowed (invited) or denied (kicked/banned) access. Join rules
|
||||
of `knock` are otherwise the same as `invite`: the user needs an explicit invite
|
||||
to join the room.
|
||||
|
||||
Currently, `private` is a reserved keyword which is not implemented.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
|
|
|
@ -14,7 +14,7 @@ description: |-
|
|||
|
||||
- `ban` - The user has been banned from the room, and is no longer allowed to join it until they are un-banned from the room (by having their membership state set to a value other than `ban`).
|
||||
|
||||
- `knock` - This is a reserved word, which currently has no meaning.
|
||||
- `knock` - The user has knocked on the room, requesting permission to participate. They may not participate in the room until they join.
|
||||
|
||||
The `third_party_invite` property will be set if this invite is an `invite` event and is the successor of an `m.room.third_party_invite` event, and absent otherwise.
|
||||
|
||||
|
@ -31,13 +31,13 @@ description: |-
|
|||
from the `prev_content` object on an event. If not present, the user's previous membership must be assumed
|
||||
as `leave`.
|
||||
|
||||
| | to `invite` | to `join` | to `leave` | to `ban` | to `knock` |
|
||||
|-------------------|---------------------|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|------------------|
|
||||
| **from `invite`** | No change. | User joined the room. | If the `state_key` is the same as the `sender`, the user rejected the invite. Otherwise, the `state_key` user had their invite revoked. | User was banned. | Not implemented. |
|
||||
| **from `join`** |Must never happen. | `displayname` or `avatar_url` changed. | If the `state_key` is the same as the `sender`, the user left. Otherwise, the `state_key` user was kicked. | User was kicked and banned. | Not implemented. |
|
||||
| **from `leave`** |New invitation sent. | User joined. | No change. | User was banned. | Not implemented. |
|
||||
| **from `ban`** |Must never happen. | Must never happen. | User was unbanned. | No change. | Not implemented. |
|
||||
| **from `knock`** |Not implemented. | Not implemented. | Not implemented. | Not implemented. | Not implemented. |
|
||||
| | to `invite` | to `join` | to `leave` | to `ban` | to `knock` |
|
||||
|-------------------|----------------------|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|--------------------|
|
||||
| **from `invite`** | No change. | User joined the room. | If the `state_key` is the same as the `sender`, the user rejected the invite. Otherwise, the `state_key` user had their invite revoked. | User was banned. | Must never happen. |
|
||||
| **from `join`** | Must never happen. | `displayname` or `avatar_url` changed. | If the `state_key` is the same as the `sender`, the user left. Otherwise, the `state_key` user was kicked. | User was kicked and banned. | Must never happen. |
|
||||
| **from `leave`** | New invitation sent. | User joined. | No change. | User was banned. | User is knocking. |
|
||||
| **from `ban`** | Must never happen. | Must never happen. | User was unbanned. | No change. | Must never happen. |
|
||||
| **from `knock`** | Knock accepted. | Must never happen. | If the `state_key` is the same as the `sender`, the user retracted the knock. Otherwise, the `state_key` user had their knock denied. | User was banned. | No change. |
|
||||
|
||||
properties:
|
||||
content:
|
||||
|
@ -124,7 +124,24 @@ properties:
|
|||
- type: object
|
||||
properties:
|
||||
invite_room_state:
|
||||
description: 'A subset of the state of the room at the time of the invite, if `membership` is `invite`. Note that this state is informational, and SHOULD NOT be trusted; once the client has joined the room, it SHOULD fetch the live state from the server and discard the invite_room_state. Also, clients must not rely on any particular state being present here; they SHOULD behave properly (with possibly a degraded but not a broken experience) in the absence of any particular events here. If they are set on the room, at least the state for `m.room.avatar`, `m.room.canonical_alias`, `m.room.join_rules`, and `m.room.name` SHOULD be included.'
|
||||
description: |-
|
||||
A subset of the state of the room at the time of the invite, if `membership` is `invite`.
|
||||
Note that this state is informational, and SHOULD NOT be trusted; once the client has
|
||||
joined the room, it SHOULD fetch the live state from the server and discard the
|
||||
invite_room_state. Also, clients must not rely on any particular state being present here;
|
||||
they SHOULD behave properly (with possibly a degraded but not a broken experience) in
|
||||
the absence of any particular events here. If they are set on the room, at least the
|
||||
state for `m.room.avatar`, `m.room.canonical_alias`, `m.room.join_rules`, and `m.room.name`
|
||||
SHOULD be included.
|
||||
items:
|
||||
$ref: "stripped_state.yaml"
|
||||
type: array
|
||||
knock_room_state:
|
||||
description: |-
|
||||
A subset of the state of the room at the time of the knock, if `membership` is `knock`.
|
||||
This has the same restrictions as `invite_room_state`. If they are set on the room, at least
|
||||
the state for `m.room.avatar`, `m.room.canonical_alias`, `m.room.join_rules`, `m.room.name`,
|
||||
and `m.room.encryption` SHOULD be included.
|
||||
items:
|
||||
$ref: "stripped_state.yaml"
|
||||
type: array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue