headscale/hscontrol/policy/v2
Kristoffer Dalby 17236fd284 all: annotate complex functions with gocyclo rationale
Splitting these functions does not buy clarity — each has been
extracted before and put back. Pin the //nolint:gocyclo on each
with the reason their shape resists clean decomposition.

  policy/v2/policy.go     ViaRoutesForPeer        — three-pass
                                                    via-grant resolution
  policy/v2/filter.go     compileSSHPolicy        — per-rule
                                                    branches with
                                                    intertwined
                                                    autogroup:self
                                                    handling
                                                    (annotated in the
                                                    earlier nil-error
                                                    commit)
  state/state.go          HandleNodeFromPreAuthKey — security-
                                                    sensitive
                                                    sequential
                                                    validation order
  servertest/routes_test  TestRoutes              — table-driven
                                                    test driver with
                                                    many independent
                                                    subtests

Also: //nolint:recvcheck on policy/v2.SSHUser — UnmarshalJSON
requires a pointer receiver; the other methods on this string
newtype use value receivers by convention.
2026-05-19 09:55:22 +02:00
..
testdata policy/v2: add SaaS goldens for via-grant prefix containment 2026-05-18 14:02:00 +02:00
compiled.go policy/v2: match via-grant destinations by prefix overlap 2026-05-18 14:02:00 +02:00
filter.go metrics, policy/v2: drop unused scaffolding + nil-error returns 2026-05-19 09:55:22 +02:00
filter_test.go metrics, policy/v2: drop unused scaffolding + nil-error returns 2026-05-19 09:55:22 +02:00
issue_3212_test.go policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
issue_3233_test.go policy/v2: surface autogroup:internet via grants on exit nodes 2026-04-30 19:22:45 +01:00
issue_3267_test.go metrics, policy/v2: drop unused scaffolding + nil-error returns 2026-05-19 09:55:22 +02:00
main_test.go all: fix test flakiness and improve test infrastructure 2026-03-14 02:52:28 -07:00
nodeattrs_test.go policy/v2: parse, validate, and compile nodeAttrs 2026-05-13 14:22:30 +02:00
policy.go all: annotate complex functions with gocyclo rationale 2026-05-19 09:55:22 +02:00
policy_test.go policy/v2: match via-grant destinations by prefix overlap 2026-05-18 14:02:00 +02:00
policytester_compat_test.go policy/v2: match default proto set for tests with no proto 2026-05-12 11:54:54 +01:00
sshtest.go policy/v2: evaluate sshTests at write boundary 2026-05-13 21:10:13 +02:00
sshtest_test.go policy/v2: evaluate sshTests at write boundary 2026-05-13 21:10:13 +02:00
sshtester_compat_test.go policy/v2: add sshtester compat runner 2026-05-13 21:10:13 +02:00
tailnet_state_caps.go types/config, types/node: model default-auto-update from auto_update.enabled 2026-05-13 14:22:30 +02:00
tailscale_acl_data_compat_test.go metrics, policy/v2: drop unused scaffolding + nil-error returns 2026-05-19 09:55:22 +02:00
tailscale_grants_compat_test.go metrics, policy/v2: drop unused scaffolding + nil-error returns 2026-05-19 09:55:22 +02:00
tailscale_nodeattrs_compat_test.go types/config, types/node: model default-auto-update from auto_update.enabled 2026-05-13 14:22:30 +02:00
tailscale_routes_data_compat_test.go metrics, policy/v2: drop unused scaffolding + nil-error returns 2026-05-19 09:55:22 +02:00
tailscale_ssh_data_compat_test.go policy/v2: evaluate sshTests at write boundary 2026-05-13 21:10:13 +02:00
test.go policy/v2: evaluate sshTests at write boundary 2026-05-13 21:10:13 +02:00
test_test.go policy/v2: match default proto set for tests with no proto 2026-05-12 11:54:54 +01:00
types.go all: annotate complex functions with gocyclo rationale 2026-05-19 09:55:22 +02:00
types_test.go policy/v2: evaluate sshTests at write boundary 2026-05-13 21:10:13 +02:00
utils.go policy/v2: exclude exit routes from ReduceFilterRules 2026-04-01 14:10:42 +01:00
utils_test.go policy/v2: exclude exit routes from ReduceFilterRules 2026-04-01 14:10:42 +01:00