Skip to content

Add support for pushing secrets and receiving secret pushes#6164

Open
uhoreg wants to merge 3 commits intomatrix-org:mainfrom
uhoreg:secret_push
Open

Add support for pushing secrets and receiving secret pushes#6164
uhoreg wants to merge 3 commits intomatrix-org:mainfrom
uhoreg:secret_push

Conversation

@uhoreg
Copy link
Member

@uhoreg uhoreg commented Feb 12, 2026

see MSC4385

Pushing secrets allow devices to send secrets to other devices without waiting for a secret request.

closes #6040

  • Public API changes documented in changelogs (optional)

Signed-off-by:

@uhoreg uhoreg requested review from a team as code owners February 12, 2026 00:29
@uhoreg uhoreg requested review from poljar and stefanceriu and removed request for a team February 12, 2026 00:29
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.82%. Comparing base (75d39c8) to head (39abab9).
⚠️ Report is 107 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-sqlite/src/crypto_store.rs 66.66% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6164   +/-   ##
=======================================
  Coverage   89.81%   89.82%           
=======================================
  Files         365      365           
  Lines      100480   100493   +13     
  Branches   100480   100493   +13     
=======================================
+ Hits        90243    90264   +21     
+ Misses       6702     6694    -8     
  Partials     3535     3535           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 12, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing uhoreg:secret_push (39abab9) with main (ec719bb)

Open in CodSpeed

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of initial thoughts.

Comment on lines +342 to +348
/// Get all the pushed secrets with the given [`SecretName`] we have
/// currently stored.
#[cfg(feature = "experimental-push-secrets")]
async fn get_pushed_secrets_from_inbox(
&self,
secret_name: &SecretName,
) -> Result<Vec<SecretPushContent>, Self::Error>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we not need to call this in matrix-sdk somewhere? Is that planned for a future PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is a future PR. I wrote this PR first, then worked on the js-sdk parts, and then worked on the matrix-sdk parts. I could add the matrix-sdk parts to this PR, but I kind of feel like it's cleaner keeping them separate. But I'm not entirely sure, and am willing to be convinced otherwise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, no worries. Could I ask you to try and make that sort of thing clear (e.g. in the description) for future PRs?

Comment on lines +342 to +356
/// Get all the pushed secrets with the given [`SecretName`] we have
/// currently stored.
#[cfg(feature = "experimental-push-secrets")]
async fn get_pushed_secrets_from_inbox(
&self,
secret_name: &SecretName,
) -> Result<Vec<SecretPushContent>, Self::Error>;

/// Delete all the pushed secrets with the given [`SecretName`] we have
/// currently stored.
#[cfg(feature = "experimental-push-secrets")]
async fn delete_pushed_secrets_from_inbox(
&self,
secret_name: &SecretName,
) -> Result<(), Self::Error>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to give pushed secrets and requested secrets separate APIs? Could we not expose a single API that returns both, thus simplifying application logic? (and maybe even use the same backing store in sqlite/indexeddb, though that might involve some irritating backwards support)?

I notice that, although the current API returns a GossipedSecret which is specific to m.secret.send, the callers of said API don't actually make any use of any fields other than secret and name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I considered trying to combine them. It would be a breaking change. I don't know if anything else uses matrix-sdk-crypto directly, and these functions in particular, but it seems unlikely that anything would require anything other than secret or name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've not been shy with breaking changes of matrix-sdk-crypto in the past.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, needs more CHANGELOG.md

@stefanceriu stefanceriu removed their request for review March 4, 2026 08:36
@poljar poljar removed their request for review March 11, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add support for pushing secrets

2 participants