mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	fix: allow all traffic if acls field is omited from the policy
This commit is contained in:
		
							parent
							
								
									7b8b796a71
								
							
						
					
					
						commit
						43f90d205e
					
				| @ -21,7 +21,7 @@ func (pol *Policy) compileFilterRules( | |||||||
| 	users types.Users, | 	users types.Users, | ||||||
| 	nodes views.Slice[types.NodeView], | 	nodes views.Slice[types.NodeView], | ||||||
| ) ([]tailcfg.FilterRule, error) { | ) ([]tailcfg.FilterRule, error) { | ||||||
| 	if pol == nil { | 	if pol == nil || pol.ACLs == nil { | ||||||
| 		return tailcfg.FilterAllowAll, nil | 		return tailcfg.FilterAllowAll, nil | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -40,8 +40,8 @@ func TestPolicyManager(t *testing.T) { | |||||||
| 			name:         "empty-policy", | 			name:         "empty-policy", | ||||||
| 			pol:          "{}", | 			pol:          "{}", | ||||||
| 			nodes:        types.Nodes{}, | 			nodes:        types.Nodes{}, | ||||||
| 			wantFilter:   nil, | 			wantFilter:   tailcfg.FilterAllowAll, | ||||||
| 			wantMatchers: []matcher.Match{}, | 			wantMatchers: matcher.MatchesFromFilterRules(tailcfg.FilterAllowAll), | ||||||
| 		}, | 		}, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user