Skip to content

feat: add GET /redirects/{domain} and accept original domain in DELETE#13

Merged
igoramf merged 4 commits into
mainfrom
feat/redirect-api-domain-path
May 21, 2026
Merged

feat: add GET /redirects/{domain} and accept original domain in DELETE#13
igoramf merged 4 commits into
mainfrom
feat/redirect-api-domain-path

Conversation

@igoramf
Copy link
Copy Markdown
Collaborator

@igoramf igoramf commented May 21, 2026

Summary

  • Add GET /redirects/{domain} endpoint — returns a single RedirectDomain or 404
  • DELETE now accepts original domain with dots (e.g. client.com) — sanitization happens internally
  • Return 404 (not 500) when domain is not found on DELETE

Endpoints

Method Path Description
GET /redirects List all
POST /redirects Create
GET /redirects/{domain} Get one (new)
DELETE /redirects/{domain} Delete

Test plan

  • GET /redirects/client.com returns 200 with the resource
  • GET /redirects/notfound.com returns 404
  • DELETE /redirects/client.com returns 204

🤖 Generated with Claude Code


Summary by cubic

Adds GET /redirects/{domain} and lets DELETE accept dotted domains. GET and LIST now return a simplified JSON with from, to, createdAt, and certificateReady (with message when not ready).

  • New Features

    • GET /redirects/{domain} returns one redirect (200) or 404 if missing; supports the optional namespace query.
  • Bug Fixes

    • Validate the domain path param for GET and DELETE; return 400 for invalid input.
    • DELETE accepts the original dotted domain; internal sanitization maps it to the resource name and returns 404 when not found.

Written for commit 362b85f. Summary will update on new commits. Review in cubic

igoramf and others added 2 commits May 21, 2026 16:59
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread internal/api/handlers.go Outdated
…alid

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nicacioliveira
nicacioliveira previously approved these changes May 21, 2026
…T and LIST

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@igoramf igoramf merged commit 7d5cccd into main May 21, 2026
1 check passed
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.

2 participants