Currently the crypto-api hierarchy is exposed only as a `Crypto` namespace
under the "matrix" entrypoint in the documentation.
This isn't really right: it's meant to be a separate entrypoint (in the same
way as `types`, `testing` and `utils` are). This PR fixes that problem.
* Element-R: Don't mark QR code verification as done too soon
The rust crypto sdk doesn't actually finish QR code verification until the
`m.key.verification.done` is received, so make sure we don't tell the
application it is done before that happens.
Fixes https://github.com/vector-im/element-web/issues/26293
* ignore fallback line
* Revert unnecessary changes
Can't get the coverage high enough on this and it's not needed.
* Support for showing QR codes
* Emit `VerificationRequestEvent.Change` events when the verifier changes
* Minor integ test tweaks
* Handle transitions from QR code display to SAS
* Fix naming
* Add a test for `ShowQrCodeCallbacks.cancel`
* Offer `m.qr_code.scan.v1` verification method by default
Normally, the application specifies the supported verification methods when
creating the MatrixClient (and matrix-react-sdk does so). If the application
leaves it unset, then the idea is that the js-sdk offers all known verification
methods.
However, by default, the rust-sdk doesn't specify `m.qr_code.scan.v1`. So
basically, we need to set our own list of supported methods, rather than
relying on the rust-sdk's defaults.
* Factor out base class from `RustSASVerifier`
* Implement QR code scanning
* Update src/rust-crypto/verification.ts
* 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
* add a test for incoming verification requests
* Move `VerificationRequestEvent` to crypto-api
* Move `VerificationPhase` to `crypto-api`
* Define `VerificationRequest` interface
* Implement `canAcceptVerificationRequest`
* Move IReciprocateQr to `crypto-api` and rename
* Move ISasEvent to `crypto-api`, and rename
... and add some ✨comments✨
* Combine QrCodeEvent, SasEvent and VerificationEvent together
... as a precursor to extracting a single `Verifier` interface for `SAS` and `ReciprocateQRCode`.
`enum`s are slightly magical things that have both a type and a value, so we
have to re-export their backwards-compatibility fudges twice.
* Update src/crypto/verification/Base.ts