Skip to main content

upload_signatures_handler

Function upload_signatures_handler 

Source
async fn upload_signatures_handler(
    database: State<DefaultDb>,
    __arg1: AuthenticatedClientRequest<Request>,
) -> Result<ArminiusResponse<Response>, SignaturesUploadError>
Expand description

Handler for POST /_matrix/client/v3/keys/signatures/upload (See https://spec.matrix.org/v1.16/client-server-api/#post_matrixclientv3keyssignaturesupload).

There are 3 possible signatures being uploaded via this endpoint:

  • Signatures for the user’s device keys, emitted by their Self-Signing key
  • Signature for the user’s Master key, emitted by their device keys
  • Signatures for other users’ Master keys, emitted by the requester’s User-Signing key

We therefore split and process each of these three cases separately, and then we return a map from user ID to key ID to an error for any signatures that failed being verified.