-
Notifications
You must be signed in to change notification settings - Fork 40
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
Open
paulquinn00
wants to merge
20
commits into
main
Choose a base branch
from
FM-321-move-orb-relay-client
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,787
−3
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
db89c67
Orb Relay support (#1297)
andronat 8e42076
orb-relay-client: Fix reliability issues and hash session_id (#1300)
andronat bb6e4ef
Skip messages that come from an unexpected src_id (#1301)
andronat 07b04bf
User Feedback on unsuccessful signups (#1295)
karelispanagiotis 7ceb5e3
Use BTree to order keys (#1303)
andronat 4ba10d3
Make Orb-ID announcement more reliable (#1305)
andronat 16fbba7
Add additional orb-relay messages (#1309)
karelispanagiotis 34f5b06
Implement a simple client-side heartbeat (#1314)
andronat a6e1055
Remove hashing of dst_id (#1316)
andronat 3f6c008
Report CaptureStarted (#1324)
andronat e804f95
Move to new orb-relay architecture (#1329)
andronat 19048bb
Fix message ordering and protobuf namespace (#1332)
andronat b70381c
foss: add LICENSE, license-file, repository, edition (#1340)
TheButlah 77fecbb
Decode msgs for type Any to known types (#1353)
andronat a780539
foss: Add automated license check (#1370)
TheButlah 65587eb
Fix an orb-relay crash in case connection dies (#1400)
andronat 11ca5aa
Spam a specific msg while waiting for another (#1398)
andronat 587f366
Switch to `tracing` with `tracing-journald` (#1392)
valff db55591
moved orb-relay-client from priv-orb-core with history
bc32827
cargo fmt
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
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" | ||
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 |
This file contains 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
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)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: would be good to add a doc comment here or at the module level explaining what this binary is for |
||
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))) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unless we actually need json5, it might be better to stick with json. Will keep our dependency tree smaller and will be more familiar.