Merge pull request #1648 from matrix-org/matthew/device_list_update
document device list synchronisation over federation.pull/977/head
commit
6dab4b28f8
@ -0,0 +1,89 @@
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
type: object
|
||||
title: m.device_list_update
|
||||
description: |-
|
||||
An EDU that lets servers push details to each other when one of their users
|
||||
adds a new device to their account, required for E2E encryption to correctly
|
||||
target the current set of devices for a given user.
|
||||
|
||||
# FIXME: It's very unclear why we have this API surface for synchronising
|
||||
# device lists, rather than just using a room (which could also be used for
|
||||
# presence lists, profile info, etc). But documenting what we have for now...
|
||||
|
||||
allOf:
|
||||
- $ref: ../edu.yaml
|
||||
- type: object
|
||||
properties:
|
||||
edu_type:
|
||||
type: enum
|
||||
enum: ['m.device_list_update']
|
||||
description: The string ``m.device_list_update``.
|
||||
example: "m.device_list_update"
|
||||
content:
|
||||
type: object
|
||||
description: The description of the device whose details has changed.
|
||||
title: Device List Update
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
description: The user ID who owns this device.
|
||||
example: "@john:example.com"
|
||||
device_id:
|
||||
type: string
|
||||
description: The ID of the device whose details are changing.
|
||||
example: "QBUAZIFURK"
|
||||
device_display_name:
|
||||
type: string
|
||||
description: |-
|
||||
The public human-readable name of this device. Will be absent
|
||||
if the device has no name.
|
||||
example: "Mobile"
|
||||
stream_id:
|
||||
type: integer
|
||||
description: |-
|
||||
An ID sent by the server for this update, unique for a given
|
||||
user_id. Used to identify any gaps in the sequence of ``m.device_list_update``
|
||||
EDUs broadcast by a server.
|
||||
example: 6
|
||||
prev_id:
|
||||
type: array
|
||||
description: |-
|
||||
The stream_ids of any prior m.device_list_update EDUs sent for this user
|
||||
which have not been referred to already in an EDU's prev_id field. If the
|
||||
receiving server does not recognise any of the prev_ids, it means an EDU
|
||||
has been lost and the server should query a snapshot of the device list
|
||||
via ``/user/keys/query`` in order to correctly interpret future ``m.device_list_update``
|
||||
EDUs. May be missing or empty for the first EDU in a sequence.
|
||||
items:
|
||||
type: integer
|
||||
description: |-
|
||||
The stream_id of a prior EDU in this sequence which has not been referred
|
||||
to already in an EDU's prev_id field.
|
||||
example: 5
|
||||
deleted:
|
||||
type: boolean
|
||||
description: |-
|
||||
True if the server is announcing that this device has been deleted.
|
||||
example: false
|
||||
keys:
|
||||
description: |-
|
||||
The updated identity keys (if any) for this device. May be absent if the
|
||||
device has no E2E keys defined.
|
||||
$ref: ../../../client-server/definitions/device_keys.yaml
|
||||
required:
|
||||
- user_id
|
||||
- device_id
|
||||
- stream_id
|
@ -0,0 +1,85 @@
|
||||
# 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 User Device Management 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:
|
||||
"/user/devices/{userId}":
|
||||
get:
|
||||
summary: Gets all of the user's devices
|
||||
description: Gets information on all of the user's devices
|
||||
operationId: getUserDevices
|
||||
security:
|
||||
- signedRequest: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
type: string
|
||||
required: true
|
||||
description: |-
|
||||
The user ID to retrieve devices for. Must be a user local to the
|
||||
receiving homeserver.
|
||||
required: true
|
||||
x-example: "@alice:example.org"
|
||||
responses:
|
||||
200:
|
||||
description: The user's devices.
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
description: The user ID devices were requested for.
|
||||
example: "@alice:example.org"
|
||||
stream_id:
|
||||
type: integer
|
||||
description: |-
|
||||
A unique ID for a given user_id which describes the version of
|
||||
the returned device list. This is matched with the ``stream_id``
|
||||
field in ``m.device_list_update`` EDUs in order to incrementally
|
||||
update the returned device_list.
|
||||
example: 5
|
||||
devices:
|
||||
type: array
|
||||
description: The user's devices. May be empty.
|
||||
items:
|
||||
type: object
|
||||
title: User Device
|
||||
properties:
|
||||
device_id:
|
||||
type: string
|
||||
description: The device ID.
|
||||
example: "JLAFKJWSCS"
|
||||
keys:
|
||||
type: object
|
||||
description: Identity keys for the device.
|
||||
$ref: "../client-server/definitions/device_keys.yaml"
|
||||
device_display_name:
|
||||
type: string
|
||||
description: Optional display name for the device.
|
||||
example: "Alice's Mobile Phone"
|
||||
required: ['device_id', 'keys']
|
||||
required: ['user_id', 'stream_id', 'devices']
|
Loading…
Reference in New Issue