Skip to content

feat(acl): visual editor UI with generic section components#549

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

feat(acl): visual editor UI with generic section components#549
drifterza wants to merge 2 commits intotale:mainfrom
drifterza:feat/acl-visual-editor

Conversation

@drifterza
Copy link
Copy Markdown
Contributor

@drifterza drifterza commented May 4, 2026

Builds on #548 and adds the interactive visual editor as a new tab on the ACL page.

Two generic components — ArraySection<T> and RecordSection<V> — handle all shared CRUD mechanics (add/edit/remove dialogs, list rendering). Five section instances built on top: ACL Rules, Groups, Hosts, Tag Owners, SSH Rules.

Edits stay in-memory and sync with the code editor tab. Nothing is saved to Headscale until the user clicks "Save". Record renames use remove+set to keep logic simple. comment-json assign() preserves HuJSON comment metadata throughout.

Also fixed a pre-existing type error in tests/integration/api/nodes.test.ts.

PR 2 of 3 for the visual ACL editor (#286):

Thanks to @simone-gasparini for the initial work in #404.

@drifterza drifterza requested a review from tale as a code owner May 4, 2026 13:15
@drifterza
Copy link
Copy Markdown
Contributor Author

acl-blank
acl-blank1
acl-1
acl-2
acl-3

drifterza1 added 2 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