Clarify the distinction between *m.key.verification.start* and its *m.sas.v1* variant.

Currently the *m.key.verification.start* event appears twice with the
exact same title, in the "Key verification framework" section and the
"Short Authentication (SAS) verification" section. It's not immediately
clear that the first occurrence describes the format of the event in
general terms and that the second occurrence describes the fields when
the *m.sas.v1* verification method is being used. This is a similar
relationship to the *m.room.message* event and its various *msgtype*
variants.

This commit does three things:

* It tweaks the generation of the documentation to change the title
  of the second occurrence of *m.key.verification.start* to
  distinguish it from the first.
* It updates the language in the description of the two versions of the
  event to better describe the relationship between the two.
* It adds the optional `next_method` field to the schema of the
  *m.sas.v1* variant, as specified in the general form of
  *m.key.verification.start*.

Signed-off-by: Jimmy Cuadra <jimmy@jimmycuadra.com>
pull/977/head
Jimmy Cuadra 6 years ago
parent b807e1cbe5
commit bc71dacaf4

@ -0,0 +1 @@
Clarify the distinction between *m.key.verification.start* and its *m.sas.v1* variant.

@ -3,7 +3,7 @@ allOf:
- $ref: core-event-schema/event.yaml - $ref: core-event-schema/event.yaml
description: |- description: |-
Begins a key verification process. Typically sent as a `to-device`_ event. Begins a key verification process. Typically sent as a `to-device`_ event. The ``method`` field determines the type of verification. The fields in the event will differ depending on the ``method``. This definition includes fields that are in common among all variants.
properties: properties:
content: content:
properties: properties:

@ -3,7 +3,7 @@ allOf:
- $ref: core-event-schema/event.yaml - $ref: core-event-schema/event.yaml
description: |- description: |-
Begins a SAS key verification process. Typically sent as a `to-device`_ event. Begins an SAS key verification process using the ``m.sas.v1`` method. Typically sent as a `to-device`_ event.
properties: properties:
content: content:
properties: properties:
@ -22,7 +22,11 @@ properties:
type: string type: string
enum: ["m.sas.v1"] enum: ["m.sas.v1"]
description: |- description: |-
The verification method to use. Must be ``m.sas.v1``. The verification method to use.
next_method:
type: string
description: |-
Optional method to use to verify the other user's key with.
key_agreement_protocols: key_agreement_protocols:
type: array type: array
description: |- description: |-

@ -902,6 +902,15 @@ class MatrixUnits(Units):
"`m.room.message msgtypes`_." "`m.room.message msgtypes`_."
) )
# method types for m.key.verification.start
if schema["type"] == "m.key.verification.start":
methods = Units.prop(
json_schema, "properties/content/properties/method/enum"
)
if methods:
schema["type_with_msgtype"] = schema["type"] + " (" + methods[0] + ")"
# Assign state key info if it has some # Assign state key info if it has some
if schema["typeof"] == "State Event": if schema["typeof"] == "State Event":
skey_desc = Units.prop( skey_desc = Units.prop(

Loading…
Cancel
Save