feat(web): edit destination in place + GC certs on removal#11
Merged
Conversation
Edit in place: - PUT /api/domains/:id updates the destination (owner-only, validated, re-exports the GCS config). Hostname stays immutable. - Dashboard: per-domain "Edit destination" with Save/Cancel — no more delete-and-recreate (works on mobile). Cert garbage collection: - On DELETE, after removing the DB row + re-exporting, also delete the host's TLS cert material from GCS cert storage (best-effort; never fails the request). Pure path-matching helper (certObjectsForHost) matches the host as a whole path segment so cleaning the apex never touches www.<host>. Tests: vitest unit for certObjectsForHost (incl. no-over-deletion); integration for PUT (owner update, 400 invalid, 404 cross-account); e2e edit-in-place. Verified live: PUT updates dest; DELETE reports certsRemoved and the object is gone from GCS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Two things, both prompted by testing on
admin.f3regions.com:1. Edit a redirect destination in place
PUT /api/domains/:id— owner-only, validated, re-exports the GCS config. Hostname stays immutable (changing it is a different registration).2. Garbage-collect TLS certs on removal
Removal already cleaned the DB row + GCS flat file (verified in sync), but the issued TLS cert lingered in GCS. Now
DELETEalso removes the host's cert material (best-effort, never fails the request).certObjectsForHost()matches the host as a whole path segment (/<host>/) so cleaning the apex never deleteswww.<host>'s cert.Tests
certObjectsForHost(incl. no-over-deletion ofwww.<host>).DELETEreturns{ certsRemoved: 1 }and the cert object is gone from GCS.🤖 Generated with Claude Code