Skip to content
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

[Feat] - JWT Parser #54

Merged
merged 7 commits into from
Sep 24, 2024
Merged

Conversation

EduardoDePatta
Copy link
Contributor

Hello!

This PR introduces a new JWT Parser tool that allows users to decode JSON Web Tokens (JWT) directly in their browser. The tool supports decoding the header, payload, and signature without relying on any external libraries, ensuring a lightweight and secure implementation. This approach aligns with the project's core principles of being lightweight, simple, and fast.

Key Changes

  1. Utility Functions:

    • Added decodeJWT and base64UrlDecode functions to handle the decoding of JWT tokens.
    • These functions ensure that the decoding is done safely and correctly without using external dependencies, improving the security and performance of the tool.
  2. New Component:

    • Implemented the JWTParser component, which provides a user interface for pasting JWTs, decoding them, and displaying the decoded header, payload, and signature.
    • Users can easily copy the decoded parts to the clipboard with the provided buttons.
  3. Test Suite:

    • Added tests to ensure the correct functionality of the JWT decoding process, including error handling for invalid tokens and accurate parsing of the JWT sections.
  4. Updated Tools List:

    • The new tool is accessible from the main tools page.
  5. Documentation Update:

    • Updated the README file with a direct link.

Benefits

  1. Security and Performance:

    • By avoiding external libraries for decoding JWTs, the tool minimizes potential security risks and reduces the overall footprint of the application.
  2. Efficiency:

    • Simplifies the process of decoding JWTs for developers, allowing them to quickly inspect the contents of tokens during development and debugging.
  3. Ease of Use:

    • The interface is designed to be intuitive, with clear fields for each section of the JWT and convenient copy buttons.

Additional Considerations

I also considered adding JWT signature verification, but given the current scope and the desire to keep this PR focused, I decided to leave that for a future enhancement, should this PR be approved.

@EduardoDePatta EduardoDePatta changed the title [Feature] - JWT Parser [Feat] - JWT Parser Sep 3, 2024
@peckz peckz force-pushed the feature/jwt-parser branch from e444fe7 to 5b5c700 Compare September 24, 2024 15:54
@peckz
Copy link
Collaborator

peckz commented Sep 24, 2024

@EduardoDePatta Thank you! I just tuned some minor UI stuff and resolved conflicts! Amazing tool!

@peckz peckz force-pushed the feature/jwt-parser branch from 5b5c700 to 2c48332 Compare September 24, 2024 15:56
@peckz peckz merged commit 54af5b0 into jamdotdev:main Sep 24, 2024
1 check passed
@danigrant
Copy link
Contributor

This is so awesome, I love it! Thank you for adding this! 😃

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.

3 participants