fix: serialize delegations and repair verification

This commit is contained in:
bryanpedini committed 2026-11-19 15:46:12 +01:00
1 parent 99fa5de747
commit 5f17aab6ca
8 files changed
+99 -43

No files matched your search

+6
View File
@@ -192,6 +192,9 @@ func TestDelegationGrant(t *testing.T) {
if res.status != 204 || !h.store.hasDelegation(testZone, bob.ID) {
t.Fatalf("%d %s", res.status, res.body)
}
if len(h.store.zoneLocks) != 1 || h.store.zoneLocks[0] != testZone {
t.Fatalf("grant locks = %v", h.store.zoneLocks)
}
e := expectChange(t, res, opDelegationGrant, 204, bob.ID, "", `{"zone":"example.org.","username":"bob"}`)
if e.Zone.String != testZone {
t.Fatal(e.Zone)
@@ -237,6 +240,9 @@ func TestDelegationRevoke(t *testing.T) {
if res.status != 204 || h.store.hasDelegation(testZone, carol.ID) {
t.Fatalf("%d %s", res.status, res.body)
}
if len(h.store.zoneLocks) != 1 || h.store.zoneLocks[0] != testZone {
t.Fatalf("revoke locks = %v", h.store.zoneLocks)
}
expectChange(t, res, opDelegationRevoke, 204, carol.ID, `{"zone":"example.org.","username":"carol"}`, "")
res = h.api("DELETE", "/zones/example.org/users/carol", token, "")
expectError(t, res, 404, `{"error":"delegation not found"}`)