Page MenuHomePhabricator

[keyserver] Tunnelbroker integration - Adding message object on message consuming
AbandonedPublic

Authored by varun on Feb 27 2023, 4:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 27, 6:17 PM
Unknown Object (File)
Sat, Oct 19, 8:53 PM
Unknown Object (File)
Sat, Oct 19, 12:50 PM
Unknown Object (File)
Fri, Oct 18, 5:19 AM
Unknown Object (File)
Fri, Oct 18, 5:19 AM
Unknown Object (File)
Fri, Oct 18, 5:19 AM
Unknown Object (File)
Sep 28 2024, 10:16 PM
Unknown Object (File)
Sep 28 2024, 10:16 PM

Details

Summary

This diff introduces adding of the message object on message consuming from the Tunnelbroker client instead of the simple payload string.
To make these changes we are modifying the Tunnelbroker client integration in the Rust node addon adapter and adding a new flow type tunnelbrokerMessageToDeliver for the message.

Linear task: ENG-2615

Test Plan
  1. The simple and easiest test is to check what message is consumed by adding a simple pub-sub to the keyserver/src/keyserver.js:
    import { getRustAPI } from 'rust-node-addon';
...
    const rustBinding = await getRustAPI();
    const tbClientBinding = rustBinding.TunnelbrokerClient;
    const tbClient = new tbClientBinding('ksDeviceID', (error, msg) => {
      console.log(`tbClient got message object:`);
      console.log(msg);
      if (error) {
        console.log(`tbClient got an error: ${error.toString()}`);
      }
    });
    tbClient.publish('ksDeviceID', 'Hello from keyserver');
  1. Start the Tunnelbroker service: nix develop; cd services/tunnelbroker; cargo run.
  2. Start the keyserver service: nix develop; cd keyserver; yarn dev.
  3. The expected result should be the message object in the keyserver console which reflects the published message.

Diff Detail

Repository
rCOMM Comm
Branch
add-message-object
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

max held this revision as a draft.

Please make the requested edit before landing. Otherwise Flow types look good, but defer to others on Rust

lib/types/rust-binding-types.js
3–7 ↗(On Diff #23142)
varun added a subscriber: varun.
varun added inline comments.
keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs
22 ↗(On Diff #23142)

It would be great if we had some name for this kind of message besides "message to deliver." Not a big issue, though

This revision is now accepted and ready to land.Feb 27 2023, 7:54 AM
This comment was removed by ashoat.

Please make the requested edit before landing. Otherwise Flow types look good, but defer to others on Rust

Fixed. Thanks!

keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs
22 ↗(On Diff #23142)

It would be great if we had some name for this kind of message besides "message to deliver." Not a big issue, though

We are following a name convention from the protobuf file here. I think it's better to use this convention for better code reading. Thanks for the comment @varun!

varun edited reviewers, added: max; removed: varun.
This revision now requires review to proceed.Jan 16 2024, 7:40 PM