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

Implement URLSafeSerializer and URLSafeTimedSerializer #4

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

alext
Copy link
Member

@alext alext commented Oct 7, 2024

What

These are present in the Python implementation, but not here. They handle JSON serialising and optionally zlib compressing the payload before it is signed so that arbitrary data can be signed in the tokens.

Note: This builds on the changes in #3.

Why

For feature parity with the Python implementation.

alext added 2 commits October 7, 2024 11:17
This implements the serialization function to match the Python
URLSafeSerializer. This handles JSON encoding the payload as well as
optionally zlib-compressing it.

The python implementation uses method names dumps and loads, which match
the Python json library. I've therefore chosen to name the methods here
Marshal and Unmarshal to match the Go json library.
This is a version of URLSafeSerializer that also adds timestamps and
maxAge validation.
@alext alext requested a review from a team October 7, 2024 16:06
Base automatically changed from interface_naming to master October 11, 2024 13:51
@alext alext merged commit dae6999 into master Oct 11, 2024
1 check passed
@alext alext deleted the url_safe_serializer branch October 11, 2024 13:51
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