-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Add jwt-tool extension #24385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add jwt-tool extension #24385
Conversation
|
Congratulations on your new Raycast extension! 🚀 Due to our current reduced availability, the initial review may take up to 10-15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
Greptile OverviewGreptile SummaryThis PR adds a new JWT Tool extension to Raycast that enables users to encode and decode JSON Web Tokens directly from the Raycast launcher. What Changed:
Integration: Confidence Score: 2/5
Important Files ChangedFile Analysis
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 4 comments
| "dependencies": { | ||
| "@raycast/api": "^1.103.0", | ||
| "@raycast/utils": "^2.2.1", | ||
| "jsonwebtoken": "^9.0.2" | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @types/jsonwebtoken in devDependencies. This will cause TypeScript compilation errors since the jsonwebtoken package doesn't include built-in type definitions. Add "@types/jsonwebtoken": "^9.0.10" to devDependencies.
| <ActionPanel> | ||
| <Action.SubmitForm title="Encode JWT" icon={Icon.Key} onSubmit={handleEncode} /> | ||
| {encodedToken && <Action title="Copy Token" icon={Icon.Clipboard} onAction={copyToClipboard} />} | ||
| {encodedToken && <Action title="Done" icon={Icon.Checkmark} onAction={() => null} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This "Done" action does nothing (onAction={() => null}). Either remove it or implement meaningful functionality. Having a no-op action clutters the UI without providing value.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| const token = jwt.sign(payloadObj, secret, { | ||
| algorithm: algorithm as jwt.Algorithm, | ||
| header: headerObj, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header option overrides the algorithm option. When users select an algorithm from the dropdown but the header JSON contains a different alg field, the header takes precedence, causing confusion. Either remove the algorithm dropdown or don't pass headerObj to jwt.sign() and let the library construct the header based on the algorithm option.
| "commands": [ | ||
| { | ||
| "name": "encode", | ||
| "title": "Encode", | ||
| "description": "encode jwt payload", | ||
| "mode": "view", | ||
| "subtitle": "JWT Encode" | ||
| }, | ||
| { | ||
| "name": "decode", | ||
| "title": "Decode", | ||
| "description": "decode jwt payload", | ||
| "mode": "view", | ||
| "subtitle": "JWT Decode" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing required metadata/ folder. Both commands use "mode": "view", which requires Raycast-styled screenshots in a metadata/ folder at the extension root. Screenshots should be named like jwt-tool-1.png, jwt-tool-2.png, etc. See: https://developers.raycast.com/basics/prepare-an-extension-for-store#screenshots
|
Thanks for your contribution @ayuayue 🔥 We already have multiple extensions in the Store that deal with JWT. Could we consider enhancing one of the existing extensions below instead of creating another one? If there are unique features or workflows you’re aiming to add, we’d love to hear them and see if they can be integrated into one of these to avoid duplication and improve discoverability.
|
Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder