Add update record endpoint #7

Merged
antman merged 11 commits from add-update-record-endpoint into main 2026-09-03 07:03:47 +00:00
Owner

Motivation

The server manager will need an endpoint where it can update existing DNS records, for example if the IP address of the server changes.

Solution

Implemented and endpoint to update an existing DNS record. Found that supplying an invalid record id (not a valid uuid) could cause the server to throw and return 500. When the client supplies incorrect data, the server must return a 400, so implemented a middleware that validates the record id before the controller operates on it.

### Motivation The server manager will need an endpoint where it can update existing DNS records, for example if the IP address of the server changes. ### Solution Implemented and endpoint to update an existing DNS record. Found that supplying an invalid record id (not a valid uuid) could cause the server to throw and return 500. When the client supplies incorrect data, the server must return a 400, so implemented a middleware that validates the record id before the controller operates on it.
Add tests for update record endpoint
Some checks failed
/ test-and-lint (push) Failing after 10s
2e1663e4d3
Adds schema deno task
Some checks failed
/ test-and-lint (push) Failing after 10s
eb8564c9de
adds update record endpoint
Some checks failed
/ test-and-lint (push) Failing after 10s
7119d55d5b
update test
Some checks failed
/ test-and-lint (push) Failing after 10s
3ecd3b29fa
update porkbun mock
Some checks failed
/ test-and-lint (push) Failing after 9s
fda58ed455
return updated record
Some checks failed
/ test-and-lint (push) Failing after 12s
d1aea80f48
Validate record id
All checks were successful
/ test-and-lint (push) Successful in 10s
6ddac24e4c
cleanup mock logs
All checks were successful
/ test-and-lint (push) Successful in 10s
522de5d766
cleanup auth log
All checks were successful
/ test-and-lint (push) Successful in 11s
777c1c334c
hmm
All checks were successful
/ test-and-lint (push) Successful in 10s
b3c04e3e93
antman changed title from WIP: Add tests for update record endpoint to WIP: Add update record endpoint 2026-09-03 06:53:20 +00:00
lint auth
All checks were successful
/ test-and-lint (push) Successful in 9s
385959e1dc
@ -0,0 +30,4 @@
content: updated.content,
ttl: updated.ttl,
priority: updated.priority,
notes: updated.notes,
Author
Owner

I explicitly set the properties here so that extra properties in the update object don't get saved to the database. Otherwise someone could supply a property like domainId in their request and the server would change which domain a record was for 😬

I explicitly set the properties here so that extra properties in the update object don't get saved to the database. Otherwise someone could supply a property like `domainId` in their request and the server would change which domain a record was for 😬
antman changed title from WIP: Add update record endpoint to Add update record endpoint 2026-09-03 07:03:27 +00:00
antman merged commit 645fb7b598 into main 2026-09-03 07:03:47 +00:00
antman deleted branch add-update-record-endpoint 2026-09-03 07:03:47 +00:00
antman referenced this pull request from a commit 2026-09-03 07:03:48 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kill-the-cloud/api-server!7
No description provided.