chore: strict Subdomain Validation with Detailed Error Messages #42

Merged
hodlbod merged 1 commits from userAdityaa/caravel:subdomain-validation into master 2026-04-21 13:09:37 +00:00
Contributor

Summary

Enhanced subdomain validation across the API and frontend to enforce DNS label standards and block reserved names. The system now returns specific, actionable error messages instead of generic validation failures, and the edit flow no longer silently auto-corrects invalid input.

New Error Codes & Messages

  • subdomain-empty → "subdomain is required"
  • subdomain-too-long → "subdomain must be 63 characters or fewer"
  • subdomain-invalid-hyphen → "subdomain cannot start or end with a hyphen"
  • subdomain-reserved → "subdomain is reserved"
  • subdomain-invalid-characters → "subdomain may only contain lowercase letters, numbers, and hyphens"

Subdomain Validation Rules

Length: 1–63 Characters
Why 63? DNS labels (the parts between dots) are limited to 63 octets per RFC 1035

Reserved Names: api, admin
Why reserved? Common infrastructure naming conventions use these labels for platform-wide endpoints:

  • api.* — reserved for the platform's API endpoints
  • admin.* — reserved for admin dashboards and management interfaces

Blocking these prevents user relays from conflicting with infrastructure routes and maintains clear semantic separation between user resources and system services.

Screenshot 2026-04-21 at 4.30.19 PM.png Screenshot 2026-04-21 at 4.30.31 PM.png Screenshot 2026-04-21 at 4.30.24 PM.png

closes #37

### Summary Enhanced subdomain validation across the API and frontend to enforce DNS label standards and block reserved names. The system now returns specific, actionable error messages instead of generic validation failures, and the edit flow no longer silently auto-corrects invalid input. ### New Error Codes & Messages * subdomain-empty → "subdomain is required" * subdomain-too-long → "subdomain must be 63 characters or fewer" * subdomain-invalid-hyphen → "subdomain cannot start or end with a hyphen" * subdomain-reserved → "subdomain is reserved" * subdomain-invalid-characters → "subdomain may only contain lowercase letters, numbers, and hyphens" ### Subdomain Validation Rules Length: 1–63 Characters **Why 63?** DNS labels (the parts between dots) are limited to 63 octets per RFC 1035 Reserved Names: api, admin **Why reserved?** Common infrastructure naming conventions use these labels for platform-wide endpoints: * api.* — reserved for the platform's API endpoints * admin.* — reserved for admin dashboards and management interfaces Blocking these prevents user relays from conflicting with infrastructure routes and maintains clear semantic separation between user resources and system services. <img width="1434" alt="Screenshot 2026-04-21 at 4.30.19 PM.png" src="attachments/9d26dc2a-e7eb-4a52-b247-0affee069453"> <img width="1434" alt="Screenshot 2026-04-21 at 4.30.31 PM.png" src="attachments/ee2ea425-7786-4142-835a-23adca99b66d"> <img width="1434" alt="Screenshot 2026-04-21 at 4.30.24 PM.png" src="attachments/891ecbc4-d5c5-401c-b69a-5b9f17425be9"> closes #37
hodlbod added 1 commit 2026-04-21 13:09:31 +00:00
hodlbod force-pushed subdomain-validation from f11d23d23e to a10012df46 2026-04-21 13:09:31 +00:00 Compare
hodlbod merged commit a26bc1127d into master 2026-04-21 13:09:37 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coracle/caravel#42