Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node bindings for the matrix-sdk-crypto crate #699

Closed
12 tasks done
poljar opened this issue May 20, 2022 · 1 comment
Closed
12 tasks done

Node bindings for the matrix-sdk-crypto crate #699

poljar opened this issue May 20, 2022 · 1 comment
Assignees
Labels

Comments

@poljar
Copy link
Contributor

poljar commented May 20, 2022

A bunch of folks would really like to use the matrix-sdk-crypto crate for Javascript based projects. An initial napi based prototype was written in https://github.com/matrix-org/matrix-rust-sdk-bindings.

Those bindings lack error handling and aren't up-to-date with the latest version of the sdk. On the other hand wasm-bindgen based bindings have been started in #681.

This issue is about adopting the wasm-bindgen based bindings to also expose napi based bindings from the same codebase. The macros and types that are used by wasm-bindgen and napi are sufficiently similar that this should be relatively straightforward.

The Node bindings, at least for now, don't require the whole API surface of the matrix-sdk-crypto crate to be exposed. People are mainly interested in writing bots and bridges, thus basic encryption and decryption will be sufficient.

The methods that are needed for basic encryption/decryption are:

  • OlmMachine::new()
  • OlmMachine::receive_sync_changes()
  • OlmMachine::outgoing_requests()
  • OlmMachine::mark_request_as_sent()
  • OlmMachine::decrypt_room_event()
  • OlmMachine::update_tracked_users()
  • OlmMachine::get_missing_sessions()
  • OlmMachine::share_room_key()
  • OlmMachine::encrypt_raw()

Things that are trivial to add, and nice to have, but not exactly needed:

  • OlmMachine::user_id()
  • OlmMachine::device_id()
  • OlmMachine::identity_keys()
@poljar poljar added enhancement New feature or request encryption labels May 20, 2022
@Hywan Hywan self-assigned this May 23, 2022
@poljar poljar changed the title Node bindings Node bindings for the matrix-sdk-crypto crate May 23, 2022
@poljar
Copy link
Contributor Author

poljar commented Jun 13, 2022

This has been closed by #721.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants