* Simplify `MatrixClient::setPowerLevel` API
While making it more resilient to causing issues like nuking room state
* Handle edge case
* Fix tests
* Add test coverage
* use oidc-client-ts during oidc discovery
* export new type for auth config
* deprecate generateAuthorizationUrl in favour of generateOidcAuthorizationUrl
* testing util for oidc configurations
* test generateOidcAuthorizationUrl
* lint
* test discovery
* dont pass whole client wellknown to oidc validation funcs
* add nonce
* use oidc-client-ts for oidc response
* validate user state and update tests
* use oidc-client-ts for code exchange
* use oidc-client-ts in completing auth grant
* use client userState for homeserver
* more comments
* use oidc-client-ts during oidc discovery
* export new type for auth config
* deprecate generateAuthorizationUrl in favour of generateOidcAuthorizationUrl
* testing util for oidc configurations
* test generateOidcAuthorizationUrl
* lint
* test discovery
* dont pass whole client wellknown to oidc validation funcs
* add nonce
* use client userState for homeserver
* Fix an instance of failed to decrypt error
Specifically, when checking the event sender matches who sent us the
session keys we skip waiting for pending device list updates if we
already know who owns the session key.
* Apply suggestions from code review
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Update src/crypto/algorithms/olm.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Fix line wrapping
* Update src/crypto/algorithms/olm.ts
* Fix null check
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* implement `VerificationRequest.pending`
* Implement `VerificationRequest.timeout`
* Rust crypto: allow using a memory store (#3536)
* Rust crypto: allow using a memory store
It turns out that, for some usecases (in particular, "bot users" for cypress
tests), we don't need persistent storage and an in-memory store will be fine.
* Rust crypto: use a memory store for the unit tests
* Pass `supportedVerificationMethods` into `VerificationRequest`
... so that the application can later call `accept()` and we know what to send.
* Implement `VerificationRequest.accept`
* Implement `VerificationRequest.declining`
* Update src/rust-crypto/verification.ts
Currently, the anchor emoji has a ["Variation
Selector-16"](https://codepoints.net/U+FE0F) (U+FE0F) character after it.
The unicode specs do define U+2694 U+FE0F as a valid sequence (with suggested
rendering https://www.unicode.org/cgi-bin/varglyph?24-2693-FE0F), but our spec
spec doesn't include the variation selector, and the difference means that my
cypress tests (which attempt a verification between Element-R and unrusty
Element Web) fail intermittently.
Something of a follow-up to
https://github.com/matrix-org/matrix-js-sdk/pull/3523, but hopefully this will
be the last, because I have regenerated the whole list from the spec data.
* integ tests: factor out some utility methods
* Add `VerificationRequest.startVerification` to replace `beginKeyVerification`
The rust SDK ties together creating the verifier and sending the
`m.key.verification.start` message, so we need to combine
`.beginKeyVerification` and `.verify`.
* add some unit tests
* More slow test fixes
* Create a new event type for verification requests
Previous PRs (https://github.com/matrix-org/matrix-js-sdk/pull/3449, etc) have
pulled out an interface from the `VerificationRequest` class, but applications
registering for the `CryptoEvent.VerificationRequest` event could still be
expecting a fully-fledged class rather than the interface.
To handle this without breaking backwards compat, add a new event type that
carries the interface, not the class.
* utils for authorization step in OIDC code grant
* tidy
* completeAuthorizationCodeGrant util functions
* response_mode=query
* add scope to bearertoken type
* add is_guest to whoami response type
* doc comments
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* use shimmed TextEncoder
* fetchMockJest -> fetchMock
* comment
* bearertokenresponse
* test for lowercase bearer
* handle lowercase token_type
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* 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
`cypress.yaml` is currently pinned to an old version of the react-sdk, meaning
that each attempt to run it is currently failing with an error.
(Introduced by https://github.com/matrix-org/matrix-js-sdk/pull/3480)