@unwanted/matrix-sdk-mini 34.12.0-2 → 34.12.0-3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (467) hide show
  1. package/git-revision.txt +1 -1
  2. package/lib/@types/global.d.js +0 -2
  3. package/lib/@types/global.d.js.map +1 -1
  4. package/lib/browser-index.d.ts.map +1 -1
  5. package/lib/browser-index.js +0 -11
  6. package/lib/browser-index.js.map +1 -1
  7. package/lib/client.d.ts +2 -1176
  8. package/lib/client.d.ts.map +1 -1
  9. package/lib/client.js +346 -2717
  10. package/lib/client.js.map +1 -1
  11. package/lib/embedded.d.ts +0 -22
  12. package/lib/embedded.d.ts.map +1 -1
  13. package/lib/embedded.js +24 -166
  14. package/lib/embedded.js.map +1 -1
  15. package/lib/event-mapper.d.ts.map +1 -1
  16. package/lib/event-mapper.js +0 -4
  17. package/lib/event-mapper.js.map +1 -1
  18. package/lib/matrix.d.ts +0 -19
  19. package/lib/matrix.d.ts.map +1 -1
  20. package/lib/matrix.js +1 -26
  21. package/lib/matrix.js.map +1 -1
  22. package/lib/models/MSC3089Branch.d.ts.map +1 -1
  23. package/lib/models/MSC3089Branch.js +0 -3
  24. package/lib/models/MSC3089Branch.js.map +1 -1
  25. package/lib/models/event.d.ts +0 -94
  26. package/lib/models/event.d.ts.map +1 -1
  27. package/lib/models/event.js +0 -274
  28. package/lib/models/event.js.map +1 -1
  29. package/lib/models/poll.d.ts.map +1 -1
  30. package/lib/models/poll.js +1 -5
  31. package/lib/models/poll.js.map +1 -1
  32. package/lib/models/relations-container.d.ts.map +1 -1
  33. package/lib/models/relations-container.js +1 -7
  34. package/lib/models/relations-container.js.map +1 -1
  35. package/lib/models/relations.d.ts +0 -1
  36. package/lib/models/relations.d.ts.map +1 -1
  37. package/lib/models/relations.js +0 -8
  38. package/lib/models/relations.js.map +1 -1
  39. package/lib/models/room-state.d.ts.map +1 -1
  40. package/lib/models/room-state.js +10 -26
  41. package/lib/models/room-state.js.map +1 -1
  42. package/lib/models/room.d.ts +0 -18
  43. package/lib/models/room.d.ts.map +1 -1
  44. package/lib/models/room.js +94 -148
  45. package/lib/models/room.js.map +1 -1
  46. package/lib/models/thread.d.ts.map +1 -1
  47. package/lib/models/thread.js +0 -1
  48. package/lib/models/thread.js.map +1 -1
  49. package/lib/sliding-sync-sdk.d.ts +2 -3
  50. package/lib/sliding-sync-sdk.d.ts.map +1 -1
  51. package/lib/sliding-sync-sdk.js +41 -90
  52. package/lib/sliding-sync-sdk.js.map +1 -1
  53. package/lib/sync.d.ts +0 -12
  54. package/lib/sync.d.ts.map +1 -1
  55. package/lib/sync.js +1 -73
  56. package/lib/sync.js.map +1 -1
  57. package/lib/testing.d.ts +0 -48
  58. package/lib/testing.d.ts.map +1 -1
  59. package/lib/testing.js +0 -105
  60. package/lib/testing.js.map +1 -1
  61. package/package.json +1 -3
  62. package/src/@types/global.d.ts +0 -3
  63. package/src/browser-index.ts +0 -11
  64. package/src/client.ts +57 -2732
  65. package/src/embedded.ts +3 -130
  66. package/src/event-mapper.ts +0 -4
  67. package/src/matrix.ts +0 -28
  68. package/src/models/MSC3089Branch.ts +0 -3
  69. package/src/models/event.ts +0 -289
  70. package/src/models/poll.ts +0 -6
  71. package/src/models/relations-container.ts +1 -8
  72. package/src/models/relations.ts +0 -8
  73. package/src/models/room-state.ts +2 -8
  74. package/src/models/room.ts +0 -62
  75. package/src/models/thread.ts +0 -1
  76. package/src/sliding-sync-sdk.ts +2 -72
  77. package/src/sync.ts +1 -98
  78. package/src/testing.ts +0 -108
  79. package/lib/@types/crypto.d.ts +0 -47
  80. package/lib/@types/crypto.d.ts.map +0 -1
  81. package/lib/@types/crypto.js +0 -1
  82. package/lib/@types/crypto.js.map +0 -1
  83. package/lib/@types/matrix-sdk-crypto-wasm.d.js +0 -1
  84. package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +0 -1
  85. package/lib/common-crypto/CryptoBackend.d.ts +0 -240
  86. package/lib/common-crypto/CryptoBackend.d.ts.map +0 -1
  87. package/lib/common-crypto/CryptoBackend.js +0 -73
  88. package/lib/common-crypto/CryptoBackend.js.map +0 -1
  89. package/lib/common-crypto/key-passphrase.d.ts +0 -14
  90. package/lib/common-crypto/key-passphrase.d.ts.map +0 -1
  91. package/lib/common-crypto/key-passphrase.js +0 -33
  92. package/lib/common-crypto/key-passphrase.js.map +0 -1
  93. package/lib/crypto/CrossSigning.d.ts +0 -184
  94. package/lib/crypto/CrossSigning.d.ts.map +0 -1
  95. package/lib/crypto/CrossSigning.js +0 -718
  96. package/lib/crypto/CrossSigning.js.map +0 -1
  97. package/lib/crypto/DeviceList.d.ts +0 -216
  98. package/lib/crypto/DeviceList.d.ts.map +0 -1
  99. package/lib/crypto/DeviceList.js +0 -892
  100. package/lib/crypto/DeviceList.js.map +0 -1
  101. package/lib/crypto/EncryptionSetup.d.ts +0 -152
  102. package/lib/crypto/EncryptionSetup.d.ts.map +0 -1
  103. package/lib/crypto/EncryptionSetup.js +0 -356
  104. package/lib/crypto/EncryptionSetup.js.map +0 -1
  105. package/lib/crypto/OlmDevice.d.ts +0 -457
  106. package/lib/crypto/OlmDevice.d.ts.map +0 -1
  107. package/lib/crypto/OlmDevice.js +0 -1241
  108. package/lib/crypto/OlmDevice.js.map +0 -1
  109. package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts +0 -109
  110. package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts.map +0 -1
  111. package/lib/crypto/OutgoingRoomKeyRequestManager.js +0 -415
  112. package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +0 -1
  113. package/lib/crypto/RoomList.d.ts +0 -26
  114. package/lib/crypto/RoomList.d.ts.map +0 -1
  115. package/lib/crypto/RoomList.js +0 -71
  116. package/lib/crypto/RoomList.js.map +0 -1
  117. package/lib/crypto/SecretSharing.d.ts +0 -24
  118. package/lib/crypto/SecretSharing.d.ts.map +0 -1
  119. package/lib/crypto/SecretSharing.js +0 -194
  120. package/lib/crypto/SecretSharing.js.map +0 -1
  121. package/lib/crypto/SecretStorage.d.ts +0 -55
  122. package/lib/crypto/SecretStorage.d.ts.map +0 -1
  123. package/lib/crypto/SecretStorage.js +0 -118
  124. package/lib/crypto/SecretStorage.js.map +0 -1
  125. package/lib/crypto/aes.d.ts +0 -6
  126. package/lib/crypto/aes.d.ts.map +0 -1
  127. package/lib/crypto/aes.js +0 -24
  128. package/lib/crypto/aes.js.map +0 -1
  129. package/lib/crypto/algorithms/base.d.ts +0 -156
  130. package/lib/crypto/algorithms/base.d.ts.map +0 -1
  131. package/lib/crypto/algorithms/base.js +0 -187
  132. package/lib/crypto/algorithms/base.js.map +0 -1
  133. package/lib/crypto/algorithms/index.d.ts +0 -4
  134. package/lib/crypto/algorithms/index.d.ts.map +0 -1
  135. package/lib/crypto/algorithms/index.js +0 -20
  136. package/lib/crypto/algorithms/index.js.map +0 -1
  137. package/lib/crypto/algorithms/megolm.d.ts +0 -385
  138. package/lib/crypto/algorithms/megolm.d.ts.map +0 -1
  139. package/lib/crypto/algorithms/megolm.js +0 -1822
  140. package/lib/crypto/algorithms/megolm.js.map +0 -1
  141. package/lib/crypto/algorithms/olm.d.ts +0 -5
  142. package/lib/crypto/algorithms/olm.d.ts.map +0 -1
  143. package/lib/crypto/algorithms/olm.js +0 -299
  144. package/lib/crypto/algorithms/olm.js.map +0 -1
  145. package/lib/crypto/api.d.ts +0 -32
  146. package/lib/crypto/api.d.ts.map +0 -1
  147. package/lib/crypto/api.js +0 -22
  148. package/lib/crypto/api.js.map +0 -1
  149. package/lib/crypto/backup.d.ts +0 -227
  150. package/lib/crypto/backup.d.ts.map +0 -1
  151. package/lib/crypto/backup.js +0 -824
  152. package/lib/crypto/backup.js.map +0 -1
  153. package/lib/crypto/crypto.d.ts +0 -3
  154. package/lib/crypto/crypto.d.ts.map +0 -1
  155. package/lib/crypto/crypto.js +0 -19
  156. package/lib/crypto/crypto.js.map +0 -1
  157. package/lib/crypto/dehydration.d.ts +0 -34
  158. package/lib/crypto/dehydration.d.ts.map +0 -1
  159. package/lib/crypto/dehydration.js +0 -252
  160. package/lib/crypto/dehydration.js.map +0 -1
  161. package/lib/crypto/device-converter.d.ts +0 -9
  162. package/lib/crypto/device-converter.d.ts.map +0 -1
  163. package/lib/crypto/device-converter.js +0 -42
  164. package/lib/crypto/device-converter.js.map +0 -1
  165. package/lib/crypto/deviceinfo.d.ts +0 -99
  166. package/lib/crypto/deviceinfo.d.ts.map +0 -1
  167. package/lib/crypto/deviceinfo.js +0 -148
  168. package/lib/crypto/deviceinfo.js.map +0 -1
  169. package/lib/crypto/index.d.ts +0 -1209
  170. package/lib/crypto/index.d.ts.map +0 -1
  171. package/lib/crypto/index.js +0 -4097
  172. package/lib/crypto/index.js.map +0 -1
  173. package/lib/crypto/key_passphrase.d.ts +0 -14
  174. package/lib/crypto/key_passphrase.d.ts.map +0 -1
  175. package/lib/crypto/key_passphrase.js +0 -44
  176. package/lib/crypto/key_passphrase.js.map +0 -1
  177. package/lib/crypto/keybackup.d.ts +0 -18
  178. package/lib/crypto/keybackup.d.ts.map +0 -1
  179. package/lib/crypto/keybackup.js +0 -1
  180. package/lib/crypto/keybackup.js.map +0 -1
  181. package/lib/crypto/olmlib.d.ts +0 -129
  182. package/lib/crypto/olmlib.d.ts.map +0 -1
  183. package/lib/crypto/olmlib.js +0 -492
  184. package/lib/crypto/olmlib.js.map +0 -1
  185. package/lib/crypto/recoverykey.d.ts +0 -2
  186. package/lib/crypto/recoverykey.d.ts.map +0 -1
  187. package/lib/crypto/recoverykey.js +0 -19
  188. package/lib/crypto/recoverykey.js.map +0 -1
  189. package/lib/crypto/store/base.d.ts +0 -252
  190. package/lib/crypto/store/base.d.ts.map +0 -1
  191. package/lib/crypto/store/base.js +0 -64
  192. package/lib/crypto/store/base.js.map +0 -1
  193. package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +0 -187
  194. package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +0 -1
  195. package/lib/crypto/store/indexeddb-crypto-store-backend.js +0 -1145
  196. package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +0 -1
  197. package/lib/crypto/store/indexeddb-crypto-store.d.ts +0 -432
  198. package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +0 -1
  199. package/lib/crypto/store/indexeddb-crypto-store.js +0 -728
  200. package/lib/crypto/store/indexeddb-crypto-store.js.map +0 -1
  201. package/lib/crypto/store/localStorage-crypto-store.d.ts +0 -119
  202. package/lib/crypto/store/localStorage-crypto-store.d.ts.map +0 -1
  203. package/lib/crypto/store/localStorage-crypto-store.js +0 -531
  204. package/lib/crypto/store/localStorage-crypto-store.js.map +0 -1
  205. package/lib/crypto/store/memory-crypto-store.d.ts +0 -215
  206. package/lib/crypto/store/memory-crypto-store.d.ts.map +0 -1
  207. package/lib/crypto/store/memory-crypto-store.js +0 -622
  208. package/lib/crypto/store/memory-crypto-store.js.map +0 -1
  209. package/lib/crypto/verification/Base.d.ts +0 -105
  210. package/lib/crypto/verification/Base.d.ts.map +0 -1
  211. package/lib/crypto/verification/Base.js +0 -372
  212. package/lib/crypto/verification/Base.js.map +0 -1
  213. package/lib/crypto/verification/Error.d.ts +0 -35
  214. package/lib/crypto/verification/Error.d.ts.map +0 -1
  215. package/lib/crypto/verification/Error.js +0 -86
  216. package/lib/crypto/verification/Error.js.map +0 -1
  217. package/lib/crypto/verification/IllegalMethod.d.ts +0 -15
  218. package/lib/crypto/verification/IllegalMethod.d.ts.map +0 -1
  219. package/lib/crypto/verification/IllegalMethod.js +0 -43
  220. package/lib/crypto/verification/IllegalMethod.js.map +0 -1
  221. package/lib/crypto/verification/QRCode.d.ts +0 -51
  222. package/lib/crypto/verification/QRCode.d.ts.map +0 -1
  223. package/lib/crypto/verification/QRCode.js +0 -277
  224. package/lib/crypto/verification/QRCode.js.map +0 -1
  225. package/lib/crypto/verification/SAS.d.ts +0 -27
  226. package/lib/crypto/verification/SAS.d.ts.map +0 -1
  227. package/lib/crypto/verification/SAS.js +0 -485
  228. package/lib/crypto/verification/SAS.js.map +0 -1
  229. package/lib/crypto/verification/SASDecimal.d.ts +0 -8
  230. package/lib/crypto/verification/SASDecimal.d.ts.map +0 -1
  231. package/lib/crypto/verification/SASDecimal.js +0 -34
  232. package/lib/crypto/verification/SASDecimal.js.map +0 -1
  233. package/lib/crypto/verification/request/Channel.d.ts +0 -18
  234. package/lib/crypto/verification/request/Channel.d.ts.map +0 -1
  235. package/lib/crypto/verification/request/Channel.js +0 -1
  236. package/lib/crypto/verification/request/Channel.js.map +0 -1
  237. package/lib/crypto/verification/request/InRoomChannel.d.ts +0 -113
  238. package/lib/crypto/verification/request/InRoomChannel.d.ts.map +0 -1
  239. package/lib/crypto/verification/request/InRoomChannel.js +0 -351
  240. package/lib/crypto/verification/request/InRoomChannel.js.map +0 -1
  241. package/lib/crypto/verification/request/ToDeviceChannel.d.ts +0 -105
  242. package/lib/crypto/verification/request/ToDeviceChannel.d.ts.map +0 -1
  243. package/lib/crypto/verification/request/ToDeviceChannel.js +0 -328
  244. package/lib/crypto/verification/request/ToDeviceChannel.js.map +0 -1
  245. package/lib/crypto/verification/request/VerificationRequest.d.ts +0 -227
  246. package/lib/crypto/verification/request/VerificationRequest.d.ts.map +0 -1
  247. package/lib/crypto/verification/request/VerificationRequest.js +0 -937
  248. package/lib/crypto/verification/request/VerificationRequest.js.map +0 -1
  249. package/lib/crypto-api/CryptoEvent.d.ts +0 -69
  250. package/lib/crypto-api/CryptoEvent.d.ts.map +0 -1
  251. package/lib/crypto-api/CryptoEvent.js +0 -33
  252. package/lib/crypto-api/CryptoEvent.js.map +0 -1
  253. package/lib/crypto-api/CryptoEventHandlerMap.d.ts +0 -16
  254. package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +0 -1
  255. package/lib/crypto-api/CryptoEventHandlerMap.js +0 -22
  256. package/lib/crypto-api/CryptoEventHandlerMap.js.map +0 -1
  257. package/lib/crypto-api/index.d.ts +0 -978
  258. package/lib/crypto-api/index.d.ts.map +0 -1
  259. package/lib/crypto-api/index.js +0 -304
  260. package/lib/crypto-api/index.js.map +0 -1
  261. package/lib/crypto-api/key-passphrase.d.ts +0 -11
  262. package/lib/crypto-api/key-passphrase.d.ts.map +0 -1
  263. package/lib/crypto-api/key-passphrase.js +0 -51
  264. package/lib/crypto-api/key-passphrase.js.map +0 -1
  265. package/lib/crypto-api/keybackup.d.ts +0 -88
  266. package/lib/crypto-api/keybackup.d.ts.map +0 -1
  267. package/lib/crypto-api/keybackup.js +0 -1
  268. package/lib/crypto-api/keybackup.js.map +0 -1
  269. package/lib/crypto-api/recovery-key.d.ts +0 -11
  270. package/lib/crypto-api/recovery-key.d.ts.map +0 -1
  271. package/lib/crypto-api/recovery-key.js +0 -65
  272. package/lib/crypto-api/recovery-key.js.map +0 -1
  273. package/lib/crypto-api/verification.d.ts +0 -344
  274. package/lib/crypto-api/verification.d.ts.map +0 -1
  275. package/lib/crypto-api/verification.js +0 -91
  276. package/lib/crypto-api/verification.js.map +0 -1
  277. package/lib/rendezvous/MSC4108SignInWithQR.d.ts +0 -112
  278. package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +0 -1
  279. package/lib/rendezvous/MSC4108SignInWithQR.js +0 -392
  280. package/lib/rendezvous/MSC4108SignInWithQR.js.map +0 -1
  281. package/lib/rendezvous/RendezvousChannel.d.ts +0 -27
  282. package/lib/rendezvous/RendezvousChannel.d.ts.map +0 -1
  283. package/lib/rendezvous/RendezvousChannel.js +0 -1
  284. package/lib/rendezvous/RendezvousChannel.js.map +0 -1
  285. package/lib/rendezvous/RendezvousCode.d.ts +0 -9
  286. package/lib/rendezvous/RendezvousCode.d.ts.map +0 -1
  287. package/lib/rendezvous/RendezvousCode.js +0 -1
  288. package/lib/rendezvous/RendezvousCode.js.map +0 -1
  289. package/lib/rendezvous/RendezvousError.d.ts +0 -6
  290. package/lib/rendezvous/RendezvousError.d.ts.map +0 -1
  291. package/lib/rendezvous/RendezvousError.js +0 -23
  292. package/lib/rendezvous/RendezvousError.js.map +0 -1
  293. package/lib/rendezvous/RendezvousFailureReason.d.ts +0 -31
  294. package/lib/rendezvous/RendezvousFailureReason.d.ts.map +0 -1
  295. package/lib/rendezvous/RendezvousFailureReason.js +0 -38
  296. package/lib/rendezvous/RendezvousFailureReason.js.map +0 -1
  297. package/lib/rendezvous/RendezvousIntent.d.ts +0 -5
  298. package/lib/rendezvous/RendezvousIntent.d.ts.map +0 -1
  299. package/lib/rendezvous/RendezvousIntent.js +0 -22
  300. package/lib/rendezvous/RendezvousIntent.js.map +0 -1
  301. package/lib/rendezvous/RendezvousTransport.d.ts +0 -36
  302. package/lib/rendezvous/RendezvousTransport.d.ts.map +0 -1
  303. package/lib/rendezvous/RendezvousTransport.js +0 -1
  304. package/lib/rendezvous/RendezvousTransport.js.map +0 -1
  305. package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts +0 -58
  306. package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +0 -1
  307. package/lib/rendezvous/channels/MSC4108SecureChannel.js +0 -246
  308. package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +0 -1
  309. package/lib/rendezvous/channels/index.d.ts +0 -2
  310. package/lib/rendezvous/channels/index.d.ts.map +0 -1
  311. package/lib/rendezvous/channels/index.js +0 -18
  312. package/lib/rendezvous/channels/index.js.map +0 -1
  313. package/lib/rendezvous/index.d.ts +0 -10
  314. package/lib/rendezvous/index.d.ts.map +0 -1
  315. package/lib/rendezvous/index.js +0 -23
  316. package/lib/rendezvous/index.js.map +0 -1
  317. package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +0 -61
  318. package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +0 -1
  319. package/lib/rendezvous/transports/MSC4108RendezvousSession.js +0 -253
  320. package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +0 -1
  321. package/lib/rendezvous/transports/index.d.ts +0 -2
  322. package/lib/rendezvous/transports/index.d.ts.map +0 -1
  323. package/lib/rendezvous/transports/index.js +0 -18
  324. package/lib/rendezvous/transports/index.js.map +0 -1
  325. package/lib/rust-crypto/CrossSigningIdentity.d.ts +0 -33
  326. package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +0 -1
  327. package/lib/rust-crypto/CrossSigningIdentity.js +0 -157
  328. package/lib/rust-crypto/CrossSigningIdentity.js.map +0 -1
  329. package/lib/rust-crypto/DehydratedDeviceManager.d.ts +0 -98
  330. package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +0 -1
  331. package/lib/rust-crypto/DehydratedDeviceManager.js +0 -285
  332. package/lib/rust-crypto/DehydratedDeviceManager.js.map +0 -1
  333. package/lib/rust-crypto/KeyClaimManager.d.ts +0 -33
  334. package/lib/rust-crypto/KeyClaimManager.d.ts.map +0 -1
  335. package/lib/rust-crypto/KeyClaimManager.js +0 -82
  336. package/lib/rust-crypto/KeyClaimManager.js.map +0 -1
  337. package/lib/rust-crypto/OutgoingRequestProcessor.d.ts +0 -43
  338. package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +0 -1
  339. package/lib/rust-crypto/OutgoingRequestProcessor.js +0 -195
  340. package/lib/rust-crypto/OutgoingRequestProcessor.js.map +0 -1
  341. package/lib/rust-crypto/OutgoingRequestsManager.d.ts +0 -47
  342. package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +0 -1
  343. package/lib/rust-crypto/OutgoingRequestsManager.js +0 -148
  344. package/lib/rust-crypto/OutgoingRequestsManager.js.map +0 -1
  345. package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +0 -120
  346. package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +0 -1
  347. package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +0 -467
  348. package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +0 -1
  349. package/lib/rust-crypto/RoomEncryptor.d.ts +0 -98
  350. package/lib/rust-crypto/RoomEncryptor.d.ts.map +0 -1
  351. package/lib/rust-crypto/RoomEncryptor.js +0 -299
  352. package/lib/rust-crypto/RoomEncryptor.js.map +0 -1
  353. package/lib/rust-crypto/backup.d.ts +0 -254
  354. package/lib/rust-crypto/backup.d.ts.map +0 -1
  355. package/lib/rust-crypto/backup.js +0 -837
  356. package/lib/rust-crypto/backup.js.map +0 -1
  357. package/lib/rust-crypto/constants.d.ts +0 -3
  358. package/lib/rust-crypto/constants.d.ts.map +0 -1
  359. package/lib/rust-crypto/constants.js +0 -19
  360. package/lib/rust-crypto/constants.js.map +0 -1
  361. package/lib/rust-crypto/device-converter.d.ts +0 -28
  362. package/lib/rust-crypto/device-converter.d.ts.map +0 -1
  363. package/lib/rust-crypto/device-converter.js +0 -123
  364. package/lib/rust-crypto/device-converter.js.map +0 -1
  365. package/lib/rust-crypto/index.d.ts +0 -61
  366. package/lib/rust-crypto/index.d.ts.map +0 -1
  367. package/lib/rust-crypto/index.js +0 -152
  368. package/lib/rust-crypto/index.js.map +0 -1
  369. package/lib/rust-crypto/libolm_migration.d.ts +0 -81
  370. package/lib/rust-crypto/libolm_migration.d.ts.map +0 -1
  371. package/lib/rust-crypto/libolm_migration.js +0 -459
  372. package/lib/rust-crypto/libolm_migration.js.map +0 -1
  373. package/lib/rust-crypto/rust-crypto.d.ts +0 -556
  374. package/lib/rust-crypto/rust-crypto.d.ts.map +0 -1
  375. package/lib/rust-crypto/rust-crypto.js +0 -2016
  376. package/lib/rust-crypto/rust-crypto.js.map +0 -1
  377. package/lib/rust-crypto/secret-storage.d.ts +0 -22
  378. package/lib/rust-crypto/secret-storage.d.ts.map +0 -1
  379. package/lib/rust-crypto/secret-storage.js +0 -63
  380. package/lib/rust-crypto/secret-storage.js.map +0 -1
  381. package/lib/rust-crypto/verification.d.ts +0 -319
  382. package/lib/rust-crypto/verification.d.ts.map +0 -1
  383. package/lib/rust-crypto/verification.js +0 -816
  384. package/lib/rust-crypto/verification.js.map +0 -1
  385. package/lib/secret-storage.d.ts +0 -370
  386. package/lib/secret-storage.d.ts.map +0 -1
  387. package/lib/secret-storage.js +0 -466
  388. package/lib/secret-storage.js.map +0 -1
  389. package/src/@types/crypto.ts +0 -73
  390. package/src/@types/matrix-sdk-crypto-wasm.d.ts +0 -44
  391. package/src/common-crypto/CryptoBackend.ts +0 -302
  392. package/src/common-crypto/README.md +0 -4
  393. package/src/common-crypto/key-passphrase.ts +0 -43
  394. package/src/crypto/CrossSigning.ts +0 -773
  395. package/src/crypto/DeviceList.ts +0 -989
  396. package/src/crypto/EncryptionSetup.ts +0 -351
  397. package/src/crypto/OlmDevice.ts +0 -1500
  398. package/src/crypto/OutgoingRoomKeyRequestManager.ts +0 -485
  399. package/src/crypto/RoomList.ts +0 -70
  400. package/src/crypto/SecretSharing.ts +0 -240
  401. package/src/crypto/SecretStorage.ts +0 -136
  402. package/src/crypto/aes.ts +0 -23
  403. package/src/crypto/algorithms/base.ts +0 -236
  404. package/src/crypto/algorithms/index.ts +0 -20
  405. package/src/crypto/algorithms/megolm.ts +0 -2216
  406. package/src/crypto/algorithms/olm.ts +0 -381
  407. package/src/crypto/api.ts +0 -70
  408. package/src/crypto/backup.ts +0 -922
  409. package/src/crypto/crypto.ts +0 -18
  410. package/src/crypto/dehydration.ts +0 -272
  411. package/src/crypto/device-converter.ts +0 -45
  412. package/src/crypto/deviceinfo.ts +0 -158
  413. package/src/crypto/index.ts +0 -4414
  414. package/src/crypto/key_passphrase.ts +0 -42
  415. package/src/crypto/keybackup.ts +0 -47
  416. package/src/crypto/olmlib.ts +0 -539
  417. package/src/crypto/recoverykey.ts +0 -18
  418. package/src/crypto/store/base.ts +0 -348
  419. package/src/crypto/store/indexeddb-crypto-store-backend.ts +0 -1250
  420. package/src/crypto/store/indexeddb-crypto-store.ts +0 -845
  421. package/src/crypto/store/localStorage-crypto-store.ts +0 -579
  422. package/src/crypto/store/memory-crypto-store.ts +0 -680
  423. package/src/crypto/verification/Base.ts +0 -409
  424. package/src/crypto/verification/Error.ts +0 -76
  425. package/src/crypto/verification/IllegalMethod.ts +0 -50
  426. package/src/crypto/verification/QRCode.ts +0 -310
  427. package/src/crypto/verification/SAS.ts +0 -494
  428. package/src/crypto/verification/SASDecimal.ts +0 -37
  429. package/src/crypto/verification/request/Channel.ts +0 -34
  430. package/src/crypto/verification/request/InRoomChannel.ts +0 -371
  431. package/src/crypto/verification/request/ToDeviceChannel.ts +0 -354
  432. package/src/crypto/verification/request/VerificationRequest.ts +0 -976
  433. package/src/crypto-api/CryptoEvent.ts +0 -93
  434. package/src/crypto-api/CryptoEventHandlerMap.ts +0 -32
  435. package/src/crypto-api/index.ts +0 -1175
  436. package/src/crypto-api/key-passphrase.ts +0 -58
  437. package/src/crypto-api/keybackup.ts +0 -115
  438. package/src/crypto-api/recovery-key.ts +0 -69
  439. package/src/crypto-api/verification.ts +0 -408
  440. package/src/rendezvous/MSC4108SignInWithQR.ts +0 -444
  441. package/src/rendezvous/RendezvousChannel.ts +0 -48
  442. package/src/rendezvous/RendezvousCode.ts +0 -25
  443. package/src/rendezvous/RendezvousError.ts +0 -26
  444. package/src/rendezvous/RendezvousFailureReason.ts +0 -49
  445. package/src/rendezvous/RendezvousIntent.ts +0 -20
  446. package/src/rendezvous/RendezvousTransport.ts +0 -58
  447. package/src/rendezvous/channels/MSC4108SecureChannel.ts +0 -270
  448. package/src/rendezvous/channels/index.ts +0 -17
  449. package/src/rendezvous/index.ts +0 -25
  450. package/src/rendezvous/transports/MSC4108RendezvousSession.ts +0 -270
  451. package/src/rendezvous/transports/index.ts +0 -17
  452. package/src/rust-crypto/CrossSigningIdentity.ts +0 -183
  453. package/src/rust-crypto/DehydratedDeviceManager.ts +0 -306
  454. package/src/rust-crypto/KeyClaimManager.ts +0 -86
  455. package/src/rust-crypto/OutgoingRequestProcessor.ts +0 -236
  456. package/src/rust-crypto/OutgoingRequestsManager.ts +0 -143
  457. package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +0 -501
  458. package/src/rust-crypto/RoomEncryptor.ts +0 -352
  459. package/src/rust-crypto/backup.ts +0 -881
  460. package/src/rust-crypto/constants.ts +0 -18
  461. package/src/rust-crypto/device-converter.ts +0 -128
  462. package/src/rust-crypto/index.ts +0 -237
  463. package/src/rust-crypto/libolm_migration.ts +0 -530
  464. package/src/rust-crypto/rust-crypto.ts +0 -2205
  465. package/src/rust-crypto/secret-storage.ts +0 -60
  466. package/src/rust-crypto/verification.ts +0 -830
  467. package/src/secret-storage.ts +0 -693
