1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00
Commit Graph

79 Commits

Author SHA1 Message Date
Hubert Chathi
7e8dfa56d0 Support fixed base64 in SAS verification (#2320) 2022-07-20 09:16:40 -04:00
Kerry
518e16e6d5 matrix-mock-request to 2.0.1 (#2416)
* matrix-mock-request to 2.0.0

Signed-off-by: Kerry Archibald <kerrya@element.io>

* track and destroy timeouts from test client

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove debug

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix bad property refernce caught by ts TestClient

Signed-off-by: Kerry Archibald <kerrya@element.io>

* Revert "fix bad property refernce caught by ts TestClient"

This reverts commit 92c9f6cb13.

* update yarn lock

Signed-off-by: Kerry Archibald <kerrya@element.io>

* correct IUploadKeysRequest type

* fix types in TestClient for typed matrix-mock-request

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update to matrix-mock-request 2.0.1

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-06-03 08:35:26 +00:00
renovate[bot]
a4a50a4a5c Update jest monorepo (major) (#2407)
* Update jest monorepo

* -w

* Fix guest rooms test to use async/await instead of a done callback

The done callback was never being called because it relies on a `process.nextTick()` deep within the mock. For this test we don't get a "next tick" because the event loop is busy, so we instead cargocult some test infrastructure from surrounding tests and verify the expected API call was cleared from the queue.

* Enable github-actions reporter

* Don't override local reporters

* Stop DeviceLists at end of tests

* stop more clients

* Fix tests and DRY typing

* Fix client/crypto stopping in tests

* Fix Buffer c'tor deprecated warnings

* Fix devicelist-integ test being excluded due to poor naming

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Travis Ralston <travisr@matrix.org>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-05-27 16:16:00 +01:00
Michael Telatynski
12e525b664 Improve typing around event emitter handlers (#2180) 2022-02-22 12:18:07 +00:00
Aaron R
80aaa6c32b Fix imports to work with new lint rules (#2003)
* Add eslint-plugin-import

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Autofix

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Manual fix

Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-12-09 15:57:43 -07:00
Michael Telatynski
3bbb7df72d fix tests private field access 2021-09-08 12:57:12 +01:00
Michael Telatynski
3a5e4ffa91 Fix yet more underscored accesses 2021-06-23 15:54:48 +01:00
Michael Telatynski
5a8299f1a5 Convert more of js-sdk crypto and fix underscored field accesses 2021-06-23 14:47:25 +01:00
Travis Ralston
9156bed961 Tests pass 2 2021-06-02 13:42:20 -06:00
Travis Ralston
e1edd84700 Early pass to fix runtime/build errors 2021-06-02 13:42:20 -06:00
Germain Souquet
5caf05cfa1 Apply new linting rules 2021-05-11 11:25:43 +01:00
J. Ryan Stinnett
102704e91a Migrate to eslint-plugin-matrix-org
This migrates to the new plugin form of our custom ESLint configs. As part of
this, some packages are de-duplicated, configs streamlined, etc.
2021-04-13 11:00:41 +01:00
J. Ryan Stinnett
09bd91a588 Enforce logger module via lint rules
This adds lint rules (and fixes various errors) to ensure we use the `logger`
intermediary module, rather than accessing the console directly.
2020-10-01 14:28:24 +01:00
J. Ryan Stinnett
098cd1b8d4 Request master cross-signing private key during verification
This change adds a request for the master cross-signing private key, in case the
other device is willing to share it.

Part of https://github.com/vector-im/element-web/issues/13896
2020-08-06 16:43:56 +01:00
Bruno Windels
75fe596e24 fix tests 2020-06-17 15:36:24 +02:00
Michael Telatynski
b83aa54661 Test the verification request timeouts of 10m and 2m
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-05-29 14:49:35 +01:00
Hubert Chathi
bdadcd4532 support new key agreement method for SAS 2020-05-14 16:14:45 -04:00
Bruno Windels
97cf4bff1f fix tests 2020-04-09 18:21:20 +02:00
David Baker
f57c25ec27 Make test pass again 2020-03-27 15:13:46 +00:00
David Baker
794429b68b Request the key backup key & restore backup
After a successful verification with ourselves, request the key
backup key too and restore a key backup if we get it.

Also cache the key backup key when we cache the SSK & USK so we have
it available to share.

Fixes https://github.com/vector-im/riot-web/issues/12704
2020-03-27 14:40:15 +00:00
David Baker
7f5ac072e6 Use requestSecret on the client to request secrets
Rather than accessing private method to get the secret storage
object (this was a bit confusing when I grepped for 'requestSecret'
and didn't find anything).
2020-03-26 16:01:35 +00:00
Bruno Windels
4b9bc67cb6 remove crypto.verification.start event
as it is not used anymore by the react-sdk
2020-03-06 16:48:44 +01:00
Zoe
936ef4116b For self-verifications, also request keys from the other device (#1245)
* For self-verifications, also request keys from the other device
* removed some XXX's so the editor doesn't think it's three issues
* add methods to access key cache callbacks
2020-03-06 09:56:56 +00:00
Zoe
c2daf0d74e Store data in cryptostore 2020-02-27 16:53:26 +00:00
Bruno Windels
00c003ec65 remove methods arg to requestVerification(DM)
as it's easy to have this argument be out of sync from all
the places this is called from the js-sdk. There is also little point,
as you can already specify the methods a consumer of the js-sdk
wants to provide through the verificationMethods option when creating
the client object.
2020-02-11 17:42:49 +01:00
Bruno Windels
c9c765b5b8 fix getEventType 2020-02-04 13:12:38 +01:00
Bruno Windels
208c371afb add failing test for getEventType 2020-02-04 13:10:06 +01:00
Bruno Windels
4945463beb fix lint 2020-02-03 20:12:21 +01:00
Bruno Windels
5398fac348 add (failing) tests for getEventType and getOtherPartyUserId 2020-02-03 19:16:48 +01:00
Travis Ralston
1b80c83676 Merge branch 'develop' into travis/update-qr-code 2020-01-29 15:11:06 +00:00
Travis Ralston
ec4dc582b6 Remove tests for old QR code stuff 2020-01-29 15:10:35 +00:00
Bruno Windels
470bdf8741 fix tests 2020-01-29 15:19:18 +01:00
Travis Ralston
b8092cd00b Make the tests pass 2020-01-23 20:41:52 -07:00
Bruno Windels
3faeec4add fix lint 2020-01-23 15:59:47 +01:00
Bruno Windels
b2afaabb8c add unit tests for verifying your own device over to_device messages 2020-01-23 15:52:07 +01:00
Bruno Windels
0c52887688 copyright year
Co-Authored-By: J. Ryan Stinnett <jryans@gmail.com>
2020-01-23 10:51:19 +00:00
Bruno Windels
dc38f78da2 add unit tests for verification request 2020-01-22 17:39:21 +01:00
Bruno Windels
bd9a2c13eb implement API change in sas test for requestVerificationDM 2020-01-20 17:55:48 +01:00
Bruno Windels
e5c65d53f8 set transaction_id for remote echos in TestClient
as InRoomChannel looks at this to decide whether an event is
a remote echo (and to pass it to the verifier or not)
2020-01-20 17:54:26 +01:00
Bruno Windels
c12a3b6610 more fixup: make sure remote echo doesn't arrive earlier for TestClient 2020-01-20 17:35:44 +01:00
Bruno Windels
77d0a76186 fixup: another timeout 2020-01-20 14:52:34 +01:00
Bruno Windels
e89528315d enable fake timers for consistency
although it doesn't make or break the test
2020-01-20 14:04:32 +01:00
Bruno Windels
c34ccc9d53 adjust test: requestVerification returns the request instead of verifier 2020-01-20 14:03:43 +01:00
Bruno Windels
e51ba795f3 to make this work while using fake timers, don't use setTimeout
but instead use Promise.resolved() as then always runs in the next tick.
2020-01-20 13:56:39 +01:00
Travis Ralston
034b8db070 Convert tests to ES6
The earlier commit, d3ce0cb82f, has most of the juicy details on this. In addition to d3ce's changes, we also:
* Use `TestClient` in many integration tests due to subtle behaviour changes in imports when switching to ES6. Namely the behaviour where setting the request function is less reliable in the way we did it, but `TestClient` is very reliable.
* We now use the Olm loader more often to avoid having to maintain so much duplicate code. This makes the imports slightly easier to read.
2019-12-17 15:16:37 -07:00
Travis Ralston
ca6a52727c Fix logger imports in tests 2019-12-10 11:39:56 -07:00
Michael Telatynski
70eb8a7300 Merge pull request #1100 from matrix-org/t3chguy/remove_bluebird_13
Remove Bluebird: phase 2.5
2019-12-10 16:58:22 +00:00
Bruno Windels
df6ebf83b4 fix tests 2019-12-09 17:45:01 +01:00
Michael Telatynski
c4ae27dae6 Merge branches 'develop' and 't3chguy/remove_bluebird_13' of github.com:matrix-org/matrix-js-sdk into t3chguy/remove_bluebird_13 2019-12-02 22:56:13 +00:00
Michael Telatynski
0170cb066d add another clean-up to sas.spec.js 2019-12-02 22:34:46 +00:00