Skip to content

feat(api): add GET /redirects/{domain}/check endpoint#20

Closed
igoramf wants to merge 1 commit into
mainfrom
feat/redirect-check-endpoint
Closed

feat(api): add GET /redirects/{domain}/check endpoint#20
igoramf wants to merge 1 commit into
mainfrom
feat/redirect-check-endpoint

Conversation

@igoramf

@igoramf igoramf commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Novo endpoint GET /redirects/{domain}/check para o botão "Validate" do admin.

Retorna o status de emissão do certificado:

Status Significado
ready Certificado emitido ✅
issuing Sendo gerado, aguardar alguns minutos
dns_issue Emissão falhou — usuário deve verificar registros DNS

Motivação

Hoje o validate retorna "Certificate is not ready yet" em qualquer falha, sem contexto. Este endpoint permite ao admin mostrar feedback específico e acionável ao usuário.

Uso

GET /redirects/client.com/check

# cert pronto
{"status":"ready"}

# sendo gerado
{"status":"issuing","message":"Certificate is being generated, please wait a few minutes."}

# DNS errado
{"status":"dns_issue","message":"Certificate issuance failed. Please check your DNS records..."}

🤖 Generated with Claude Code


Summary by cubic

Adds a new GET /redirects/{domain}/check endpoint that returns the certificate issuance status for a domain. This powers the admin “Validate” button with clear, actionable feedback.

  • New Features
    • Added GET /redirects/{domain}/check returning JSON: status = ready | issuing | dns_issue (with optional message).
    • Validates domain and ensures the redirect exists; returns 404 if not found.
    • Determines status from cert-manager Certificate conditions: Ready=true → ready; Issuing=false with reason "Failed" → dns_issue; otherwise → issuing.

Written for commit 249b32f. Summary will update on new commits.

Review in cubic

Returns certificate issuance status for a domain:
- ready: certificate issued successfully
- issuing: certificate being generated (wait a few minutes)
- dns_issue: issuance failed, user should check DNS records

Designed for admin UI validate button UX — gives actionable feedback
instead of a generic 'not ready' error.
@igoramf igoramf closed this Jun 8, 2026
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