Skip to content

feat: add JWT decoder command#6

Merged
jamartif merged 1 commit intomainfrom
feat/jwt-decoder
Apr 25, 2026
Merged

feat: add JWT decoder command#6
jamartif merged 1 commit intomainfrom
feat/jwt-decoder

Conversation

@jamartif
Copy link
Copy Markdown
Owner

@jamartif jamartif commented Apr 25, 2026

Summary

  • Añade el comando WrenchIT: Decodificar JWT que decodifica el token seleccionado (header + payload) y lo reemplaza por JSON formateado.
  • Reutiliza formatJsonText ya existente; sin nuevas dependencias.
  • El comando aparece en el menú contextual del editor cuando hay selección.

Comportamiento

Dado un JWT seleccionado como eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIn0.sig, produce:

{
  "header": {
    "alg": "HS256"
  },
  "payload": {
    "sub": "user"
  }
}

La firma no se verifica (solo se decodifican header y payload).

Test plan

  • Seleccionar un JWT válido y ejecutar el comando → se reemplaza por JSON formateado con header y payload.
  • Ejecutar sin selección → aviso de selección requerida.
  • Seleccionar texto que no sea JWT (sin .) → mensaje de error.
  • Seleccionar texto Base64url malformado → mensaje de error genérico.
  • Verificar que el comando aparece en el menú contextual solo con selección.

🤖 Generated with Claude Code

Decodes a selected JWT token (header + payload) into formatted JSON.
Uses Base64url decoding and the existing formatJsonText formatter; no
external dependencies added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jamartif jamartif merged commit 9d9125d into main Apr 25, 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.

1 participant