Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
9cbab41
test fix
milyin Nov 12, 2025
332fbb7
test publisher delete
milyin Nov 12, 2025
de8b757
missing library imiport line added
milyin Nov 12, 2025
47be1e0
no need to check coverage of bench tests
milyin Nov 12, 2025
beece4f
tracw in remote api plugin
milyin Nov 13, 2025
81f5204
check for asserts in tests
milyin Nov 13, 2025
92ccfe8
restored correct subscriber undeclare
milyin Nov 13, 2025
ba2a06c
typed ids
milyin Nov 13, 2025
6642401
undeclare_liveliness_subscriber message removed
milyin Nov 13, 2025
3a515b1
zid serialization test
milyin Nov 14, 2025
1464754
zbytes test coverage improved and zero size ZBytest ser/deser tested
milyin Nov 14, 2025
720042f
getNtp64 test
milyin Nov 14, 2025
2cb6df5
exported open, added session info test
milyin Nov 14, 2025
e82f4ad
test for auto dispose
milyin Nov 14, 2025
68fdc7e
timestamp test added, types corrected
milyin Nov 14, 2025
67a107f
async dispose test
milyin Nov 14, 2025
d5fd8fc
containsKey, isEmpty tested
milyin Nov 14, 2025
f936425
test for selector added, library fixed
milyin Nov 14, 2025
e964f07
update Parameters to match rust's behavior (multiple ? is not error)
milyin Nov 14, 2025
02d2ada
query toString fixed, test added
milyin Nov 14, 2025
3ffb35a
large data serialization test
milyin Nov 14, 2025
7db64d9
restored message to keep compatibility
milyin Nov 14, 2025
69f0b15
restored UndeclareLivelinessSubscriber id in ts
milyin Nov 15, 2025
0fac082
subscriber kind added, restored separation to livelines/normal subscr…
milyin Nov 17, 2025
e53478e
#[allow(dead_code)] removed
milyin Nov 17, 2025
68af006
typed ids
milyin Nov 17, 2025
0161162
all indexed by subscriebr id
milyin Nov 17, 2025
bfcf22f
all typed ids
milyin Nov 17, 2025
36bd907
typed ids in adminspace
milyin Nov 17, 2025
f1a1a9d
static idsource
milyin Nov 17, 2025
fd12828
removed specific livelinessSubscriberId
milyin Nov 17, 2025
756d959
separate liveliness subscribers list removed
milyin Nov 17, 2025
8718ec4
cargo fmt
milyin Nov 17, 2025
90b205c
prefix removed
milyin Nov 17, 2025
136584d
id.0 removed
milyin Nov 17, 2025
51ebbed
wait for websocket close to avoid memory leak
milyin Nov 17, 2025
ec9cfe8
enable adminspace and setting config elements on bridge
milyin Nov 19, 2025
1c82cec
Merge branch 'main' into commandline_update
milyin Nov 29, 2025
1c7e880
dummy publisher
milyin Nov 29, 2025
2f504b4
publishers list
milyin Nov 29, 2025
5e88b0a
publisher options
milyin Nov 29, 2025
0cba164
querier
milyin Nov 29, 2025
854fe67
liveliness support
milyin Nov 29, 2025
a1dbeaa
icon, tri0state button
milyin Nov 29, 2025
5021e41
no sesN in token
milyin Nov 29, 2025
9eb1a05
session background color
milyin Nov 29, 2025
13ee506
collapse buttons in sections
milyin Nov 29, 2025
ef76c76
collapsed by default
milyin Nov 29, 2025
1c5202c
conditionally collapsible
milyin Nov 29, 2025
d1a85e6
PublisherPutOptions
milyin Nov 30, 2025
3a2eda8
put/delete for session in nuxt
milyin Nov 30, 2025
14d1882
publication kind select
milyin Nov 30, 2025
90690a9
explicit publication kind in put/delete
milyin Nov 30, 2025
8f6458a
export SampleKind to gui
milyin Nov 30, 2025
5ebf49d
change button text to "put/delete"
milyin Nov 30, 2025
a2da11f
publisher delete
milyin Nov 30, 2025
7aa4e6a
attachment in delete fix
milyin Nov 30, 2025
7044b1f
attachment fix
milyin Nov 30, 2025
05eb79a
publication kind in queryable
milyin Nov 30, 2025
139f811
json formatting of reply delete options
milyin Nov 30, 2025
14d1ea1
combo instead of radio in queryable, more type safety
milyin Nov 30, 2025
00776e6
enum instead of const
milyin Nov 30, 2025
b28b6e1
reexport simplified
milyin Nov 30, 2025
47ffd4e
sleep after session close to give time to close session
milyin Dec 4, 2025
71c3db0
Merge branch 'main' into more_api_in_nuxt
milyin Dec 18, 2025
13db362
cargo fix
milyin Dec 18, 2025
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
2 changes: 2 additions & 0 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ description = "Remote API Plugin for Zenoh using Websockets"
async-liveliness-monitor = "0.1.1"
bytes = "1.10.1"
clap = { version = "4.5.40", features = ["derive"] }
json5 = "0.4"
rustc_version = "0.4.0"
tokio = { version = "1.45.1", features = ["rt", "macros", "time"] }
tokio-tungstenite = "0.27.0"
Expand All @@ -37,9 +38,10 @@ serde_json = "1.0.140"
jsonschema = { version = "0.18.0", default-features = false }
zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = [
"internal",
"plugins",
"plugins",
"unstable",
], version = "1.7.1" }
zenoh-config = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", version = "1.7.1" }
zenoh-ext = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", version = "1.7.1" }
zenoh-plugin-trait = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", version = "1.7.1" }
zenoh-util = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", version = "1.7.1" }
Expand Down
2 changes: 2 additions & 0 deletions zenoh-bridge-remote-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ path = "src/main.rs"
[dependencies]
async-liveliness-monitor = { workspace = true }
clap = { workspace = true }
json5 = { workspace = true }
tokio = { workspace = true }
tokio-tungstenite = { workspace = true }
tokio-rustls = { workspace = true }
Expand All @@ -56,6 +57,7 @@ serde = { workspace = true, default-features = false, features = [
] } # Default features are disabled due to usage in no_std crates
serde_json = { workspace = true }
zenoh = { workspace = true }
zenoh-config = { workspace = true }
zenoh-ext = { workspace = true }
zenoh-plugin-trait = { workspace = true }
zenoh-util = { workspace = true }
Expand Down
94 changes: 90 additions & 4 deletions zenoh-bridge-remote-api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use zenoh::{
internal::{plugins::PluginsManager, runtime::RuntimeBuilder},
session::ZenohId,
};
use zenoh_config::PermissionsConf;
use zenoh_plugin_remote_api::RemoteApiPlugin;
use zenoh_plugin_trait::Plugin;

Expand Down Expand Up @@ -74,6 +75,22 @@ struct Args {
/// Path to the TLS private key file for secure WebSocket connections.
#[arg(long, value_name = "PATH")]
key: Option<String>,

/// Allows arbitrary configuration changes as column-separated KEY:VALUE pairs,
/// where the empty key is used to represent the entire configuration:
/// - KEY must be a valid config path, or empty string if the whole configuration is defined.
/// - VALUE must be a valid JSON5 string that can be deserialized to the expected type for the KEY field.
///
/// Examples:
/// - `--cfg='startup/subscribe:["demo/**"]'`
/// - `--cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'`
/// - `--cfg=':{metadata:{name:"My App"},adminspace:{enabled:true,permissions:{read:true,write:true}}'`
#[arg(long)]
cfg: Vec<String>,

/// Configure the read and/or write permissions on the admin space. Default is read only.
#[arg(long, value_name = "[r|w|rw|none]")]
adminspace_permissions: Option<String>,
}

#[derive(clap::ValueEnum, Clone, Debug)]
Expand Down Expand Up @@ -106,11 +123,23 @@ impl std::str::FromStr for SessionMode {
fn parse_args() -> Config {
let args = Args::parse();

// load config file at first
let mut config = match &args.config {
Some(conf_file) => Config::from_file(conf_file).unwrap(),
None => Config::default(),
// Check for inline config first (--cfg with empty key)
let mut inline_config = None;
for json in &args.cfg {
if let Some(("", cfg)) = json.split_once(':') {
inline_config = Some(cfg);
}
}

// Load config: inline config takes precedence over config file
let mut config = if let Some(cfg) = inline_config {
Config::from_json5(cfg).expect("Invalid Zenoh config")
} else if let Some(conf_file) = &args.config {
Config::from_file(conf_file).unwrap()
} else {
Config::default()
};

// if "remote_api" plugin conf is not present, add it (empty to use default config)
if config.plugin("remote_api").is_none() {
config.insert_json5("plugins/remote_api", "{}").unwrap();
Expand Down Expand Up @@ -152,6 +181,43 @@ fn parse_args() -> Config {
// Enable loading plugins
config.plugins_loading.set_enabled(true).unwrap();

// Apply adminspace permissions if specified
if let Some(adminspace_permissions) = &args.adminspace_permissions {
match adminspace_permissions.as_str() {
"r" => config
.adminspace
.set_permissions(PermissionsConf {
read: true,
write: false,
})
.unwrap(),
"w" => config
.adminspace
.set_permissions(PermissionsConf {
read: false,
write: true,
})
.unwrap(),
"rw" => config
.adminspace
.set_permissions(PermissionsConf {
read: true,
write: true,
})
.unwrap(),
"none" => config
.adminspace
.set_permissions(PermissionsConf {
read: false,
write: false,
})
.unwrap(),
s => panic!(
r#"Invalid option: --adminspace-permissions={s} - Accepted values: "r", "w", "rw" or "none""#
),
};
}

// apply Remote API related arguments over config
if let Some(ws_port) = &args.ws_port {
config
Expand All @@ -178,6 +244,26 @@ fn parse_args() -> Config {
}
}

// Process --cfg parameters (except the inline config which was already processed)
for json in &args.cfg {
if let Some((key, value)) = json.split_once(':') {
if !key.is_empty() {
match json5::Deserializer::from_str(value) {
Ok(mut deserializer) => {
if let Err(e) =
config.insert(key.strip_prefix('/').unwrap_or(key), &mut deserializer)
{
tracing::warn!("Couldn't perform configuration {}: {}", json, e);
}
}
Err(e) => tracing::warn!("Couldn't perform configuration {}: {}", json, e),
}
}
} else {
panic!("--cfg accepts KEY:VALUE pairs. {json} is not a valid KEY:VALUE pair.")
}
}

config
}

Expand Down
Loading