A: Code quality improvements - fix clippy warnings
- Remove unused imports in server.rs (Body, HeaderValue, RwLock) - Remove unused imports in forward_acl.rs (tests still need Ipv4Addr) - Remove unused imports in host_key.rs (Read, Write) - Remove unused imports in kex_exchange.rs (HostKeyType) - Remove unused imports in known_hosts.rs (tests need Ipv4Addr) - Remove unused imports in multiplex.rs (Arc) - Auto-fix other unused imports via clippy --fix Tests: 303 passed, 0 failed (4 new tests added)
This commit is contained in:
@@ -79,8 +79,8 @@ impl BucketPolicy {
|
||||
let mut allowed = false;
|
||||
|
||||
for stmt in &self.statement {
|
||||
if stmt.matches_action(action) && stmt.matches_resource(resource) {
|
||||
if stmt.principal.matches_user(user_id) {
|
||||
if stmt.matches_action(action) && stmt.matches_resource(resource)
|
||||
&& stmt.principal.matches_user(user_id) {
|
||||
match stmt.effect {
|
||||
PolicyEffect::Allow => {
|
||||
if stmt.matches_condition(user_id) {
|
||||
@@ -94,7 +94,6 @@ impl BucketPolicy {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
allowed
|
||||
@@ -120,11 +119,10 @@ impl PolicyStatement {
|
||||
if let Some(cond) = &self.condition {
|
||||
for (operator, values) in cond {
|
||||
for (key, value) in values {
|
||||
if operator == "StringEquals" && key == "aws:userid" {
|
||||
if value != _user_id {
|
||||
if operator == "StringEquals" && key == "aws:userid"
|
||||
&& value != _user_id {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user