@@ -1 +0,0 @@
1
- {"version":3,"file":"verification.js","names":["RustSdkCryptoJs","QrState","VerificationPhase","VerificationRequestEvent","VerifierEvent","TypedEventEmitter","TypedReEmitter","EventType","MsgType","defer","VerificationMethod","RustVerificationRequest","constructor","olmMachine","inner","outgoingRequestProcessor","supportedVerificationMethods","_defineProperty","reEmitter","weakThis","WeakRef","registerChangesCallback","_asyncToGenerator","_weakThis$deref","deref","onChange","verification","getVerification","Sas","_verifier","undefined","RustQrCodeVerifier","setVerifier","RustSASVerifier","replaceInner","Qr","emit","Change","verifier","stopReEmitting","reEmit","transactionId","flowId","roomId","_this$inner$roomId","toString","initiatedByMe","weStarted","otherUserId","otherDeviceId","_this$inner$otherDevi","getOtherDevice","_this","getDevice","isSelfVerification","phase","VerificationRequestPhase","Created","Requested","Ready","_accepting","Transitioned","Error","verificationPhase","Done","Cancelled","concat","pending","isPassive","accepting","declining","_cancelling","timeout","timeRemainingMillis","methods","chosenMethod","Started","Reciprocate","otherPartySupportsMethod","method","theirMethods","theirSupportedMethods","requiredMethod","verificationMethodsByIdentifier","some","m","accept","_this2","req","acceptWithMethods","map","verificationMethodIdentifierToMethod","makeOutgoingRequest","cancel","params","_this3","beginKeyVerification","targetDevice","startVerification","_this4","res","startSas","scanQRCode","uint8Array","_this5","scan","QrCodeScan","fromBytes","Uint8ClampedArray","scanQrCode","reciprocate","getQRCodeBytes","generateQRCode","_this6","innerVerifier","generateQrCode","Buffer","from","toBytes","cancellationCode","_this$inner$cancelInf","_this$inner$cancelInf2","cancelInfo","cancelCode","cancellingUserId","cancelledbyUs","userId","BaseRustVerifer","completionDeferred","_weakThis$deref2","promise","catch","isDone","resolve","isCancelled","reject","reason","hasBeenCancelled","e","getShowSasCallbacks","getReciprocateQrCodeCallbacks","callbacks","hasBeenScanned","confirm","confirmScanning","verify","_this7","ShowReciprocateQr","state","Scanned","Confirmed","Reciprocated","_this8","_verificationRequest","_this9","sendAccept","_this10","_this11","emoji","decimal","decimals","sas","symbol","description","_confirm","requests","apply","arguments","mismatch","request","cancelWithCode","ShowSas","_weakThis$deref3","SasV1","ScanQrCode","QrCodeScanV1","ShowQrCode","QrCodeShowV1","ReciprocateV1","meth","isVerificationEvent","event","getType","KeyVerificationCancel","KeyVerificationDone","KeyVerificationMac","KeyVerificationStart","KeyVerificationKey","KeyVerificationReady","KeyVerificationAccept","RoomMessage","getContent","msgtype","KeyVerificationRequest"],"sources":["../../src/rust-crypto/verification.ts"],"sourcesContent":["/*\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport * as RustSdkCryptoJs from \"@matrix-org/matrix-sdk-crypto-wasm\";\nimport { QrState } from \"@matrix-org/matrix-sdk-crypto-wasm\";\n\nimport {\n GeneratedSas,\n ShowQrCodeCallbacks,\n ShowSasCallbacks,\n VerificationPhase,\n VerificationRequest,\n VerificationRequestEvent,\n VerificationRequestEventHandlerMap,\n Verifier,\n VerifierEvent,\n VerifierEventHandlerMap,\n} from \"../crypto-api/verification.ts\";\nimport { TypedEventEmitter } from \"../models/typed-event-emitter.ts\";\nimport { OutgoingRequest, OutgoingRequestProcessor } from \"./OutgoingRequestProcessor.ts\";\nimport { TypedReEmitter } from \"../ReEmitter.ts\";\nimport { MatrixEvent } from \"../models/event.ts\";\nimport { EventType, MsgType } from \"../@types/event.ts\";\nimport { defer, IDeferred } from \"../utils.ts\";\nimport { VerificationMethod } from \"../types.ts\";\n\n/**\n * An incoming, or outgoing, request to verify a user or a device via cross-signing.\n *\n * @internal\n */\nexport class RustVerificationRequest\n extends TypedEventEmitter<VerificationRequestEvent, VerificationRequestEventHandlerMap>\n implements VerificationRequest\n{\n /** a reëmitter which relays VerificationRequestEvent.Changed events emitted by the verifier */\n private readonly reEmitter: TypedReEmitter<VerificationRequestEvent, VerificationRequestEventHandlerMap>;\n\n /** Are we in the process of sending an `m.key.verification.ready` event? */\n private _accepting = false;\n\n /** Are we in the process of sending an `m.key.verification.cancellation` event? */\n private _cancelling = false;\n\n private _verifier: undefined | RustSASVerifier | RustQrCodeVerifier;\n\n /**\n * Construct a new RustVerificationRequest to wrap the rust-level `VerificationRequest`.\n *\n * @param olmMachine - The `OlmMachine` from the underlying rust crypto sdk.\n * @param inner - VerificationRequest from the Rust SDK.\n * @param outgoingRequestProcessor - `OutgoingRequestProcessor` to use for making outgoing HTTP requests.\n * @param supportedVerificationMethods - Verification methods to use when `accept()` is called.\n */\n public constructor(\n private readonly olmMachine: RustSdkCryptoJs.OlmMachine,\n private readonly inner: RustSdkCryptoJs.VerificationRequest,\n private readonly outgoingRequestProcessor: OutgoingRequestProcessor,\n private readonly supportedVerificationMethods: string[],\n ) {\n super();\n this.reEmitter = new TypedReEmitter(this);\n\n // Obviously, the Rust object maintains a reference to the callback function. If the callback function maintains\n // a reference to the Rust object, then we have a reference cycle which means that `RustVerificationRequest`\n // will never be garbage-collected, and hence the underlying rust object will never be freed.\n //\n // To avoid this reference cycle, use a weak reference in the callback function. If the `RustVerificationRequest`\n // gets garbage-collected, then there is nothing to update!\n const weakThis = new WeakRef(this);\n inner.registerChangesCallback(async () => weakThis.deref()?.onChange());\n }\n\n /**\n * Hook which is called when the underlying rust class notifies us that there has been a change.\n */\n private onChange(): void {\n const verification: RustSdkCryptoJs.Qr | RustSdkCryptoJs.Sas | undefined = this.inner.getVerification();\n\n // Set the _verifier object (wrapping the rust `Verification` as a js-sdk Verifier) if:\n // - we now have a `Verification` where we lacked one before\n // - we have transitioned from QR to SAS\n // - we are verifying with SAS, but we need to replace our verifier with a new one because both parties\n // tried to start verification at the same time, and we lost the tie breaking\n if (verification instanceof RustSdkCryptoJs.Sas) {\n if (this._verifier === undefined || this._verifier instanceof RustQrCodeVerifier) {\n this.setVerifier(new RustSASVerifier(verification, this, this.outgoingRequestProcessor));\n } else if (this._verifier instanceof RustSASVerifier) {\n this._verifier.replaceInner(verification);\n }\n } else if (verification instanceof RustSdkCryptoJs.Qr && this._verifier === undefined) {\n this.setVerifier(new RustQrCodeVerifier(verification, this.outgoingRequestProcessor));\n }\n\n this.emit(VerificationRequestEvent.Change);\n }\n\n private setVerifier(verifier: RustSASVerifier | RustQrCodeVerifier): void {\n // if we already have a verifier, unsubscribe from its events\n if (this._verifier) {\n this.reEmitter.stopReEmitting(this._verifier, [VerificationRequestEvent.Change]);\n }\n this._verifier = verifier;\n this.reEmitter.reEmit(this._verifier, [VerificationRequestEvent.Change]);\n }\n\n /**\n * Unique ID for this verification request.\n *\n * An ID isn't assigned until the first message is sent, so this may be `undefined` in the early phases.\n */\n public get transactionId(): string | undefined {\n return this.inner.flowId;\n }\n\n /**\n * For an in-room verification, the ID of the room.\n *\n * For to-device verifications, `undefined`.\n */\n public get roomId(): string | undefined {\n return this.inner.roomId?.toString();\n }\n\n /**\n * True if this request was initiated by the local client.\n *\n * For in-room verifications, the initiator is who sent the `m.key.verification.request` event.\n * For to-device verifications, the initiator is who sent the `m.key.verification.start` event.\n */\n public get initiatedByMe(): boolean {\n return this.inner.weStarted();\n }\n\n /** The user id of the other party in this request */\n public get otherUserId(): string {\n return this.inner.otherUserId.toString();\n }\n\n /** For verifications via to-device messages: the ID of the other device. Otherwise, undefined. */\n public get otherDeviceId(): string | undefined {\n return this.inner.otherDeviceId?.toString();\n }\n\n /** Get the other device involved in the verification, if it is known */\n private async getOtherDevice(): Promise<undefined | RustSdkCryptoJs.Device> {\n const otherDeviceId = this.inner.otherDeviceId;\n if (!otherDeviceId) {\n return undefined;\n }\n return await this.olmMachine.getDevice(this.inner.otherUserId, otherDeviceId, 5);\n }\n\n /** True if the other party in this request is one of this user's own devices. */\n public get isSelfVerification(): boolean {\n return this.inner.isSelfVerification();\n }\n\n /** current phase of the request. */\n public get phase(): VerificationPhase {\n const phase = this.inner.phase();\n\n switch (phase) {\n case RustSdkCryptoJs.VerificationRequestPhase.Created:\n case RustSdkCryptoJs.VerificationRequestPhase.Requested:\n return VerificationPhase.Requested;\n case RustSdkCryptoJs.VerificationRequestPhase.Ready:\n // if we're still sending the `m.key.verification.ready`, that counts as \"Requested\" in the js-sdk's\n // parlance.\n return this._accepting ? VerificationPhase.Requested : VerificationPhase.Ready;\n case RustSdkCryptoJs.VerificationRequestPhase.Transitioned:\n if (!this._verifier) {\n // this shouldn't happen, because the onChange handler should have created a _verifier.\n throw new Error(\"VerificationRequest: inner phase == Transitioned but no verifier!\");\n }\n return this._verifier.verificationPhase;\n case RustSdkCryptoJs.VerificationRequestPhase.Done:\n return VerificationPhase.Done;\n case RustSdkCryptoJs.VerificationRequestPhase.Cancelled:\n return VerificationPhase.Cancelled;\n }\n\n throw new Error(`Unknown verification phase ${phase}`);\n }\n\n /** True if the request has sent its initial event and needs more events to complete\n * (ie it is in phase `Requested`, `Ready` or `Started`).\n */\n public get pending(): boolean {\n if (this.inner.isPassive()) return false;\n const phase = this.phase;\n return phase !== VerificationPhase.Done && phase !== VerificationPhase.Cancelled;\n }\n\n /**\n * True if we have started the process of sending an `m.key.verification.ready` (but have not necessarily received\n * the remote echo which causes a transition to {@link VerificationPhase.Ready}.\n */\n public get accepting(): boolean {\n return this._accepting;\n }\n\n /**\n * True if we have started the process of sending an `m.key.verification.cancel` (but have not necessarily received\n * the remote echo which causes a transition to {@link VerificationPhase.Cancelled}).\n */\n public get declining(): boolean {\n return this._cancelling;\n }\n\n /**\n * The remaining number of ms before the request will be automatically cancelled.\n *\n * `null` indicates that there is no timeout\n */\n public get timeout(): number | null {\n return this.inner.timeRemainingMillis();\n }\n\n /** once the phase is Started (and !initiatedByMe) or Ready: common methods supported by both sides */\n public get methods(): string[] {\n throw new Error(\"not implemented\");\n }\n\n /** the method picked in the .start event */\n public get chosenMethod(): string | null {\n if (this.phase !== VerificationPhase.Started) return null;\n\n const verification: RustSdkCryptoJs.Qr | RustSdkCryptoJs.Sas | undefined = this.inner.getVerification();\n if (verification instanceof RustSdkCryptoJs.Sas) {\n return VerificationMethod.Sas;\n } else if (verification instanceof RustSdkCryptoJs.Qr) {\n return VerificationMethod.Reciprocate;\n } else {\n return null;\n }\n }\n\n /**\n * Checks whether the other party supports a given verification method.\n * This is useful when setting up the QR code UI, as it is somewhat asymmetrical:\n * if the other party supports SCAN_QR, we should show a QR code in the UI, and vice versa.\n * For methods that need to be supported by both ends, use the `methods` property.\n *\n * @param method - the method to check\n * @returns true if the other party said they supported the method\n */\n public otherPartySupportsMethod(method: string): boolean {\n const theirMethods: RustSdkCryptoJs.VerificationMethod[] | undefined = this.inner.theirSupportedMethods;\n if (theirMethods === undefined) {\n // no message from the other side yet\n return false;\n }\n\n const requiredMethod = verificationMethodsByIdentifier[method];\n return theirMethods.some((m) => m === requiredMethod);\n }\n\n /**\n * Accepts the request, sending a .ready event to the other party\n *\n * @returns Promise which resolves when the event has been sent.\n */\n public async accept(): Promise<void> {\n if (this.inner.phase() !== RustSdkCryptoJs.VerificationRequestPhase.Requested || this._accepting) {\n throw new Error(`Cannot accept a verification request in phase ${this.phase}`);\n }\n\n this._accepting = true;\n try {\n const req: undefined | OutgoingRequest = this.inner.acceptWithMethods(\n this.supportedVerificationMethods.map(verificationMethodIdentifierToMethod),\n );\n if (req) {\n await this.outgoingRequestProcessor.makeOutgoingRequest(req);\n }\n } finally {\n this._accepting = false;\n }\n\n // phase may have changed, so emit a 'change' event\n this.emit(VerificationRequestEvent.Change);\n }\n\n /**\n * Cancels the request, sending a cancellation to the other party\n *\n * @param params - Details for the cancellation, including `reason` (defaults to \"User declined\"), and `code`\n * (defaults to `m.user`).\n *\n * @returns Promise which resolves when the event has been sent.\n */\n public async cancel(params?: { reason?: string; code?: string }): Promise<void> {\n if (this._cancelling) {\n // already cancelling; do nothing\n return;\n }\n\n this._cancelling = true;\n try {\n const req: undefined | OutgoingRequest = this.inner.cancel();\n if (req) {\n await this.outgoingRequestProcessor.makeOutgoingRequest(req);\n }\n } finally {\n this._cancelling = false;\n }\n }\n\n /**\n * Create a {@link Verifier} to do this verification via a particular method.\n *\n * If a verifier has already been created for this request, returns that verifier.\n *\n * This does *not* send the `m.key.verification.start` event - to do so, call {@link Verifier#verifier} on the\n * returned verifier.\n *\n * If no previous events have been sent, pass in `targetDevice` to set who to direct this request to.\n *\n * @param method - the name of the verification method to use.\n * @param targetDevice - details of where to send the request to.\n *\n * @returns The verifier which will do the actual verification.\n */\n public beginKeyVerification(method: string, targetDevice?: { userId?: string; deviceId?: string }): Verifier {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Send an `m.key.verification.start` event to start verification via a particular method.\n *\n * Implementation of {@link Crypto.VerificationRequest#startVerification}.\n *\n * @param method - the name of the verification method to use.\n */\n public async startVerification(method: string): Promise<Verifier> {\n if (method !== VerificationMethod.Sas) {\n throw new Error(`Unsupported verification method ${method}`);\n }\n\n // make sure that we have a list of the other user's devices (workaround https://github.com/matrix-org/matrix-rust-sdk/issues/2896)\n if (!(await this.getOtherDevice())) {\n throw new Error(\"startVerification(): other device is unknown\");\n }\n\n const res:\n | [RustSdkCryptoJs.Sas, RustSdkCryptoJs.RoomMessageRequest | RustSdkCryptoJs.ToDeviceRequest]\n | undefined = await this.inner.startSas();\n\n if (res) {\n const [, req] = res;\n await this.outgoingRequestProcessor.makeOutgoingRequest(req);\n }\n\n // this should have triggered the onChange callback, and we should now have a verifier\n if (!this._verifier) {\n throw new Error(\"Still no verifier after startSas() call\");\n }\n\n return this._verifier;\n }\n\n /**\n * Start a QR code verification by providing a scanned QR code for this verification flow.\n *\n * Implementation of {@link Crypto.VerificationRequest#scanQRCode}.\n *\n * @param qrCodeData - the decoded QR code.\n * @returns A verifier; call `.verify()` on it to wait for the other side to complete the verification flow.\n */\n public async scanQRCode(uint8Array: Uint8Array): Promise<Verifier> {\n const scan = RustSdkCryptoJs.QrCodeScan.fromBytes(new Uint8ClampedArray(uint8Array));\n const verifier: RustSdkCryptoJs.Qr = await this.inner.scanQrCode(scan);\n\n // this should have triggered the onChange callback, and we should now have a verifier\n if (!this._verifier) {\n throw new Error(\"Still no verifier after scanQrCode() call\");\n }\n\n // we can immediately trigger the reciprocate request\n const req: undefined | OutgoingRequest = verifier.reciprocate();\n if (req) {\n await this.outgoingRequestProcessor.makeOutgoingRequest(req);\n }\n\n return this._verifier;\n }\n\n /**\n * The verifier which is doing the actual verification, once the method has been established.\n * Only defined when the `phase` is Started.\n */\n public get verifier(): Verifier | undefined {\n // It's possible for us to have a Verifier before a method has been chosen (in particular,\n // if we are showing a QR code which the other device has not yet scanned. At that point, we could\n // still switch to SAS).\n //\n // In that case, we should not return it to the application yet, since the application will not expect the\n // Verifier to be replaced during the lifetime of the VerificationRequest.\n return this.phase === VerificationPhase.Started ? this._verifier : undefined;\n }\n\n /**\n * Stub implementation of {@link Crypto.VerificationRequest#getQRCodeBytes}.\n */\n public getQRCodeBytes(): Buffer | undefined {\n throw new Error(\"getQRCodeBytes() unsupported in Rust Crypto; use generateQRCode() instead.\");\n }\n\n /**\n * Generate the data for a QR code allowing the other device to verify this one, if it supports it.\n *\n * Implementation of {@link Crypto.VerificationRequest#generateQRCode}.\n */\n public async generateQRCode(): Promise<Buffer | undefined> {\n // make sure that we have a list of the other user's devices (workaround https://github.com/matrix-org/matrix-rust-sdk/issues/2896)\n if (!(await this.getOtherDevice())) {\n throw new Error(\"generateQRCode(): other device is unknown\");\n }\n\n const innerVerifier: RustSdkCryptoJs.Qr | undefined = await this.inner.generateQrCode();\n // If we are unable to generate a QRCode, we return undefined\n if (!innerVerifier) return;\n\n return Buffer.from(innerVerifier.toBytes());\n }\n\n /**\n * If this request has been cancelled, the cancellation code (e.g `m.user`) which is responsible for cancelling\n * this verification.\n */\n public get cancellationCode(): string | null {\n return this.inner.cancelInfo?.cancelCode() ?? null;\n }\n\n /**\n * The id of the user that cancelled the request.\n *\n * Only defined when phase is Cancelled\n */\n public get cancellingUserId(): string | undefined {\n const cancelInfo = this.inner.cancelInfo;\n if (!cancelInfo) {\n return undefined;\n } else if (cancelInfo.cancelledbyUs()) {\n return this.olmMachine.userId.toString();\n } else {\n return this.inner.otherUserId.toString();\n }\n }\n}\n\n/** Common base class for `Verifier` implementations which wrap rust classes.\n *\n * The generic parameter `InnerType` is the type of the rust Verification class which we wrap.\n *\n * @internal\n */\nabstract class BaseRustVerifer<InnerType extends RustSdkCryptoJs.Qr | RustSdkCryptoJs.Sas> extends TypedEventEmitter<\n VerifierEvent | VerificationRequestEvent,\n VerifierEventHandlerMap & VerificationRequestEventHandlerMap\n> {\n /** A deferred which completes when the verification completes (or rejects when it is cancelled/fails) */\n protected readonly completionDeferred: IDeferred<void>;\n\n public constructor(\n protected inner: InnerType,\n protected readonly outgoingRequestProcessor: OutgoingRequestProcessor,\n ) {\n super();\n\n this.completionDeferred = defer();\n\n // As with RustVerificationRequest, we need to avoid a reference cycle.\n // See the comments in RustVerificationRequest.\n const weakThis = new WeakRef(this);\n inner.registerChangesCallback(async () => weakThis.deref()?.onChange());\n\n // stop the runtime complaining if nobody catches a failure\n this.completionDeferred.promise.catch(() => null);\n }\n\n /**\n * Hook which is called when the underlying rust class notifies us that there has been a change.\n *\n * Can be overridden by subclasses to see if we can notify the application about an update. The overriding method\n * must call `super.onChange()`.\n */\n protected onChange(): void {\n if (this.inner.isDone()) {\n this.completionDeferred.resolve(undefined);\n } else if (this.inner.isCancelled()) {\n const cancelInfo = this.inner.cancelInfo()!;\n this.completionDeferred.reject(\n new Error(\n `Verification cancelled by ${\n cancelInfo.cancelledbyUs() ? \"us\" : \"them\"\n } with code ${cancelInfo.cancelCode()}: ${cancelInfo.reason()}`,\n ),\n );\n }\n\n this.emit(VerificationRequestEvent.Change);\n }\n\n /**\n * Returns true if the verification has been cancelled, either by us or the other side.\n */\n public get hasBeenCancelled(): boolean {\n return this.inner.isCancelled();\n }\n\n /**\n * The ID of the other user in the verification process.\n */\n public get userId(): string {\n return this.inner.otherUserId.toString();\n }\n\n /**\n * Cancel a verification.\n *\n * We will send an `m.key.verification.cancel` if the verification is still in flight. The verification promise\n * will reject, and a {@link Crypto.VerifierEvent#Cancel} will be emitted.\n *\n * @param e - the reason for the cancellation.\n */\n public cancel(e?: Error): void {\n // TODO: something with `e`\n const req: undefined | OutgoingRequest = this.inner.cancel();\n if (req) {\n this.outgoingRequestProcessor.makeOutgoingRequest(req);\n }\n }\n\n /**\n * Get the details for an SAS verification, if one is in progress\n *\n * Returns `null`, unless this verifier is for a SAS-based verification and we are waiting for the user to confirm\n * the SAS matches.\n */\n public getShowSasCallbacks(): ShowSasCallbacks | null {\n return null;\n }\n\n /**\n * Get the details for reciprocating QR code verification, if one is in progress\n *\n * Returns `null`, unless this verifier is for reciprocating a QR-code-based verification (ie, the other user has\n * already scanned our QR code), and we are waiting for the user to confirm.\n */\n public getReciprocateQrCodeCallbacks(): ShowQrCodeCallbacks | null {\n return null;\n }\n}\n\n/** A Verifier instance which is used to show and/or scan a QR code. */\nexport class RustQrCodeVerifier extends BaseRustVerifer<RustSdkCryptoJs.Qr> implements Verifier {\n private callbacks: ShowQrCodeCallbacks | null = null;\n\n public constructor(inner: RustSdkCryptoJs.Qr, outgoingRequestProcessor: OutgoingRequestProcessor) {\n super(inner, outgoingRequestProcessor);\n }\n\n protected onChange(): void {\n // if the other side has scanned our QR code and sent us a \"reciprocate\" message, it is now time for the\n // application to prompt the user to confirm their side.\n if (this.callbacks === null && this.inner.hasBeenScanned()) {\n this.callbacks = {\n confirm: (): void => {\n this.confirmScanning();\n },\n cancel: (): void => this.cancel(),\n };\n }\n\n super.onChange();\n }\n\n /**\n * Start the key verification, if it has not already been started.\n *\n * @returns Promise which resolves when the verification has completed, or rejects if the verification is cancelled\n * or times out.\n */\n public async verify(): Promise<void> {\n // Some applications (hello, matrix-react-sdk) may not check if there is a `ShowQrCodeCallbacks` and instead\n // register a `ShowReciprocateQr` listener which they expect to be called once `.verify` is called.\n if (this.callbacks !== null) {\n this.emit(VerifierEvent.ShowReciprocateQr, this.callbacks);\n }\n // Nothing to do here but wait.\n await this.completionDeferred.promise;\n }\n\n /**\n * Calculate an appropriate VerificationPhase for a VerificationRequest where this is the verifier.\n *\n * This is abnormally complicated because a rust-side QR Code verifier can span several verification phases.\n */\n public get verificationPhase(): VerificationPhase {\n switch (this.inner.state()) {\n case QrState.Created:\n // we have created a QR for display; neither side has yet sent an `m.key.verification.start`.\n return VerificationPhase.Ready;\n case QrState.Scanned:\n // other side has scanned our QR and sent an `m.key.verification.start` with `m.reciprocate.v1`\n return VerificationPhase.Started;\n case QrState.Confirmed:\n // we have confirmed the other side's scan and sent an `m.key.verification.done`.\n //\n // However, the verification is not yet \"Done\", because we have to wait until we have received the\n // `m.key.verification.done` from the other side (in particular, we don't mark the device/identity as\n // verified until that happens). If we return \"Done\" too soon, we risk the user cancelling the flow.\n return VerificationPhase.Started;\n case QrState.Reciprocated:\n // although the rust SDK doesn't immediately send the `m.key.verification.start` on transition into this\n // state, `RustVerificationRequest.scanQrCode` immediately calls `reciprocate()` and does so, so in practice\n // we can treat the two the same.\n return VerificationPhase.Started;\n case QrState.Done:\n return VerificationPhase.Done;\n case QrState.Cancelled:\n return VerificationPhase.Cancelled;\n default:\n throw new Error(`Unknown qr code state ${this.inner.state()}`);\n }\n }\n\n /**\n * Get the details for reciprocating QR code verification, if one is in progress\n *\n * Returns `null`, unless this verifier is for reciprocating a QR-code-based verification (ie, the other user has\n * already scanned our QR code), and we are waiting for the user to confirm.\n */\n public getReciprocateQrCodeCallbacks(): ShowQrCodeCallbacks | null {\n return this.callbacks;\n }\n\n private async confirmScanning(): Promise<void> {\n const req: undefined | OutgoingRequest = this.inner.confirmScanning();\n if (req) {\n await this.outgoingRequestProcessor.makeOutgoingRequest(req);\n }\n }\n}\n\n/** A Verifier instance which is used if we are exchanging emojis */\nexport class RustSASVerifier extends BaseRustVerifer<RustSdkCryptoJs.Sas> implements Verifier {\n private callbacks: ShowSasCallbacks | null = null;\n\n public constructor(\n inner: RustSdkCryptoJs.Sas,\n _verificationRequest: RustVerificationRequest,\n outgoingRequestProcessor: OutgoingRequestProcessor,\n ) {\n super(inner, outgoingRequestProcessor);\n }\n\n /**\n * Start the key verification, if it has not already been started.\n *\n * This means sending a `m.key.verification.start` if we are the first responder, or a `m.key.verification.accept`\n * if the other side has already sent a start event.\n *\n * @returns Promise which resolves when the verification has completed, or rejects if the verification is cancelled\n * or times out.\n */\n public async verify(): Promise<void> {\n await this.sendAccept();\n await this.completionDeferred.promise;\n }\n\n /**\n * Send the accept or start event, if it hasn't already been sent\n */\n private async sendAccept(): Promise<void> {\n const req: undefined | OutgoingRequest = this.inner.accept();\n if (req) {\n await this.outgoingRequestProcessor.makeOutgoingRequest(req);\n }\n }\n\n /** if we can now show the callbacks, do so */\n protected onChange(): void {\n super.onChange();\n\n if (this.callbacks === null) {\n const emoji = this.inner.emoji();\n const decimal = this.inner.decimals();\n\n if (emoji === undefined && decimal === undefined) {\n return;\n }\n\n const sas: GeneratedSas = {};\n if (emoji) {\n sas.emoji = emoji.map((e) => [e.symbol, e.description]);\n }\n if (decimal) {\n sas.decimal = [decimal[0], decimal[1], decimal[2]];\n }\n\n this.callbacks = {\n sas,\n confirm: async (): Promise<void> => {\n const requests: Array<OutgoingRequest> = await this.inner.confirm();\n for (const m of requests) {\n await this.outgoingRequestProcessor.makeOutgoingRequest(m);\n }\n },\n mismatch: (): void => {\n const request = this.inner.cancelWithCode(\"m.mismatched_sas\");\n if (request) {\n this.outgoingRequestProcessor.makeOutgoingRequest(request);\n }\n },\n cancel: (): void => {\n const request = this.inner.cancelWithCode(\"m.user\");\n if (request) {\n this.outgoingRequestProcessor.makeOutgoingRequest(request);\n }\n },\n };\n this.emit(VerifierEvent.ShowSas, this.callbacks);\n }\n }\n\n /**\n * Calculate an appropriate VerificationPhase for a VerificationRequest where this is the verifier.\n */\n public get verificationPhase(): VerificationPhase {\n return VerificationPhase.Started;\n }\n\n /**\n * Get the details for an SAS verification, if one is in progress\n *\n * Returns `null`, unless this verifier is for a SAS-based verification and we are waiting for the user to confirm\n * the SAS matches.\n */\n public getShowSasCallbacks(): ShowSasCallbacks | null {\n return this.callbacks;\n }\n\n /**\n * Replace the inner Rust verifier with a different one.\n *\n * @param inner - the new Rust verifier\n * @internal\n */\n public replaceInner(inner: RustSdkCryptoJs.Sas): void {\n if (this.inner != inner) {\n this.inner = inner;\n\n // As with RustVerificationRequest, we need to avoid a reference cycle.\n // See the comments in RustVerificationRequest.\n const weakThis = new WeakRef(this);\n inner.registerChangesCallback(async () => weakThis.deref()?.onChange());\n\n // replaceInner will only get called if we started the verification at the same time as the other side, and we lost\n // the tie breaker. So we need to re-accept their verification.\n this.sendAccept();\n this.onChange();\n }\n }\n}\n\n/** For each specced verification method, the rust-side `VerificationMethod` corresponding to it */\nconst verificationMethodsByIdentifier: Record<string, RustSdkCryptoJs.VerificationMethod> = {\n [VerificationMethod.Sas]: RustSdkCryptoJs.VerificationMethod.SasV1,\n [VerificationMethod.ScanQrCode]: RustSdkCryptoJs.VerificationMethod.QrCodeScanV1,\n [VerificationMethod.ShowQrCode]: RustSdkCryptoJs.VerificationMethod.QrCodeShowV1,\n [VerificationMethod.Reciprocate]: RustSdkCryptoJs.VerificationMethod.ReciprocateV1,\n};\n\n/**\n * Convert a specced verification method identifier into a rust-side `VerificationMethod`.\n *\n * @param method - specced method identifier, for example `m.sas.v1`.\n * @returns Rust-side `VerificationMethod` corresponding to `method`.\n * @throws An error if the method is unknown.\n *\n * @internal\n */\nexport function verificationMethodIdentifierToMethod(method: string): RustSdkCryptoJs.VerificationMethod {\n const meth = verificationMethodsByIdentifier[method];\n if (meth === undefined) {\n throw new Error(`Unknown verification method ${method}`);\n }\n return meth;\n}\n\n/**\n * Return true if the event's type matches that of an in-room verification event\n *\n * @param event - MatrixEvent\n * @returns\n *\n * @internal\n */\nexport function isVerificationEvent(event: MatrixEvent): boolean {\n switch (event.getType()) {\n case EventType.KeyVerificationCancel:\n case EventType.KeyVerificationDone:\n case EventType.KeyVerificationMac:\n case EventType.KeyVerificationStart:\n case EventType.KeyVerificationKey:\n case EventType.KeyVerificationReady:\n case EventType.KeyVerificationAccept:\n return true;\n case EventType.RoomMessage:\n return event.getContent().msgtype === MsgType.KeyVerificationRequest;\n default:\n return false;\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,eAAe,MAAM,oCAAoC;AACrE,SAASC,OAAO,QAAQ,oCAAoC;AAE5D,SAIIC,iBAAiB,EAEjBC,wBAAwB,EAGxBC,aAAa,QAEV,+BAA+B;AACtC,SAASC,iBAAiB,QAAQ,kCAAkC;AAEpE,SAASC,cAAc,QAAQ,iBAAiB;AAEhD,SAASC,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,KAAK,QAAmB,aAAa;AAC9C,SAASC,kBAAkB,QAAQ,aAAa;;AAEhD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,SACxBN,iBAAiB,CAE7B;EAYI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACWO,WAAWA,CACGC,UAAsC,EACtCC,KAA0C,EAC1CC,wBAAkD,EAClDC,4BAAsC,EACzD;IACE,KAAK,CAAC,CAAC;IAAC,KALSH,UAAsC,GAAtCA,UAAsC;IAAA,KACtCC,KAA0C,GAA1CA,KAA0C;IAAA,KAC1CC,wBAAkD,GAAlDA,wBAAkD;IAAA,KAClDC,4BAAsC,GAAtCA,4BAAsC;IAvB3D;IAAAC,eAAA;IAGA;IAAAA,eAAA,qBACqB,KAAK;IAE1B;IAAAA,eAAA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ACjC,KAAKpL,SAAS,CAACqL,oBAAoB;IACnC,KAAKrL,SAAS,CAACsL,qBAAqB;MAChC,OAAO,IAAI;IACf,KAAKtL,SAAS,CAACuL,WAAW;MACtB,OAAOT,KAAK,CAACU,UAAU,CAAC,CAAC,CAACC,OAAO,KAAKxL,OAAO,CAACyL,sBAAsB;IACxE;MACI,OAAO,KAAK;EACpB;AACJ","ignoreList":[]}
@@ -1,370 +0,0 @@
1
- /**
2
- * Implementation of server-side secret storage
3
- *
4
- * @see https://spec.matrix.org/v1.6/client-server-api/#storage
5
- */
6
- import { TypedEventEmitter } from "./models/typed-event-emitter.ts";
7
- import { ClientEvent, ClientEventHandlerMap } from "./client.ts";
8
- import { AESEncryptedSecretStoragePayload } from "./@types/AESEncryptedSecretStoragePayload.ts";
9
- export declare const SECRET_STORAGE_ALGORITHM_V1_AES = "m.secret_storage.v1.aes-hmac-sha2";
10
- /**
11
- * Common base interface for Secret Storage Keys.
12
- *
13
- * The common properties for all encryption keys used in server-side secret storage.
14
- *
15
- * @see https://spec.matrix.org/v1.6/client-server-api/#key-storage
16
- */
17
- export interface SecretStorageKeyDescriptionCommon {
18
- /** A human-readable name for this key. */
19
- name: string;
20
- /** The encryption algorithm used with this key. */
21
- algorithm: string;
22
- /** Information for deriving this key from a passphrase. */
23
- passphrase: PassphraseInfo;
24
- }
25
- /**
26
- * Properties for a SSSS key using the `m.secret_storage.v1.aes-hmac-sha2` algorithm.
27
- *
28
- * Corresponds to `AesHmacSha2KeyDescription` in the specification.
29
- *
30
- * @see https://spec.matrix.org/v1.6/client-server-api/#msecret_storagev1aes-hmac-sha2
31
- */
32
- export interface SecretStorageKeyDescriptionAesV1 extends SecretStorageKeyDescriptionCommon {
33
- /** The 16-byte AES initialization vector, encoded as base64. */
34
- iv: string;
35
- /** The MAC of the result of encrypting 32 bytes of 0, encoded as base64. */
36
- mac: string;
37
- }
38
- /**
39
- * Union type for secret storage keys.
40
- *
41
- * For now, this is only {@link SecretStorageKeyDescriptionAesV1}, but other interfaces may be added in future.
42
- */
43
- export type SecretStorageKeyDescription = SecretStorageKeyDescriptionAesV1;
44
- /**
45
- * Information on how to generate the key from a passphrase.
46
- *
47
- * @see https://spec.matrix.org/v1.6/client-server-api/#deriving-keys-from-passphrases
48
- */
49
- export interface PassphraseInfo {
50
- /** The algorithm to be used to derive the key. */
51
- algorithm: "m.pbkdf2";
52
- /** The number of PBKDF2 iterations to use. */
53
- iterations: number;
54
- /** The salt to be used for PBKDF2. */
55
- salt: string;
56
- /** The number of bits to generate. Defaults to 256. */
57
- bits?: number;
58
- }
59
- /**
60
- * Options for {@link ServerSideSecretStorageImpl#addKey}.
61
- */
62
- export interface AddSecretStorageKeyOpts {
63
- /** Information for deriving the key from a passphrase if any. */
64
- passphrase?: PassphraseInfo;
65
- /** Optional name of the key. */
66
- name?: string;
67
- /** The private key. Will be used to generate the key check values in the key info; it will not be stored on the server */
68
- key: Uint8Array;
69
- }
70
- /**
71
- * Return type for {@link ServerSideSecretStorageImpl#getKey}.
72
- */
73
- export type SecretStorageKeyTuple = [keyId: string, keyInfo: SecretStorageKeyDescription];
74
- /**
75
- * Return type for {@link ServerSideSecretStorageImpl#addKey}.
76
- */
77
- export type SecretStorageKeyObject = {
78
- /** The ID of the key */
79
- keyId: string;
80
- /** details about the key */
81
- keyInfo: SecretStorageKeyDescription;
82
- };
83
- /** Interface for managing account data on the server.
84
- *
85
- * A subset of {@link MatrixClient}.
86
- */
87
- export interface AccountDataClient extends TypedEventEmitter<ClientEvent.AccountData, ClientEventHandlerMap> {
88
- /**
89
- * Get account data event of given type for the current user. This variant
90
- * gets account data directly from the homeserver if the local store is not
91
- * ready, which can be useful very early in startup before the initial sync.
92
- *
93
- * @param eventType - The type of account data
94
- * @returns The contents of the given account data event, or `null` if the event is not found
95
- */
96
- getAccountDataFromServer: <T extends Record<string, any>>(eventType: string) => Promise<T | null>;
97
- /**
98
- * Set account data event for the current user, with retries
99
- *
100
- * @param eventType - The type of account data
101
- * @param content - the content object to be set
102
- * @returns an empty object
103
- */
104
- setAccountData: (eventType: string, content: any) => Promise<{}>;
105
- }
106
- /**
107
- * Application callbacks for use with {@link SecretStorage.ServerSideSecretStorageImpl}
108
- */
109
- export interface SecretStorageCallbacks {
110
- /**
111
- * Called to retrieve a secret storage encryption key
112
- *
113
- * Before a secret can be stored in server-side storage, it must be encrypted with one or more
114
- * keys. Similarly, after it has been retrieved from storage, it must be decrypted with one of
115
- * the keys it was encrypted with. These encryption keys are known as "secret storage keys".
116
- *
117
- * Descriptions of the secret storage keys are also stored in server-side storage, per the
118
- * [matrix specification](https://spec.matrix.org/v1.6/client-server-api/#key-storage), so
119
- * before a key can be used in this way, it must have been stored on the server. This is
120
- * done via {@link ServerSideSecretStorage#addKey}.
121
- *
122
- * Obviously the keys themselves are not stored server-side, so the js-sdk calls this callback
123
- * in order to retrieve a secret storage key from the application.
124
- *
125
- * @param keys - An options object, containing only the property `keys`.
126
- *
127
- * @param name - the name of the *secret* (NB: not the encryption key) being stored or retrieved.
128
- * This is the "event type" stored in account data.
129
- *
130
- * @returns a pair [`keyId`, `privateKey`], where `keyId` is one of the keys from the `keys` parameter,
131
- * and `privateKey` is the raw private encryption key, as appropriate for the encryption algorithm.
132
- * (For `m.secret_storage.v1.aes-hmac-sha2`, it is the input to an HKDF as defined in the
133
- * [specification](https://spec.matrix.org/v1.6/client-server-api/#msecret_storagev1aes-hmac-sha2).)
134
- *
135
- * Alternatively, if none of the keys are known, may return `null` — in which case the original
136
- * storage/retrieval operation will fail with an exception.
137
- */
138
- getSecretStorageKey?: (keys: {
139
- /**
140
- * details of the secret storage keys required: a map from the key ID
141
- * (excluding the `m.secret_storage.key.` prefix) to details of the key.
142
- *
143
- * When storing a secret, `keys` will contain exactly one entry; this method will be called
144
- * once for each secret storage key to be used for encryption.
145
- *
146
- * For secret retrieval, `keys` may contain several entries, and the application can return
147
- * any one of the requested keys.
148
- */
149
- keys: Record<string, SecretStorageKeyDescription>;
150
- }, name: string) => Promise<[string, Uint8Array] | null>;
151
- }
152
- /**
153
- * Interface provided by SecretStorage implementations
154
- *
155
- * Normally this will just be an {@link ServerSideSecretStorageImpl}, but for backwards
156
- * compatibility some methods allow other implementations.
157
- */
158
- export interface ServerSideSecretStorage {
159
- /**
160
- * Add a key for encrypting secrets.
161
- *
162
- * @param algorithm - the algorithm used by the key.
163
- * @param opts - the options for the algorithm. The properties used
164
- * depend on the algorithm given.
165
- * @param keyId - the ID of the key. If not given, a random
166
- * ID will be generated.
167
- *
168
- * @returns details about the key.
169
- */
170
- addKey(algorithm: string, opts: AddSecretStorageKeyOpts, keyId?: string): Promise<SecretStorageKeyObject>;
171
- /**
172
- * Get the key information for a given ID.
173
- *
174
- * @param keyId - The ID of the key to check
175
- * for. Defaults to the default key ID if not provided.
176
- * @returns If the key was found, the return value is an array of
177
- * the form [keyId, keyInfo]. Otherwise, null is returned.
178
- * XXX: why is this an array when addKey returns an object?
179
- */
180
- getKey(keyId?: string | null): Promise<SecretStorageKeyTuple | null>;
181
- /**
182
- * Check whether we have a key with a given ID.
183
- *
184
- * @param keyId - The ID of the key to check
185
- * for. Defaults to the default key ID if not provided.
186
- * @returns Whether we have the key.
187
- */
188
- hasKey(keyId?: string): Promise<boolean>;
189
- /**
190
- * Check whether a key matches what we expect based on the key info
191
- *
192
- * @param key - the key to check
193
- * @param info - the key info
194
- *
195
- * @returns whether or not the key matches
196
- */
197
- checkKey(key: Uint8Array, info: SecretStorageKeyDescriptionAesV1): Promise<boolean>;
198
- /**
199
- * Store an encrypted secret on the server.
200
- *
201
- * Details of the encryption keys to be used must previously have been stored in account data
202
- * (for example, via {@link ServerSideSecretStorage#addKey}.
203
- *
204
- * @param name - The name of the secret - i.e., the "event type" to be stored in the account data
205
- * @param secret - The secret contents.
206
- * @param keys - The IDs of the keys to use to encrypt the secret, or null/undefined to use the default key
207
- * (will throw if no default key is set).
208
- */
209
- store(name: string, secret: string, keys?: string[] | null): Promise<void>;
210
- /**
211
- * Get a secret from storage, and decrypt it.
212
- *
213
- * @param name - the name of the secret - i.e., the "event type" stored in the account data
214
- *
215
- * @returns the decrypted contents of the secret, or "undefined" if `name` is not found in
216
- * the user's account data.
217
- */
218
- get(name: string): Promise<string | undefined>;
219
- /**
220
- * Check if a secret is stored on the server.
221
- *
222
- * @param name - the name of the secret
223
- *
224
- * @returns map of key name to key info the secret is encrypted
225
- * with, or null if it is not present or not encrypted with a trusted
226
- * key
227
- */
228
- isStored(name: string): Promise<Record<string, SecretStorageKeyDescriptionAesV1> | null>;
229
- /**
230
- * Get the current default key ID for encrypting secrets.
231
- *
232
- * @returns The default key ID or null if no default key ID is set
233
- */
234
- getDefaultKeyId(): Promise<string | null>;
235
- /**
236
- * Set the default key ID for encrypting secrets.
237
- *
238
- * @param keyId - The new default key ID
239
- */
240
- setDefaultKeyId(keyId: string): Promise<void>;
241
- }
242
- /**
243
- * Implementation of Server-side secret storage.
244
- *
245
- * Secret *sharing* is *not* implemented here: this class is strictly about the storage component of
246
- * SSSS.
247
- *
248
- * @see https://spec.matrix.org/v1.6/client-server-api/#storage
249
- */
250
- export declare class ServerSideSecretStorageImpl implements ServerSideSecretStorage {
251
- private readonly accountDataAdapter;
252
- private readonly callbacks;
253
- /**
254
- * Construct a new `SecretStorage`.
255
- *
256
- * Normally, it is unnecessary to call this directly, since MatrixClient automatically constructs one.
257
- * However, it may be useful to construct a new `SecretStorage`, if custom `callbacks` are required, for example.
258
- *
259
- * @param accountDataAdapter - interface for fetching and setting account data on the server. Normally an instance
260
- * of {@link MatrixClient}.
261
- * @param callbacks - application level callbacks for retrieving secret keys
262
- */
263
- constructor(accountDataAdapter: AccountDataClient, callbacks: SecretStorageCallbacks);
264
- /**
265
- * Get the current default key ID for encrypting secrets.
266
- *
267
- * @returns The default key ID or null if no default key ID is set
268
- */
269
- getDefaultKeyId(): Promise<string | null>;
270
- /**
271
- * Set the default key ID for encrypting secrets.
272
- *
273
- * @param keyId - The new default key ID
274
- */
275
- setDefaultKeyId(keyId: string): Promise<void>;
276
- /**
277
- * Add a key for encrypting secrets.
278
- *
279
- * @param algorithm - the algorithm used by the key.
280
- * @param opts - the options for the algorithm. The properties used
281
- * depend on the algorithm given.
282
- * @param keyId - the ID of the key. If not given, a random
283
- * ID will be generated.
284
- *
285
- * @returns An object with:
286
- * keyId: the ID of the key
287
- * keyInfo: details about the key (iv, mac, passphrase)
288
- */
289
- addKey(algorithm: string, opts: AddSecretStorageKeyOpts, keyId?: string): Promise<SecretStorageKeyObject>;
290
- /**
291
- * Get the key information for a given ID.
292
- *
293
- * @param keyId - The ID of the key to check
294
- * for. Defaults to the default key ID if not provided.
295
- * @returns If the key was found, the return value is an array of
296
- * the form [keyId, keyInfo]. Otherwise, null is returned.
297
- * XXX: why is this an array when addKey returns an object?
298
- */
299
- getKey(keyId?: string | null): Promise<SecretStorageKeyTuple | null>;
300
- /**
301
- * Check whether we have a key with a given ID.
302
- *
303
- * @param keyId - The ID of the key to check
304
- * for. Defaults to the default key ID if not provided.
305
- * @returns Whether we have the key.
306
- */
307
- hasKey(keyId?: string): Promise<boolean>;
308
- /**
309
- * Check whether a key matches what we expect based on the key info
310
- *
311
- * @param key - the key to check
312
- * @param info - the key info
313
- *
314
- * @returns whether or not the key matches
315
- */
316
- checkKey(key: Uint8Array, info: SecretStorageKeyDescriptionAesV1): Promise<boolean>;
317
- /**
318
- * Store an encrypted secret on the server.
319
- *
320
- * Details of the encryption keys to be used must previously have been stored in account data
321
- * (for example, via {@link ServerSideSecretStorageImpl#addKey}. {@link SecretStorageCallbacks#getSecretStorageKey} will be called to obtain a secret storage
322
- * key to decrypt the secret.
323
- *
324
- * @param name - The name of the secret - i.e., the "event type" to be stored in the account data
325
- * @param secret - The secret contents.
326
- * @param keys - The IDs of the keys to use to encrypt the secret, or null/undefined to use the default key.
327
- */
328
- store(name: string, secret: string, keys?: string[] | null): Promise<void>;
329
- /**
330
- * Get a secret from storage, and decrypt it.
331
- *
332
- * {@link SecretStorageCallbacks#getSecretStorageKey} will be called to obtain a secret storage
333
- * key to decrypt the secret.
334
- *
335
- * @param name - the name of the secret - i.e., the "event type" stored in the account data
336
- *
337
- * @returns the decrypted contents of the secret, or "undefined" if `name` is not found in
338
- * the user's account data.
339
- */
340
- get(name: string): Promise<string | undefined>;
341
- /**
342
- * Check if a secret is stored on the server.
343
- *
344
- * @param name - the name of the secret
345
- *
346
- * @returns map of key name to key info the secret is encrypted
347
- * with, or null if it is not present or not encrypted with a trusted
348
- * key
349
- */
350
- isStored(name: string): Promise<Record<string, SecretStorageKeyDescriptionAesV1> | null>;
351
- private getSecretStorageKey;
352
- }
353
- /** trim trailing instances of '=' from a string
354
- *
355
- * @internal
356
- *
357
- * @param input - input string
358
- */
359
- export declare function trimTrailingEquals(input: string): string;
360
- /**
361
- * Calculate the MAC for checking the key.
362
- * See https://spec.matrix.org/v1.11/client-server-api/#msecret_storagev1aes-hmac-sha2, steps 3 and 4.
363
- *
364
- * @param key - the key to use
365
- * @param iv - The initialization vector as a base64-encoded string.
366
- * If omitted, a random initialization vector will be created.
367
- * @returns An object that contains, `mac` and `iv` properties.
368
- */
369
- export declare function calculateKeyCheck(key: Uint8Array, iv?: string): Promise<AESEncryptedSecretStoragePayload>;
370
- //# sourceMappingURL=secret-storage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secret-storage.d.ts","sourceRoot":"","sources":["../src/secret-storage.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAMjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAEhG,eAAO,MAAM,+BAA+B,sCAAsC,CAAC;AAEnF;;;;;;GAMG;AACH,MAAM,WAAW,iCAAiC;IAC9C,0CAA0C;IAE1C,IAAI,EAAE,MAAM,CAAC;IAEb,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAElB,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