feat(sdk, ffi): MSC3814 dehydrated-devices high-level manager#6606
Open
jevolk wants to merge 7 commits into
Open
feat(sdk, ffi): MSC3814 dehydrated-devices high-level manager#6606jevolk wants to merge 7 commits into
jevolk wants to merge 7 commits into
Conversation
09b54e0 to
dc448fa
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6606 +/- ##
==========================================
- Coverage 89.94% 89.88% -0.06%
==========================================
Files 382 383 +1
Lines 107958 108202 +244
Branches 107958 108202 +244
==========================================
+ Hits 97106 97261 +155
- Misses 7184 7263 +79
- Partials 3668 3678 +10 ☔ View full report in Codecov by Sentry. |
dc448fa to
7632d8d
Compare
Adds `Encryption::dehydrated_devices()` returning a manager with `is_supported`, `create`, `rehydrate`, `delete`, `start`, and `stop`, plus a Secret Storage round trip for the pickle key, a broadcast event channel for lifecycle observability, and a weekly rotation task. The module is gated behind `e2e-encryption` and follows the matrix-js-sdk `DehydratedDeviceManager` shape so applications can adopt MSC3814 without writing the wire-glue themselves. Signed-off-by: Jason Volk <jason@zemos.net>
Each public method on `DehydratedDevices` now carries a runnable `no_run` example that shows the typical call site, so the docs.rs surface is discoverable without cross-referencing the integration tests. Signed-off-by: Jason Volk <jason@zemos.net>
…points.
Adds prebuilt mocks for `GET`, `PUT`, `DELETE /dehydrated_device` and
`POST /dehydrated_device/{device_id}/events`, with helpers for the
common success, `M_NOT_FOUND`, and `M_UNRECOGNIZED` responses and
body matchers (`match_next_batch`, `match_missing_next_batch`) so
integration tests can drive the full lifecycle without hand-rolling
wiremock.
Signed-off-by: Jason Volk <jason@zemos.net>
Drives the full lifecycle through the new `MatrixMockServer` helpers across 13 cases covering support probing, create with default and explicit display names, delete on the three server responses, the rehydrate round trip with single-page and paginated to-device feeds, wrong-pickle-key handling, and the empty-server short-circuit. Signed-off-by: Jason Volk <jason@zemos.net>
Adds two integration tests under `matrix-sdk-integration-testing` exercising the wire endpoints end to end: a direct `create` → `rehydrate` round trip with a locally generated pickle key, and a `start` lifecycle that resolves the pickle key out of Secret Storage and asserts that two consecutive `start` calls upload distinct device IDs. Signed-off-by: Jason Volk <jason@zemos.net>
Mirrors the SDK shape on the FFI `Encryption` struct with `is_dehydrated_device_supported`, `create_dehydrated_device`, `rehydrate_dehydrated_device`, `delete_dehydrated_device`, `start_dehydrated_devices`, `stop_dehydrated_devices`, and a `dehydrated_device_event_listener` callback interface so Element X (Kotlin and Swift) can drive MSC3814 without bypassing the SDK's lifecycle events. Signed-off-by: Jason Volk <jason@zemos.net>
Signed-off-by: Jason Volk <jason@zemos.net>
7632d8d to
0bbe969
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an
Encryption::dehydrated_devices()manager that wraps the crypto-crate primitives for MSC3814 (probe support, create, rehydrate, delete, weekly rotation, Secret Storage round trip for the pickle key, lifecycle event stream), modelled onmatrix-js-sdk'sDehydratedDeviceManagerand exposed through the FFIEncryptionstruct for Element X. Resumable rehydration is left for a follow-up; revisits the surface area of #6273 withMatrixMockServerhelpers, doctests on every public method, integration tests, and a live round-trip test that runs against any homeserver advertising MSC3814.