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

refactor: FM-321 move orb relay client #340

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
db89c67
Orb Relay support (#1297)
andronat Sep 25, 2024
8e42076
orb-relay-client: Fix reliability issues and hash session_id (#1300)
andronat Sep 25, 2024
bb6e4ef
Skip messages that come from an unexpected src_id (#1301)
andronat Sep 25, 2024
07b04bf
User Feedback on unsuccessful signups (#1295)
karelispanagiotis Sep 26, 2024
7ceb5e3
Use BTree to order keys (#1303)
andronat Sep 26, 2024
4ba10d3
Make Orb-ID announcement more reliable (#1305)
andronat Sep 27, 2024
16fbba7
Add additional orb-relay messages (#1309)
karelispanagiotis Sep 27, 2024
34f5b06
Implement a simple client-side heartbeat (#1314)
andronat Oct 1, 2024
a6e1055
Remove hashing of dst_id (#1316)
andronat Oct 1, 2024
3f6c008
Report CaptureStarted (#1324)
andronat Oct 3, 2024
e804f95
Move to new orb-relay architecture (#1329)
andronat Oct 6, 2024
19048bb
Fix message ordering and protobuf namespace (#1332)
andronat Oct 7, 2024
b70381c
foss: add LICENSE, license-file, repository, edition (#1340)
TheButlah Oct 9, 2024
77fecbb
Decode msgs for type Any to known types (#1353)
andronat Oct 12, 2024
a780539
foss: Add automated license check (#1370)
TheButlah Oct 15, 2024
65587eb
Fix an orb-relay crash in case connection dies (#1400)
andronat Nov 8, 2024
11ca5aa
Spam a specific msg while waiting for another (#1398)
andronat Nov 8, 2024
587f366
Switch to `tracing` with `tracing-journald` (#1392)
valff Dec 5, 2024
db55591
moved orb-relay-client from priv-orb-core with history
Dec 25, 2024
bc32827
cargo fmt
Dec 25, 2024
67ed8d7
PR requested updates
Dec 28, 2024
748ac03
use SecretString for auth fields
Dec 29, 2024
4f8f4da
cargo toml
Dec 30, 2024
eacc015
orb-core recently got workspace support
Dec 30, 2024
af7ac5b
removed keys
Dec 30, 2024
760f366
clippy fix
Dec 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 71 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ members = [
"mcu-interface",
"mcu-util",
"qr-link",
"relay-client",
"security-utils",
"seek-camera/sys",
"seek-camera/wrapper",
Expand Down Expand Up @@ -95,6 +96,7 @@ orb-build-info.path = "build-info"
orb-const-concat.path = "const-concat"
orb-header-parsing.path = "header-parsing"
orb-mcu-interface.path = "mcu-interface"
orb-relay-client.path = "relay-client"
orb-security-utils.path = "security-utils"
orb-slot-ctrl.path = "slot-ctrl"
orb-telemetry.path = "telemetry"
Expand All @@ -106,6 +108,11 @@ seek-camera.path = "seek-camera/wrapper"
git = "https://github.com/worldcoin/orb-messages"
rev = "787ab78581b705af0946bcfe3a0453b64af2193f"

[workspace.dependencies.orb-relay-messages]
git = "https://github.com/worldcoin/orb-relay-messages.git"
rev = "f1c73751200ea9df7f1712ec203c7882f30f60f4"
features = ["client"]

[workspace.dependencies.nusb]
git = "https://github.com/kevinmehall/nusb"
rev = "3ec3508324cdd01ca288b91ddcb2f92fd6a6f813"
Expand Down
20 changes: 20 additions & 0 deletions relay-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "orb-relay-client"
version = "0.1.0"
edition.workspace = true
publish = false

[dependencies]
clap = { version = "4", features = ["derive"] }
eyre.workspace = true
json5 = "0.4"
paulquinn00 marked this conversation as resolved.
Show resolved Hide resolved
orb-relay-messages.workspace = true
orb-security-utils = { workspace = true, features = ["reqwest"] }
rand = "0.8"
serde_json.workspace = true
sha2 = "0.10"
tokio-stream.workspace = true
tokio-util.workspace = true
tokio.workspace = true
tracing-subscriber = "0.3"
tracing.workspace = true
39 changes: 39 additions & 0 deletions relay-client/src/bin/decode-msg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
use clap::Parser;
use eyre::{eyre, Result};
use orb_relay_client::debug_any;
use orb_relay_messages::prost_types::Any;
use serde_json::Value;

#[derive(Parser, Debug)]
paulquinn00 marked this conversation as resolved.
Show resolved Hide resolved
struct Args {
#[arg()]
json: String,
}

fn main() -> Result<()> {
let args = Args::parse();
println!("{}", decode_payload(&args.json)?);
Ok(())
}

fn decode_payload(json: &str) -> Result<String> {
println!("json: {}", json);
let v: Value = json5::from_str(json)?;
let any = Any {
type_url: v["type_url"]
.as_str()
.ok_or_else(|| eyre!("Invalid type_url"))?
.to_string(),
value: v["value"]
.as_array()
.ok_or_else(|| eyre!("Invalid value"))?
.iter()
.map(|n| {
n.as_u64()
.ok_or_else(|| eyre!("Invalid number"))
.map(|n| n as u8)
})
.collect::<Result<_>>()?,
};
Ok(debug_any(&Some(any)))
}
Loading
Loading