refactor encrypted file schema as "Extension to m.message"
parent
28ced3b0a4
commit
e3daf10bb9
@ -1,55 +0,0 @@
|
||||
{
|
||||
"age": 146,
|
||||
"content": {
|
||||
"body": "something-important.doc",
|
||||
"filename": "something-important.doc",
|
||||
"file": {
|
||||
"url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe",
|
||||
"mimetype": "application/msword",
|
||||
"v": "v2",
|
||||
"key": {
|
||||
"alg": "A256CTR",
|
||||
"ext": true,
|
||||
"k": "aWF6-32KGYaC3A_FEUCk1Bt0JA37zP0wrStgmdCaW-0",
|
||||
"key_ops": ["encrypt","decrypt"],
|
||||
"kty": "oct"
|
||||
},
|
||||
"iv": "w+sE15fzSc0AAAAAAAAAAA",
|
||||
"hashes": {
|
||||
"sha256": "fdSLu/YkRx3Wyh3KQabP3rd6+SFiKg5lsJZQHtkSAYA"
|
||||
}
|
||||
},
|
||||
"info": {
|
||||
"mimetype": "application/msword",
|
||||
"size": 46144,
|
||||
"thumbnail_file": {
|
||||
"hashes": {
|
||||
"sha256": "/NogKqW5bz/m8xHgFiH5haFGjCNVmUIPLzfvOhHdrxY"
|
||||
},
|
||||
"iv": "U+k7PfwLr6UAAAAAAAAAAA",
|
||||
"key": {
|
||||
"alg": "A256CTR",
|
||||
"ext": true,
|
||||
"k": "RMyd6zhlbifsACM1DXkCbioZ2u0SywGljTH8JmGcylg",
|
||||
"key_ops": ["encrypt", "decrypt"],
|
||||
"kty": "oct"
|
||||
},
|
||||
"mimetype": "image/jpeg",
|
||||
"url": "mxc://localhost/pmVJxyxGlmxHposwVSlOaEOv",
|
||||
"v": "v2"
|
||||
},
|
||||
"thumbnail_info": {
|
||||
"h": 768,
|
||||
"mimetype": "image/jpeg",
|
||||
"size": 211009,
|
||||
"w": 432
|
||||
}
|
||||
},
|
||||
"msgtype": "m.file"
|
||||
},
|
||||
"event_id": "$143273582443PhrSn:localhost",
|
||||
"origin_server_ts": 1432735824653,
|
||||
"room_id": "!jEsUZKDJdhlrceRyVU:localhost",
|
||||
"type": "m.room.message",
|
||||
"sender": "@example:localhost"
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
---
|
||||
allOf:
|
||||
- $ref: core-event-schema/room_event.yaml
|
||||
description: |-
|
||||
This message represents an encrypted generic file, corresponding to a
|
||||
plaintext ``m.file`` message. ``m.image``, ``m.video`` and ``m.audio`` can be
|
||||
sent encrypted using the same structure.
|
||||
properties:
|
||||
content:
|
||||
properties:
|
||||
body:
|
||||
description: |-
|
||||
A human-readable description of the file. This is recommended to be
|
||||
the filename of the original upload.
|
||||
type: string
|
||||
filename:
|
||||
description: The original filename of the uploaded file.
|
||||
type: string
|
||||
info:
|
||||
description: Information about the file referred to in ``file``.
|
||||
properties:
|
||||
mimetype:
|
||||
description: The mimetype of the file e.g. ``application/msword``.
|
||||
type: string
|
||||
size:
|
||||
description: The size of the file in bytes.
|
||||
type: integer
|
||||
thumbnail_file:
|
||||
description: The URL to the thumbnail of the file.
|
||||
title: EncryptedFile
|
||||
type: object
|
||||
thumbnail_info:
|
||||
allOf:
|
||||
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
|
||||
description: Metadata about the image referred to in ``thumbnail_url``.
|
||||
title: FileInfo
|
||||
type: object
|
||||
msgtype:
|
||||
enum:
|
||||
- m.file
|
||||
type: string
|
||||
file:
|
||||
description: Information needed to decrypt the file.
|
||||
properties:
|
||||
url:
|
||||
description: The URL to the file.
|
||||
type: string
|
||||
key:
|
||||
description: A `JSON web key`_ object.
|
||||
type: object
|
||||
title: JWK
|
||||
properties:
|
||||
kty:
|
||||
description: Key type. Must be ``oct``.
|
||||
type: string
|
||||
key_ops:
|
||||
description: |-
|
||||
Key operations. Must at least contain ``encrypt`` and ``decrypt``.
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
alg:
|
||||
description: Algorithm. Must be ``A256CTR``.
|
||||
type: string
|
||||
k:
|
||||
description: The key, encoded as urlsafe unpadded base64.
|
||||
type: string
|
||||
ext:
|
||||
description: Extractable. Must be ``true``. This is a `W3C extension`_.
|
||||
type: boolean
|
||||
iv:
|
||||
description: |-
|
||||
The Initialisation Vector used by AES-CTR, encoded as unpadded
|
||||
base64.
|
||||
type: string
|
||||
hashes:
|
||||
description: |-
|
||||
A map from an algorithm name to a hash of the ciphertext, encoded
|
||||
as unpadded base64. Clients should support the SHA-256 hash.
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
v:
|
||||
description: Version of the encrypted attachments protocol.
|
||||
type: string
|
||||
enum: ["v2"]
|
||||
title: EncryptedFile
|
||||
type: object
|
||||
required:
|
||||
- msgtype
|
||||
- body
|
||||
- file
|
||||
- filename
|
||||
type: object
|
||||
type:
|
||||
enum:
|
||||
- m.room.message
|
||||
type: string
|
||||
title: EncryptedFileMessage
|
||||
type: object
|
Loading…
Reference in New Issue