headscale/hscontrol/policy
Kristoffer Dalby 11f0d4cfdd policy/v2: include nodes with empty filters in BuildPeerMap
Previously, nodes with empty filter rules (e.g., tagged servers that are
only destinations, never sources) were skipped entirely in BuildPeerMap.
This could cause visibility issues when using autogroup:self with
multiple user groups.

Remove the len(filter) == 0 skip condition so all nodes are included in
nodeMatchers. Empty filters result in empty matchers where CanAccess()
returns false, but the node still needs to be in the map so symmetric
visibility works correctly: if node A can access node B, both should see
each other regardless of B's filter rules.

Add comprehensive tests for:
- Multi-group scenarios where autogroup:self is used by privileged users
- Nodes with empty filters remaining visible to authorized peers
- Combined access rules (autogroup:self + tags in same rule)

Updates #2990
2026-02-03 16:53:15 +01:00
..
matcher matcher: Add func for comparing Dests and TheInternet 2025-11-02 13:19:59 +01:00
policyutil make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
v2 policy/v2: include nodes with empty filters in BuildPeerMap 2026-02-03 16:53:15 +01:00
pm.go tags: process tags on registration, simplify policy (#2931) 2025-12-08 18:51:07 +01:00
policy.go policy: fix autogroup:self propagation and optimize cache invalidation (#2807) 2025-10-23 17:57:41 +02:00
policy_autoapprove_test.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
policy_route_approval_test.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
policy_test.go policy: update tests for SSH validation rules 2026-01-21 17:01:30 +00:00
route_approval_test.go policy: add test to confirm group cant approve tag 2025-12-17 09:32:05 +01:00