Skip to content

Commit

Permalink
Specify all existing message types in ACL interceptor matching
Browse files Browse the repository at this point in the history
  • Loading branch information
oteffahi committed Jul 24, 2024
1 parent b5dcf1b commit b3c0906
Showing 1 changed file with 75 additions and 3 deletions.
78 changes: 75 additions & 3 deletions zenoh/src/net/routing/interceptor/access_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use zenoh_config::{
};
use zenoh_protocol::{
core::ZenohIdProto,
network::{Declare, DeclareBody, NetworkBody, NetworkMessage, Push, Request},
network::{Declare, DeclareBody, NetworkBody, NetworkMessage, Push, Request, Response},
zenoh::{PushBody, RequestBody},
};
use zenoh_result::ZResult;
Expand Down Expand Up @@ -284,7 +284,43 @@ impl InterceptorTrait for IngressAclEnforcer {
return None;
}
}
_ => {}
// Unfiltered Delete messages
NetworkBody::Push(Push {
payload: PushBody::Del(_),
..
}) => {}
// Unfiltered Declare messages
NetworkBody::Declare(Declare {
body: DeclareBody::DeclareKeyExpr(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::DeclareFinal(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::DeclareToken(_),
..
}) => {}
// Unfiltered Undeclare messages
NetworkBody::Declare(Declare {
body: DeclareBody::UndeclareKeyExpr(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::UndeclareToken(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::UndeclareQueryable(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::UndeclareSubscriber(_),
..
}) => {}
// Unfiltered remaining message types
NetworkBody::Interest(_) | NetworkBody::OAM(_) | NetworkBody::ResponseFinal(_) => {}
}
Some(ctx)
}
Expand Down Expand Up @@ -358,7 +394,43 @@ impl InterceptorTrait for EgressAclEnforcer {
return None;
}
}
_ => {}
// Unfiltered Delete messages
NetworkBody::Push(Push {
payload: PushBody::Del(_),
..
}) => {}
// Unfiltered Declare messages
NetworkBody::Declare(Declare {
body: DeclareBody::DeclareKeyExpr(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::DeclareFinal(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::DeclareToken(_),
..
}) => {}
// Unfiltered Undeclare messages
NetworkBody::Declare(Declare {
body: DeclareBody::UndeclareKeyExpr(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::UndeclareToken(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::UndeclareQueryable(_),
..
})
| NetworkBody::Declare(Declare {
body: DeclareBody::UndeclareSubscriber(_),
..
}) => {}
// Unfiltered remaining message types
NetworkBody::Interest(_) | NetworkBody::OAM(_) | NetworkBody::ResponseFinal(_) => {}
}
Some(ctx)
}
Expand Down

0 comments on commit b3c0906

Please sign in to comment.