pub fn simulate_key_query_response_for_verification(
signature_upload_request: Request,
my_identity: OwnUserIdentity,
my_user_id: &UserId,
their_user_id: &UserId,
msk_json: Value,
ssk_json: Value,
) -> Response
Available on crate feature
testing
only.Expand description
When we want to test identities that are verified, we need to simulate the verification process. This function supports that by simulating what happens when a successful verification dance happens and providing the /keys/query response we would get when that happened.
signature_upload_request will be the result of calling
super::OtherUserIdentity::verify
.
§Example
ⓘ
let signature_upload_request = their_identity.verify().await.unwrap();
let msk_json = json!({
"their_user_id": {
"keys": { "ed25519:blah": "blah" }
"signatures": {
"their_user_id": { "ed25519:blah": "blah", ... }
}
"usage": [ "master" ],
"user_id": "their_user_id"
}
});
let ssk_json = json!({
"their_user_id": {
"keys": { "ed25519:blah": "blah" },
"signatures": {
"their_user_id": { "ed25519:blah": "blah" }
},
"usage": [ "self_signing" ],
"user_id": "their_user_id"
}
})
let response = simulate_key_query_response_for_verification(
signature_upload_request,
my_identity,
my_user_id,
their_user_id,
msk_json,
ssk_json
).await;
olm_machine
.mark_request_as_sent(
&TransactionId::new(),
crate::IncomingResponse::KeysQuery(&kq_response),
)
.await
.unwrap();