Skip to content

feat(web): edit destination in place + GC certs on removal#11

Merged
pstaylor-patrick merged 1 commit into
mainfrom
feat/edit-and-cert-gc
May 24, 2026
Merged

feat(web): edit destination in place + GC certs on removal#11
pstaylor-patrick merged 1 commit into
mainfrom
feat/edit-and-cert-gc

Conversation

@pstaylor-patrick

Copy link
Copy Markdown
Collaborator

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).
  • Dashboard: per-domain "Edit destination" with Save/Cancel — no more delete-and-recreate, works on mobile.

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 DELETE also removes the host's cert material (best-effort, never fails the request).

  • Pure certObjectsForHost() matches the host as a whole path segment (/<host>/) so cleaning the apex never deletes www.<host>'s cert.

Tests

  • unit: certObjectsForHost (incl. no-over-deletion of www.<host>).
  • integration: PUT (owner update; 400 invalid destination; 404 cross-account).
  • e2e: edit-in-place (register → edit → see new destination).
  • Verified live: PUT updates the destination; DELETE returns { certsRemoved: 1 } and the cert object is gone from GCS.

🤖 Generated with Claude Code

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>
@pstaylor-patrick pstaylor-patrick merged commit 89cf9b8 into main May 24, 2026
4 checks passed
@pstaylor-patrick pstaylor-patrick deleted the feat/edit-and-cert-gc branch May 24, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant