Skip to content

feat(acl): add autoApprovers and ACL tests to visual editor#550

Open
drifterza wants to merge 3 commits intotale:mainfrom
drifterza:feat/acl-visual-editor-sections
Open

feat(acl): add autoApprovers and ACL tests to visual editor#550
drifterza wants to merge 3 commits intotale:mainfrom
drifterza:feat/acl-visual-editor-sections

Conversation

@drifterza
Copy link
Copy Markdown
Contributor

Completes the visual ACL editor for #286. Depends on #548 and #549.

Thanks to @simone-gasparini for the groundwork in #404 that helped shape this approach.

What this adds

Extends the visual editor with the two remaining policy sections:

  • Auto Approve RoutesRecordSection<string[]> for managing CIDR-to-approvers mappings
  • Auto Approve Exit NodesRecordSection<string[]> with a fixed key, reusing the same generic component
  • ACL TestsArraySection<AclTest> with optional accept/deny destination fields

Also includes cleanup from #549: extracted KeyListRow to share the repeated key+tags layout across Groups, Tag Owners, and Routes. Dialog titles now derive from the section title prop.

acl-editor.ts

  • AclTest type replaces unknown[] for the tests field
  • CRUD helpers for tests reuse existing array mechanics
  • Four autoApprover helpers handle the nested routes/exitNode structure

Tests

3 new tests covering autoApprover independence, empty-policy safety, and ACL test CRUD. 34 total.

drifterza1 added 3 commits May 4, 2026 15:20
Add comment-json dependency for parsing HuJSON (JSON with comments
and trailing commas) used by Headscale ACL policies.

Introduces app/utils/acl-editor.ts with typed interfaces for ACL
policy entities and pure functions for parsing, serializing, and
mutating policy sections (rules, groups, hosts, tags, SSH rules).
Comment metadata is preserved through mutations via comment-json's
assign helper.

Includes 45 unit tests covering parsing, round-trips, comment
preservation, trailing comma handling, and all mutation functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants