Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "shvclient"
description = "A Rust framework for Silicon Heaven RPC devices"
license = "MIT"
repository = "https://github.com/silicon-heaven/libshvclient-rs"
version = "5.0.0"
version = "5.0.1"
edition = "2024"

[lib]
Expand Down
26 changes: 11 additions & 15 deletions src/clientnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,22 +479,18 @@ fn check_request_access_for_method(rq: &RpcMessage, mount_path: impl AsRef<str>,
if rq_level >= method.access as i32 {
Ok(())
} else {
// Send a neutral error message so an unauthorized user wouldn't even know
// that this path:method exists.
let path = full_shv_path(mount_path.as_ref(), rq.shv_path().unwrap_or_default());
Err(rpc_error_unknown_method_on_path(path, &method.name))

// Err(RpcError::new(
// RpcErrorCode::PermissionDenied,
// format!("Insufficient permissions. \
// Method '{full_path}:{method}()' \
// called with access level {:?}, required {} ({:?})",
// rq_level,
// method.access as i32,
// method.access,
// )
// )
// )
Err(RpcError::new(
RpcErrorCode::PermissionDenied,
format!("Insufficient permissions. \
Method '{path}:{}()' \
called with access level {:?}, required {} ({:?})",
method.name,
rq_level,
method.access as i32,
method.access,
)
))
}
}

Expand Down
Loading