Refactor PDU definitions to reduce duplication (#2070)
First of all, all PDU definitions were based on the v1 PDU definition with a few fields overwritten to change the format with needed. While that works when rendering the spec, this is semantically incorrect because it means that the objects must match both schemas, which is impossible. So now we make a base with only the common fields, and we add the others as needed by the room version. Note that there is no more "unsigned PDU" definition since it is not used directly, and hashes and signatures are the same across all versions. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
parent
ae06f37470
commit
60339adb2d
21 changed files with 190 additions and 283 deletions
|
@ -13,11 +13,11 @@
|
|||
# limitations under the License.
|
||||
type: object
|
||||
title: Persistent Data Unit
|
||||
description: A persistent data unit (event) for room version 3 and beyond.
|
||||
description: A persistent data unit (event) for room version 3.
|
||||
example:
|
||||
$ref: "../examples/pdu_v3.json"
|
||||
allOf:
|
||||
- $ref: "unsigned_pdu_base.yaml"
|
||||
- $ref: "components/pdu_base.yaml"
|
||||
- type: object
|
||||
properties:
|
||||
redacts:
|
||||
|
@ -48,24 +48,6 @@ allOf:
|
|||
|
||||
Must contain less than or equal to 20 events.
|
||||
example: ["$base64EncodedHash", "$AnotherEvent"]
|
||||
hashes:
|
||||
$ref: "event_hash.yaml"
|
||||
signatures:
|
||||
type: object
|
||||
description: |-
|
||||
Signatures for the PDU, following the algorithm specified in [Signing Events](/server-server-api/#signing-events).
|
||||
example: {
|
||||
"example.com": {
|
||||
"ed25519:key_version:": "86BytesOfSignatureOfTheRedactedEvent"
|
||||
}
|
||||
}
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: Server Signatures
|
||||
additionalProperties:
|
||||
type: string
|
||||
required:
|
||||
- auth_events
|
||||
- prev_events
|
||||
- hashes
|
||||
- signatures
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue