Skip to content

Commit b167226

Browse files
committed
fix all resources tag on egress
1 parent f82b9e8 commit b167226

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

logic/egress.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,15 @@ func DoesNodeHaveAccessToEgress(node *models.Node, e *schema.Egress, acls []mode
4646
}
4747
srcVal := ConvAclTagToValueMap(acl.Src)
4848
for _, dstI := range acl.Dst {
49-
if dstI.ID == models.EgressID && dstI.Value == e.ID {
50-
e := schema.Egress{ID: dstI.Value}
51-
err := e.Get(db.WithContext(context.TODO()))
52-
if err != nil {
53-
continue
49+
if (dstI.ID == models.EgressID && dstI.Value == e.ID) || (dstI.ID == models.NodeTagID && dstI.Value == "*") {
50+
if dstI.ID == models.EgressID {
51+
e := schema.Egress{ID: dstI.Value}
52+
err := e.Get(db.WithContext(context.TODO()))
53+
if err != nil {
54+
continue
55+
}
5456
}
57+
5558
if node.IsStatic {
5659
if _, ok := srcVal[node.StaticNode.ClientID]; ok {
5760
return true
@@ -67,8 +70,8 @@ func DoesNodeHaveAccessToEgress(node *models.Node, e *schema.Egress, acls []mode
6770
return true
6871
}
6972
}
70-
7173
}
74+
7275
}
7376
}
7477
return false

0 commit comments

Comments
 (0)