feat(ui): structured editor for ACL rules, tags and groups (#608)

This commit is contained in:
albedev
2026-08-28 21:58:06 +02:00
committed by GitHub
parent 30c842ed8d
commit 72ea6aa0b3
28 changed files with 2414 additions and 37 deletions
+10 -2
View File
@@ -41,8 +41,16 @@ describe("extractTagOwnerTags", () => {
).toEqual(["tag:prod", "tag:server"]);
});
test("ignores invalid policies", () => {
expect(extractTagOwnerTags("not-json")).toEqual([]);
test("returns undefined when the policy cannot be read or parsed", () => {
// An unreadable policy is not the same as one declaring no tags: callers
// use `undefined` to keep the tag dialog from flagging every tag.
expect(extractTagOwnerTags(undefined)).toBeUndefined();
expect(extractTagOwnerTags("not-json")).toBeUndefined();
});
test("returns an empty list when the policy declares no tags", () => {
expect(extractTagOwnerTags("")).toEqual([]);
expect(extractTagOwnerTags('{ "groups": { "group:eng": ["alice@"] } }')).toEqual([]);
});
});