Skip to content

Commit

Permalink
Remove keyId from the server keys endpoints (#1350)
Browse files Browse the repository at this point in the history
* Remove keyId from the server keys endpoints

It has been deprecated forever.
Besides, the OpenAPI 3 spec doesn't allow optional path parameters.

Signed-off-by: Kévin Commaille <[email protected]>

* Add newsfragment

Signed-off-by: Kévin Commaille <[email protected]>

* Fix broken link

Signed-off-by: Kévin Commaille <[email protected]>

* Mention MSC3938 in newfragment

Signed-off-by: Kévin Commaille <[email protected]>

Signed-off-by: Kévin Commaille <[email protected]>
  • Loading branch information
zecakeh authored Jan 3, 2023
1 parent eb2456c commit 9e45037
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 32 deletions.
1 change: 1 addition & 0 deletions changelogs/server_server/newsfragments/1350.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove `keyId` from the server `/keys` endpoints, as per [MSC3938](https://github.com/matrix-org/matrix-spec-proposals/pull/3938).
2 changes: 1 addition & 1 deletion content/rooms/fragments/v5-signing-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ When validating event signatures, servers MUST enforce the
`valid_until_ts` property from a key request is at least as large as the
`origin_server_ts` for the event being validated. Servers missing a copy
of the signing key MUST try to obtain one via the [GET
/\_matrix/key/v2/server](/server-server-api#get_matrixkeyv2serverkeyid)
/\_matrix/key/v2/server](/server-server-api#get_matrixkeyv2server)
or [POST
/\_matrix/key/v2/query](/server-server-api#post_matrixkeyv2query)
APIs. When using the `/query` endpoint, servers MUST set the
Expand Down
10 changes: 5 additions & 5 deletions content/server-server-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ draft](https://github.com/matrix-org/matrix-doc/blob/51faf8ed2e4a63d4cfd6d231836
{{% /boxes/note %}}

Each homeserver publishes its public keys under
`/_matrix/key/v2/server/{keyId}`. Homeservers query for keys by either
getting `/_matrix/key/v2/server/{keyId}` directly or by querying an
`/_matrix/key/v2/server`. Homeservers query for keys by either
getting `/_matrix/key/v2/server` directly or by querying an
intermediate notary server using a
`/_matrix/key/v2/query/{serverName}/{keyId}` API. Intermediate notary
servers query the `/_matrix/key/v2/server/{keyId}` API on behalf of
`/_matrix/key/v2/query/{serverName}` API. Intermediate notary
servers query the `/_matrix/key/v2/server` API on behalf of
another server and sign the response with their own key. A server may
query multiple notary servers to ensure that they all report the same
public keys.
Expand All @@ -239,7 +239,7 @@ homeserver and for signing events. It contains a list of
Servers may query another server's keys through a notary server. The
notary server may be another homeserver. The notary server will retrieve
keys from the queried servers through use of the
`/_matrix/key/v2/server/{keyId}` API. The notary server will
`/_matrix/key/v2/server` API. The notary server will
additionally sign the response from the queried server before returning
the results.

Expand Down
13 changes: 1 addition & 12 deletions data/api/server-server/keys_query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ consumes:
produces:
- application/json
paths:
"/query/{serverName}/{keyId}":
"/query/{serverName}":
get:
summary: Query for another server's keys
description: |-
Expand All @@ -39,17 +39,6 @@ paths:
description: The server's DNS name to query
required: true
x-example: matrix.org
- in: path
name: keyId
type: string
description: |-
**Deprecated**. Servers should not use this parameter and instead
opt to return all keys, not just the requested one. The key ID to
look up.
When excluded, the trailing slash on this endpoint is optional.
required: false
x-example: "ed25519:abc123"
- in: query
name: minimum_valid_until_ts
type: integer
Expand Down
15 changes: 1 addition & 14 deletions data/api/server-server/keys_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ basePath: /_matrix/key/v2
produces:
- application/json
paths:
"/server/{keyId}":
"/server":
get:
summary: Get the homeserver's public key(s)
description: |-
Expand All @@ -43,19 +43,6 @@ paths:
from the server so that the signatures of old events can still be
checked.
operationId: getServerKey
parameters:
- in: path
name: keyId
type: string
description: |-
**Deprecated**. Servers should not use this parameter and instead
opt to return all keys, not just the requested one. The key ID to
look up.
When excluded, the trailing slash on this endpoint is optional.
required: false
x-example: "ed25519:abc123"
deprecated: true
responses:
200:
description: The homeserver's keys
Expand Down

0 comments on commit 9e45037

Please sign in to comment.