1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-09-25 17:51:11 +02:00

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

This commit is contained in:
afranco 2025-08-16 12:15:56 +01:00
parent 30a1f7e68e
commit 70f8733426
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

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
}

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),
},
}