headscale/hscontrol/policy
Kristoffer Dalby 171fd7a3c5 policy: key autogroup:self invalidation on UserID not User view
invalidateAutogroupSelfCache derived the owning user from
node.User().ID(), dereferencing the User association view. The
NodeStore stores nodes by value with User as a *User pointer, and not
every write path hydrates that association, so a non-tagged node could
reach SetNodes with UserID set but User nil. UserView.ID() then
dereferenced a nil *User and panicked on /machine/map whenever an
autogroup:self policy was active and a node restarted tailscaled.

Group affected nodes by node.TypedUserID(), which reads the UserID
field directly. UserID is the authoritative ownership field for
non-tagged nodes, so this needs no hydrated association and fixes every
.User().ID() site in the function.
2026-05-29 21:42:56 +02:00
..
matcher all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
policyutil all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
v2 policy: key autogroup:self invalidation on UserID not User view 2026-05-29 21:42:56 +02:00
pm.go all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
policy.go all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
policy_autoapprove_test.go policy/v2: refactor alias resolution to use ResolvedAddresses 2026-04-01 14:10:42 +01:00
policy_route_approval_test.go all: apply golangci-lint 2.9.0 fixes 2026-02-19 08:21:23 +01:00
policy_test.go policy/v2: align SSH rule validation with Tailscale 2026-05-13 21:10:13 +02:00
route_approval_test.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00