headscale/hscontrol/mapper
Shourya Gautam 4e1834adaf
db: use PolicyManager for RequestTags migration
Refactor the RequestTags migration (202601121700-migrate-hostinfo-request-tags)
to use PolicyManager.NodeCanHaveTag() instead of reimplementing tag validation.

Changes:
- NewHeadscaleDatabase now accepts *types.Config to allow migrations
  access to policy configuration
- Add loadPolicyBytes helper to load policy from file or DB based on config
- Add standalone GetPolicy(tx *gorm.DB) for use during migrations
- Replace custom tag validation logic with PolicyManager

Benefits:
- Full HuJSON parsing support (not just JSON)
- Proper group expansion via PolicyManager
- Support for nested tags and autogroups
- Works with both file and database policy modes
- Single source of truth for tag validation


Co-Authored-By: Shourya Gautam <shouryamgautam@gmail.com>
2026-01-21 15:10:29 +01:00
..
batcher.go hscontrol: fix tag updates not propagating to node self view 2026-01-20 10:13:47 +01:00
batcher_lockfree.go oidc: make email verification configurable 2025-12-18 11:42:32 +00:00
batcher_test.go db: use PolicyManager for RequestTags migration 2026-01-21 15:10:29 +01:00
builder.go change: smarter change notifications 2025-12-16 10:12:36 +01:00
builder_test.go bunch of qol (#2748) 2025-08-27 17:09:13 +02:00
mapper.go hscontrol: fix tag updates not propagating to node self view 2026-01-20 10:13:47 +01:00
mapper_test.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
tail_test.go types: add option to disable taildrop, improve tests (#2955) 2025-12-12 11:35:16 +01:00