Skip to content

Commit

Permalink
Revert "Expose reply key_expr to interceptors", use wire_expr for ACL…
Browse files Browse the repository at this point in the history
… filtering of reply messages

This reverts commit 3a78d5d.
  • Loading branch information
oteffahi committed Jul 24, 2024
1 parent 8db19ec commit 2ea951e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion zenoh/src/net/routing/dispatcher/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ pub(crate) fn route_send_response(
ext_tstamp,
ext_respid,
},
key_expr.to_string(),
"".to_string(), // @TODO provide the proper key expression of the response for interceptors
));
}
None => tracing::warn!(
Expand Down
13 changes: 9 additions & 4 deletions zenoh/src/net/routing/interceptor/access_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ impl InterceptorTrait for IngressAclEnforcer {
return None;
}
}
NetworkBody::Response(Response { .. }) => {
if self.action(AclMessage::Reply, "Reply (ingress)", key_expr?) == Permission::Deny
NetworkBody::Response(Response { wire_expr, .. }) => {
// @TODO: Remove wire_expr usage when issue #1255 is implemented
if self.action(AclMessage::Reply, "Reply (ingress)", wire_expr.as_str())
== Permission::Deny
{
return None;
}
Expand Down Expand Up @@ -360,8 +362,11 @@ impl InterceptorTrait for EgressAclEnforcer {
return None;
}
}
NetworkBody::Response(Response { .. }) => {
if self.action(AclMessage::Reply, "Reply (egress)", key_expr?) == Permission::Deny {
NetworkBody::Response(Response { wire_expr, .. }) => {
// @TODO: Remove wire_expr usage when issue #1255 is implemented
if self.action(AclMessage::Reply, "Reply (egress)", wire_expr.as_str())
== Permission::Deny
{
return None;
}
}
Expand Down

0 comments on commit 2ea951e

Please sign in to comment.