headscale/hscontrol/policy
Kristoffer Dalby 2e1a716a9a policy/v2: fix empty grants/acls returning FilterAllowAll
compileFilterRules, compileGrants, and updateLocked guarded the
"no rules so allow all" fallback with len(pol.Grants) == 0, which
matches both an absent grants field and an explicit empty array.
JSON {"grants": []} unmarshals to a non-nil empty slice; it should
compile to zero filter rules (deny all) to match Tailscale SaaS,
but the length check sent it down the FilterAllowAll path.

Distinguish absent (nil) from explicit-empty by switching the guard
to pol.Grants == nil, the same asymmetry already used for ACLs.
{} keeps allowing all; {"acls": []} and {"grants": []} now both
deny all.

Fixes #3211
2026-04-29 08:55:07 +01:00
..
matcher matcher: clarify DestsIsTheInternet single-family semantics 2026-04-17 16:31:49 +01:00
policyutil policyutil: fix reduceCapGrantRule and add route reduction 2026-04-17 16:31:49 +01:00
v2 policy/v2: fix empty grants/acls returning FilterAllowAll 2026-04-29 08:55:07 +01:00
pm.go policy/v2,state,mapper: implement per-viewer via route steering 2026-04-01 14:10:42 +01:00
policy.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01: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 types: consider subnet routes as source identity in ACL matching 2026-04-17 16:31:49 +01:00
route_approval_test.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00