* Element-R: Implement `CryptoApi.getVerificationRequestsToDeviceInProgress`
* Element-R: Implement `requestOwnUserVerification`
* init aliceClient *after* the fetch interceptors
* Initialise the test client separately for each test
* Avoid running all the tests twice
Currently all of these tests are running twice, with different client
configurations. That's not really adding much value; we just need to run
specific tests that way.
* Factor out functions for building responses
* Return uploaded keys from `/keys/query`
* Basic implementation of SAS verification in Rust
* Update the `verifier` *before* emitting `erificationRequestEvent.Change`
* remove dead code
* Tweaks to the integ test to conform to the spec
Rust is a bit more insistent than legacy crypto...
* Improve documentation on request*Verification
* Check more things in the integration test
* Create an E2EKeyResponder
* Test verification with custom method list
* Add a test for SAS cancellation
* Update spec/integ/crypto/verification.spec.ts
* Store cross signing keys in secret storage
* Update `bootstrapSecretStorage` doc
* Throw error when `createSecretStorageKey` is not set
* Move mocking functions
* Store cross signing keys and user signing keys
* Fix `awaitCrossSigningKeyUpload` documentation
* Remove useless comment
* Fix formatting after merge conflict
* add a test for incoming verification requests
* Move `VerificationRequestEvent` to crypto-api
* Move `VerificationPhase` to `crypto-api`
* Define `VerificationRequest` interface
* Implement `canAcceptVerificationRequest`
* Add `crypto.getCrossSigningStatus`
* Fix imports and boolean casting
* Moved `isStoredInSecretStorage` into a single function
* Review changes `CrossSigningStatus`
* Review changes for `cross-signing.spec.ts`
* Add test in case when cross signing is not setup
* Handle when the `crossSigningStatus` returned by the olmMachine is null
* Review changes for `crypto-api` documentation
* Update `cross-signing.spec.ts` according to review changes
* Moved and renamed `isStoredInSecretStorage`
* Remove noise in `CrossSigning.ts` imports
* Fix `returns` sentence in `secretStorageContainsCrossSigningKeys`
* Fix typos
* Add test for `secret-storage.ts`
* Improve documentation
* Add doc about fetch mock request name
* Add test for thread list stability around non-reply updates
* Fix thread list being ordered based on all updates
* Fix test
* Update spec/integ/matrix-client-event-timeline.spec.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Iterate
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Add new method `VerificationRequest.getQRCodeBytes`
... which requires fewer complicated classes than the existing `qrCodeData`
* Add new property `VerificationRequest.otherDeviceId`
... to save going via `.channel`
* Add more methods to `VerificationRequest`
... to avoid the need for `channel`
* Use new methods in integration tests
* Add `getShowSasCallbacks`, `getShowQrCodeCallbacks` to VerifierBase
... to avoid some type-casting
* Integration test for QR code verification
Followup to https://github.com/matrix-org/matrix-js-sdk/pull/3436: another
integration test, this time using the QR code flow
* Rename method
... it turns out not to be used quite as I thought.
* tests for new methods
* Use Object.defineProperty, and restore afterwards
Apparently global.crypto exists in some environments
* apply ts-ignore
* More test coverage
* fix bad merge
* Integration test for QR code verification
Followup to https://github.com/matrix-org/matrix-js-sdk/pull/3436: another
integration test, this time using the QR code flow
* Use Object.defineProperty, and restore afterwards
Apparently global.crypto exists in some environments
* apply ts-ignore
* remove stray comment
* Update spec/integ/crypto/verification.spec.ts
* Fix tests oversimplifying threads fixtures
* Check for unsigned thread_id in MatrixEvent::threadRootId
* Fix threads order being racy
* Make Sonar happier
* Iterate
* Move existing crypto integ tests into a subdirectory
* Factor out some common bits from `crypto.spec.ts`
* Integration test for device verification
* Ignore generated file in prettier
* Do not assume that a relation lives in main timeline if we do not know its parent
* For pagination, partition relations with unknown parents into a separate bucket
And only add them to relation map, no timelines
* Make addLiveEvents async and have it fetch parent events of unknown relations to not insert into the wrong timeline
* Fix tests not awaiting addLIveEvents
* Fix handling of thread roots in eventShouldLiveIn
* Fix types
* Fix tests
* Fix import
* Stash thread ID of relations in unsigned to be stashed in sync accumulator
* Persist after processing
* Revert "Persist after processing"
This reverts commit 05ed6409b3.
* Update unsigned field name to match MSC4023
* Persist after processing to store thread id in unsigned sync accumulator
* Add test
* Fix replayEvents getting doubled up due to Thread::addEvents being called in createThread and separately
* Fix test
* Switch to using UnstableValue
* Add comment
* Iterate
* Add `getUserDeviceInfo` to `CryptoBackend` and old crypto impl
* Add `getUserDeviceInfo` WIP impl to `rust-crypto`
* Add tests for `downloadUncached`
* WIP test
* Fix typo and use `downloadDeviceToJsDevice`
* Add `getUserDeviceInfo` to `client.ts`
* Use new `Device` class instead of `IDevice`
* Add tests for `device-convertor`
* Add method description for `isInRustUserIds` in `rust-crypto.ts`
* Misc
* Fix typo
* Fix `rustDeviceToJsDevice`
* Fix comments and new one
* Review of `device.ts`
* Remove `getUserDeviceInfo` from `client.ts`
* Review of `getUserDeviceInfo` in `rust-crypto.ts`
* Fix typo in `index.ts`
* Review `device-converter.ts`
* Add documentation to `getUserDeviceInfo` in `crypto-api.ts`
* Last changes in comments
* minor cleanups to the crypto tests
mostly, this is about using `testUtils.awaitDecryption` rather than custom
code. Some other cleanups too.
* Keep a record of events which are missing their keys
* Retry event decryption when we receive megolm keys
* Send one time key count and unused fallback keys for rust-crypto
* Add tests
* Remove useless type in promise return
* Add test for one time key upload
* Fix rust-crypto.spec.ts tests
* Remove unneeded code in test
* Add key upload request test
* Fix tests
* crypto.spec.ts: factor out `expactAliceKeyClaim` utility
* Add a new test for event encryption
... one that actually works on the rust SDK.
* Bump matrix-sdk-crypto-js version
... to pick up recent fixes to race conditions
* Associate event with thread before adding it to the thread timeline
* Make sure events can be added to thread correctly
* Write initial test case
* Add additional comment for why the code had to be reordered
I became sufficiently annoyed with matrix-mock-request that I decided to replace it with fetch-mock, which is what we use in matrix-react-sdk and is generally more powerful, easier to use, and actually maintained.
Unfortunately, we have a TestClient utility which is widely used and quite tightly integrated with matrix-mock-request. It wasn't going to be possible to change TestClient without changing all the tests that use it.
I also don't find TestClient particularly easy to use - it does a lot of stuff which I'm not convinced ought to be done for every single test.
So... I've introduced a couple of new classes (SyncResponder, E2EKeyReceiver) which do some of the useful bits of TestClient, but in a more granular way, and have switched crypto.spec.ts over so that rather than instantiating a TestClient for each test, it creates a MatrixClient directly and intercepts the endpoints necessary.
* refactor: sliding sync: swap to lists-as-keys
Update the request/response API shape to match the latest
MSC3575 version, which converts `lists` from being an array
of list objects to being a map of list objects.
* Linting
* prettier
* add extra setListRanges test
* Default to right type