rrrodzilla / rusty_paseto

A type-driven, ergonomic RUST implementation of the PASETO protocol for secure stateless tokens.
https://crates.io/crates/rusty_paseto
MIT License
68 stars 8 forks source link

Hotfix v0.7.1 #40

Closed rrrodzilla closed 1 month ago

rrrodzilla commented 1 month ago

IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

Please provide enough information so that others can review your pull request:

Explain the details for making this change. What existing problem does the pull request solve?

Test plan (required)

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Code formatting

Closing issues

Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

rrrodzilla commented 1 month ago

Pull Request Summary

Description

This pull request closes #39 , which reported an invalid JSON payload when using CustomClaims with types that serialize to JSON objects. The issue caused the builder to generate an invalid JSON payload due to improper handling of multiple object delimiters, resulting in successful token creation but failed validation with a JSON error.

Changes Made

Key Test Scenarios

Conclusion

The updates ensure that the CustomClaims builder generates valid JSON payloads, resolving the reported issue. The added tests demonstrate that the solution is robust and reliable for various practical use cases, contributing to the overall stability and reliability of the system.

Credit and thanks to @xbb for reporting the issue by opening issue #39 and for taking the time to offer a solution.