You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-30 04:23:07 +03:00
* Migrate own identity trust to rust crypto * Fix gendoc not happy if msk of IDownloadKeyResult has a signature * add missing mock * code review * Code review * Review gh suggestion Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Review gh suggestion Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Review gh suggestion Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Review gh suggestion Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * review move function down in file * Review gh suggestion Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Review gh suggestion Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Review: Cleaning tests, renaming * Review: better comment Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Comment paragraphs * retry until initial key query is successfull * review quick nits * missing mock in test --------- Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
111 lines
4.4 KiB
TypeScript
111 lines
4.4 KiB
TypeScript
import { DumpDataSetInfo } from "../index";
|
|
|
|
/**
|
|
* A key query response containing the current keys of the tested user.
|
|
* To be used during tests with fetchmock.
|
|
*/
|
|
const KEY_QUERY_RESPONSE = {
|
|
device_keys: {
|
|
"@untrusted:localhost": {
|
|
IXNYALOZWU: {
|
|
algorithms: ["m.olm.v1.curve25519-aes-sha2", "m.megolm.v1.aes-sha2"],
|
|
device_id: "IXNYALOZWU",
|
|
keys: {
|
|
"curve25519:IXNYALOZWU": "EHMQEtJd9INJg28HwKK8Te1EX8obR3VTtyNwf/rcczM",
|
|
"ed25519:IXNYALOZWU": "OxMfZHsYJvroTp1RtjUOejpWbRBryN6VsojC5dKR74U",
|
|
},
|
|
signatures: {
|
|
"@untrusted:localhost": {
|
|
"ed25519:IXNYALOZWU":
|
|
"tWaTiRKc95ZCqM2qrKTdq1sQ3DPFgw3vdrOVmWIHQwj92DCgJtnQ9uymLMOq+MSb80bdBBjXwrNeOufgaL/6CQ",
|
|
"ed25519:+ik0n/QnBPq8H/48wAT+54slKk1SL7NIk/HtiN/cNEg":
|
|
"+QXZFLiAv+k7UXgAP6AXLk/PdZ3TlJ77M23m73v8qvavAlnkLBAjKNA3BG39JTQET5UhW5DnCohwsbGP+aY1Cw",
|
|
},
|
|
},
|
|
user_id: "@untrusted:localhost",
|
|
unsigned: {
|
|
device_display_name: "localhost:8080: Chrome on macOS",
|
|
},
|
|
},
|
|
VJPSPVPWZT: {
|
|
algorithms: ["m.olm.v1.curve25519-aes-sha2", "m.megolm.v1.aes-sha2"],
|
|
device_id: "VJPSPVPWZT",
|
|
keys: {
|
|
"curve25519:VJPSPVPWZT": "+RxCNRFPqBZJm6PLjEJsSdFixGWQJygD5Os11/+6PC0",
|
|
"ed25519:VJPSPVPWZT": "wqH7xK/DQya8m05Vy4rnacjugGNBiY+7Ml6wyRVkM9U",
|
|
},
|
|
signatures: {
|
|
"@untrusted:localhost": {
|
|
"ed25519:VJPSPVPWZT":
|
|
"XC+RoKL/zVZOIwk/bGEQJlJu49QicY1v6vSDMHA2y0/fpX/MD4KiWGD7+W5DFD54E8FrFVTsIgkzat561qdTBQ",
|
|
},
|
|
},
|
|
user_id: "@untrusted:localhost",
|
|
unsigned: {
|
|
device_display_name: "localhost:8080: Chrome on macOS",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
failures: {},
|
|
master_keys: {
|
|
"@untrusted:localhost": {
|
|
keys: {
|
|
"ed25519:Uahbc3+Rk65y0ku6T2RL/29fEA9Bum6+OaqptG6df3g": "Uahbc3+Rk65y0ku6T2RL/29fEA9Bum6+OaqptG6df3g",
|
|
},
|
|
signatures: {
|
|
"@untrusted:localhost": {
|
|
"ed25519:IXNYALOZWU":
|
|
"KdAdyKO2sb3Di3bdK+oxf+gjMSmW/sisRNvpKZORPKwmy2SGaKGYkecBtslunoFjnb+hjIESgweQu6cHoNX4AA",
|
|
"ed25519:Uahbc3+Rk65y0ku6T2RL/29fEA9Bum6+OaqptG6df3g":
|
|
"b0R9Id5HxHYo+MA22Vlq0OckTrWnSWhgHLvF8Wr4e154JdtOyK7N0aXPQPkrLB0fmyVmGdbDa9xs9jsfINGmDw",
|
|
},
|
|
},
|
|
usage: ["master"],
|
|
user_id: "@untrusted:localhost",
|
|
},
|
|
},
|
|
self_signing_keys: {
|
|
"@untrusted:localhost": {
|
|
keys: {
|
|
"ed25519:+ik0n/QnBPq8H/48wAT+54slKk1SL7NIk/HtiN/cNEg": "+ik0n/QnBPq8H/48wAT+54slKk1SL7NIk/HtiN/cNEg",
|
|
},
|
|
signatures: {
|
|
"@untrusted:localhost": {
|
|
"ed25519:Uahbc3+Rk65y0ku6T2RL/29fEA9Bum6+OaqptG6df3g":
|
|
"z/5z51jbRpyDQhYnfUHhhb5fUbzRDlfjD8mZA2ZGStpE/F41lDyxjlvF2W/E2CJ27bmJFdk7nC+ZCwriYfYxBw",
|
|
},
|
|
},
|
|
usage: ["self_signing"],
|
|
user_id: "@untrusted:localhost",
|
|
},
|
|
},
|
|
user_signing_keys: {
|
|
"@untrusted:localhost": {
|
|
keys: {
|
|
"ed25519:L/8HbQWnK9OidAcDVB+Az9b0Mx3OdBtIMFsUjV6qgSQ": "L/8HbQWnK9OidAcDVB+Az9b0Mx3OdBtIMFsUjV6qgSQ",
|
|
},
|
|
signatures: {
|
|
"@untrusted:localhost": {
|
|
"ed25519:Uahbc3+Rk65y0ku6T2RL/29fEA9Bum6+OaqptG6df3g":
|
|
"UuNvzebLQn31LYGbx+ADe60BB25kWy4SVVyd9BXlY/tAZMoA8Tmq1e2R2tJJtPdJxC/Oogktj2+iikZV/YMjAQ",
|
|
},
|
|
},
|
|
usage: ["user_signing"],
|
|
user_id: "@untrusted:localhost",
|
|
},
|
|
},
|
|
};
|
|
|
|
/**
|
|
* A dataset containing the information for the tested user.
|
|
* To be used during tests.
|
|
*/
|
|
export const IDENTITY_NOT_TRUSTED_DATASET: DumpDataSetInfo = {
|
|
userId: "@untrusted:localhost",
|
|
deviceId: "VJPSPVPWZT",
|
|
pickleKey: "WVllQb4Lk/WwP4Q7iBfeTUHpgydZm9YqXI1B5bTvnIM",
|
|
keyQueryResponse: KEY_QUERY_RESPONSE,
|
|
dumpPath: "spec/test-utils/test_indexeddb_cryptostore_dump/unverified/dump.json",
|
|
};
|