fix: allow all traffic if acls field is omited from the policy

This commit is contained in:
afranco authored and nblock committed 2025-08-18 16:13:14 +02:00
1 parent 7b8b796a71
commit 43f90d205e
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ func (pol *Policy) compileFilterRules(
users types.Users,
nodes views.Slice[types.NodeView],
) ([]tailcfg.FilterRule, error) {
if pol == nil {
if pol == nil || pol.ACLs == nil {
return tailcfg.FilterAllowAll, nil
}
+2 -2
View File
@@ -40,8 +40,8 @@ func TestPolicyManager(t *testing.T) {
name: "empty-policy",
pol: "{}",
nodes: types.Nodes{},
wantFilter: nil,
wantMatchers: []matcher.Match{},
wantFilter: tailcfg.FilterAllowAll,
wantMatchers: matcher.MatchesFromFilterRules(tailcfg.FilterAllowAll),
},
}