fix(dns): validate googledns delete record ids#481
Conversation
Greptile SummaryThis PR hardens the
Confidence Score: 5/5Safe to merge — the change adds a targeted guard in one function with no regressions to existing call paths. The validation logic correctly handles all malformed recordId edge cases (missing separator, empty type, empty name), the firstRecord narrowing is a straightforward TypeScript correctness fix, and the no-op early-return behavior is fully preserved. No other code paths in the file are touched. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[deleteRecord called\nzoneId, recordId, config] --> B[Get access token\n& project ID]
B --> C{recordId valid?\nseparatorIndex check}
C -- invalid --> D[throw Error:\ninvalid record id]
C -- valid --> E[slice type & name\nfrom recordId]
E --> F[listRecords → filter\nby type & name]
F --> G{firstRecord\nexists?}
G -- no --> H[return no-op]
G -- yes --> I[Build FQDN\nread firstRecord.ttl]
I --> J[POST /changes\ndeletions = all rrdatas]
J --> K{res.ok or 404?}
K -- no --> L[throw Error:\nHTTP status]
K -- yes --> M[done]
Reviews (2): Last reviewed commit: "fix(dns): preserve googledns file encodi..." | Re-trigger Greptile |
Fixes #454.
Summary:
Validation:
Submitted for the ugig bounty/gig: Need someone to test submit bugs and PRs to fix those bugs.
Solana wallet for bounty payout:
Dy4yMkjCfupxaURt6iTMUrxqSDEmAJPPkKF66QahxJZD