Skip to content

Commit

Permalink
Use OneTimeKeys schema
Browse files Browse the repository at this point in the history
This was commented prior to the
port to OpenAPI 3.1 for technical reasons (matrix-org#1127).
Now we can use it just fine.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
  • Loading branch information
zecakeh committed Apr 24, 2024
1 parent 26ce392 commit 50dc259
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
1 change: 1 addition & 0 deletions data/api/client-server/definitions/one_time_keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ additionalProperties:
oneOf:
- type: string
- type: object
title: KeyObject
properties:
key:
type: string
Expand Down
20 changes: 5 additions & 15 deletions data/api/client-server/keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ paths:
allOf:
- $ref: definitions/device_keys.yaml
one_time_keys:
# $ref: "definitions/one_time_keys.yaml"
# XXX: We can't define an actual object here, so we have to hope
# that people will look at the OpenAPI source or can figure it out
# from the other endpoints/example.
allOf:
- $ref: "definitions/one_time_keys.yaml"
type: object
title: OneTimeKeys
description: |-
One-time public keys for "pre-key" messages. The names of
the properties should be in the format
Expand All @@ -65,10 +62,9 @@ paths:
ed25519:JLAFKJWSCS: IQeCEPb9HFk217cU9kw9EOiusC6kMIkoIRnbnfOh5Oc63S1ghgyjShBGpu34blQomoalCyXWyhaaT3MrLZYQAA
fallback_keys:
x-addedInMatrixVersion: "1.2"
# $ref: "definitions/one_time_keys.yaml"
# XXX: We can't define an actual object here - see above.
allOf:
- $ref: "definitions/one_time_keys.yaml"
type: object
title: OneTimeKeys
description: |-
The public key which should be used if the device's one-time keys
are exhausted. The fallback key is not deleted once used, but should
Expand Down Expand Up @@ -349,13 +345,7 @@ paths:
additionalProperties:
type: object
additionalProperties:
# $ref: "definitions/one_time_keys.yaml"
# XXX: We can't define an actual object here, so we have to hope
# that people will read the link provided in the description
# and figure it out from the other endpoints/example.
# See also one_time_key parameter for /keys/upload above.
type: object
title: OneTimeKeys
$ref: "definitions/one_time_keys.yaml"
example:
"@alice:example.com":
JLAFKJWSCS:
Expand Down

0 comments on commit 50dc259

Please sign in to comment.