Skip to content

feat(plugin): JWT Faker for generating test JWTs - #540

Open
Exudev wants to merge 5 commits into
VoidenHQ:mainfrom
Exudev:feat/jwt-faker
Open

feat(plugin): JWT Faker for generating test JWTs#540
Exudev wants to merge 5 commits into
VoidenHQ:mainfrom
Exudev:feat/jwt-faker

Conversation

@Exudev

@Exudev Exudev commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #515

Add a JWT Faker plugin (plugins/jwt-faker) that enables developers to generate, customize, sign, decode, and copy JSON Web Tokens (JWTs) directly within Voiden for API authentication testing.

Features & Implementation

  • HMAC Algorithms & Signing:
    • HS256 (HMAC SHA-256)
    • HS384 (HMAC SHA-384)
    • HS512 (HMAC SHA-512)
    • none (Unsigned tokens)
  • Editors & Claim Helpers:
    • Custom JSON Header editor
    • Custom JSON Payload editor
    • Claim quick buttons: +1h exp, +1d exp, set iat, set nbf
  • Decoder & Templates:
    • Live preview of decoded header and payload
    • Template manager to save & load reusable claim configurations
    • One-click copy token to clipboard
  • Registry Integration: Registered jwt-faker in plugin registry and synced to Electron host.

Testing

  • Unit tests (plugins/jwt-faker/src/__tests__/jwtUtils.test.ts): 8/8 passed.

@phurpa-tsering

Copy link
Copy Markdown
Collaborator

Hi @Exudev , thanks for the contribution!

For plugins, we don't merge them directly into this repo — each plugin needs to live in its own public repository as a standalone community plugin. Could you:

  • Move this plugin into a separate public GitHub repo (following the same structure/conventions as our other community plugins).
  • Reply here (or open a new issue) with the link to that repo.

Once we have the link, we'll review it on our end. If no core changes are needed, we'll go ahead and list/publish it as a community plugin.

Thanks again for putting this together — looking forward to taking a look once the repo is up!

@Exudev

Exudev commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Hi @phurpa-tsering,

Thanks for the clarification! As requested, I have moved the JWT Faker plugin into its own standalone public repository following Voiden community plugin conventions:

📦 Repository: https://github.com/Exudev/voiden-plugin-jwt-faker
🚀 Release v1.0.0: https://github.com/Exudev/voiden-plugin-jwt-faker/releases/tag/v1.0.0

The repository includes the standalone build pipeline, unit & e2e tests, manifest, changelog, and automated release workflow.

Feel free to review and list/publish it in the plugin registry. Since plugins live in standalone repositories, this PR can be closed. Thanks!

@phurpa-tsering phurpa-tsering added this to the 2.3.1 milestone Aug 18, 2026
@phurpa-tsering

phurpa-tsering commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Hi @Exudev — took a look at the standalone repo, the core JWT/HMAC logic checks out and the tests pass. One structural thing worth fixing before we list it:

The project was hand-built (build.mjs, shim list, release.yml, etc. look manually adapted from an existing plugin) rather than scaffolded from our official tooling. Could you regenerate the project using @voiden/create-plugin instead?

npm create @voiden/plugin voiden-plugin-jwt-faker

and port your src/ logic (jwtUtils.ts, JwtFakerModal.tsx, etc.) into the generated scaffold. That gives you the maintained build/zip/release scripts (npm run build, npm run zip, npm run release) and the correct .github/workflows/release.yml, so the release assets stay in sync with what the installer/registry expects — e.g. the scaffold's workflow renames the bundle to dist/main.js before publishing, which your current manual workflow doesn't do.

Also worth fixing while you're in there: context.registerStatusBarItem(...) in src/main.ts is missing the required position: 'left' | 'right' field, so the status bar button never actually renders — right now there's no way to open the plugin from the UI.

@Exudev

Exudev commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Hi @phurpa-tsering,

Thanks for the feedback! I've updated the project using the official @voiden/create-plugin scaffolding:

  1. Scaffolding & Workflow: Regenerated using @voiden/create-plugin tooling with maintained build.mjs, build-main.mjs, zip.mjs, generate-manifest.mjs, and .github/workflows/release.yml. The release workflow now builds and packages both the bundle JS and jwt-faker.zip release archive.
  2. Status Bar Registration: Updated registerStatusBarItem in src/main.ts with position: 'left' and label: 'JWT Faker' so the status bar button correctly renders in the Voiden UI.

🚀 Updated Release v1.0.1: https://github.com/Exudev/voiden-plugin-jwt-faker/releases/tag/v1.0.1

Thanks again for the review!

@phurpa-tsering

Copy link
Copy Markdown
Collaborator

Thanks for building this out — solid feature overall. Two UI requests before merge:

1. Dialog → tab

JwtFakerModal.tsx renders as a full-screen blocking modal (fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm). That's not the pattern the rest of Voiden uses for tools like this — could you rework it as a tab instead of a dialog, so it sits alongside the editor rather than covering it?

2. Theme-color compliance

Several classes here are hardcoded Tailwind defaults rather than Voiden's theme tokens, so they won't track the active theme (light/dark/custom):

  • text-yellow-500, text-red-500, bg-red-500/10, border-red-500/30, text-red-400, text-purple-400 — raw palette colors instead of theme-aware ones.
  • bg-primary, text-primary-foreground, bg-input, text-foreground, text-muted — these don't match Voiden's existing theme classes. The rest of the codebase uses things like bg-panel, border-border, bg-active, text-accent, text-comment, text-status-error / text-status-success for exactly this kind of UI (e.g. the response body viewer's action buttons, or the assertion results pass/fail styling).

Could you swap these over so the JWT editor matches the rest of the app across themes? Happy to point to more concrete examples in the codebase if useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(plugin): JWT Faker for generating test JWTs

2 participants