test(ui): avoid a literal em dash in the em dash check
- test(ui): avoid a literal em dash in the em dash check - fix(cli): accept any positive int64 audit count and share the last active admin rule - fix(api): limit audit before_id to 2^53-1 - fix(api): audit unmatched api requests, bound every request body and record audit write failures - fix(ui): recheck the account in the login transaction and require existing zones on zone pages - fix(api): recheck the acting admin and the stored password hash in change transactions - fix(db): keep committed outcomes on lock release failure, narrow the records contract and trace sql statements - fix(db): make the initial migration restartable and verify the application schema - fix(auth): never move last_seen_at backwards on concurrent session touches - test(api): cover lock release failure after commit and handler tracing without secrets - fix(test): redact credentials from mysql setup errors - fix(audit): retain addressed objects on admin refusals - test(db): cover migration restarts and records contract ranges in mysql - test(api): verify account races and audit rollback in mysql - fix(auth): reject password changes after account deletion - docs: document unknown api audit entries - fix(audit): bound failure retries and redact sensitive sql parameters - fix(test): isolate docker resources and cover image cli commands - test(auth): expect unauthorized after an account deletion race - fix(db): verify application column widths and foreign keys
This commit is contained in:
1 parent
5f17aab6ca
commit
53444bec7a
40 files changed
+2332
-254
No files matched your search
@@ -8,6 +8,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
@@ -101,8 +102,19 @@ func TestIntegrationZoneAPIHandlers(t *testing.T) {
|
||||
}
|
||||
it.call(t, admin, "zone_create", "", "", zoneAPITestCreate, 409)
|
||||
it.call(t, user, "zone_create", "", "", zoneAPITestCreate, 403)
|
||||
if !strings.Contains(string(it.audit(t, "zone_create", 1)[0].After), `"username": "bob"`) {
|
||||
t.Fatal("zone creation audit omitted the stale delegation")
|
||||
createdZone := it.audit(t, "zone_create", 1)[0]
|
||||
var before []zoneAPIAuditDelegation
|
||||
var after []zoneAPIAuditRecord
|
||||
if err := json.Unmarshal(createdZone.Before, &before); err != nil || len(before) != 1 || before[0].Zone != zoneAPITestName || before[0].Username != "bob" {
|
||||
t.Fatalf("zone creation before snapshot: %s (%v)", createdZone.Before, err)
|
||||
}
|
||||
if err := json.Unmarshal(createdZone.After, &after); err != nil || len(after) != 3 {
|
||||
t.Fatalf("zone creation after snapshot: %s (%v)", createdZone.After, err)
|
||||
}
|
||||
for _, record := range after {
|
||||
if record.ID <= 0 || record.Zone != zoneAPITestName || (record.Type != "SOA" && record.Type != "NS") {
|
||||
t.Fatalf("unexpected zone creation after snapshot: %+v", record)
|
||||
}
|
||||
}
|
||||
if allowed, err := it.delegations.HasDelegation(t.Context(), zoneAPITestName, user.ID); allowed || err != nil {
|
||||
t.Fatalf("stale delegation retained: %v, %v", allowed, err)
|
||||
|
||||
Reference in new issue
Block a user