headscale/hscontrol/policy/v2
Kristoffer Dalby 22afb2c61b policy: fix asymmetric peer visibility with autogroup:self
When autogroup:self was combined with other ACL rules (e.g., group:admin
-> *:*), tagged nodes became invisible to users who should have access.

The BuildPeerMap function had two code paths:
- Global filter path: used symmetric OR logic (if either can access, both
  see each other)
- Autogroup:self path: used asymmetric logic (only add peer if that
  specific direction has access)

This caused problems with one-way rules like admin -> tagged-server. The
admin could access the server, but since the server couldn't access the
admin, neither was added to the other's peer list.

Fix by using symmetric visibility in the autogroup:self path, matching
the global filter path behavior: if either node can access the other,
both should see each other as peers.

Credit: vdovhanych <vdovhanych@users.noreply.github.com>

Fixes #2990
2026-01-21 14:35:16 +01:00
..
filter.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
filter_test.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
policy.go policy: fix asymmetric peer visibility with autogroup:self 2026-01-21 14:35:16 +01:00
policy_test.go policy: fix asymmetric peer visibility with autogroup:self 2026-01-21 14:35:16 +01:00
types.go policy: clarify usernam resolve comment 2025-12-16 10:12:36 +01:00
types_test.go tags: process tags on registration, simplify policy (#2931) 2025-12-08 18:51:07 +01:00
utils.go modernize: run gopls modernize to bring up to 1.25 (#2920) 2025-12-01 19:40:25 +01:00
utils_test.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00