{{ message }}
Repository navigation
Allow the v2 encryptor to serialize messages with Marshal - #44
Merged
Merged
Conversation
Marshal and JSON serialization are unavoidably different. A key difference being that JSON serializes ruby symbols as strings, while Marshal preserves them as symbols.
jcmfernandes
force-pushed
the
v2-marshal
branch
from
August 10, 2024 09:58
6e95907 to
db5b079
Compare
Member
MarshalMarshal
Member
|
Just touching base here - any chance you are able to rebase on main? |
ioquatix
approved these changes
Jan 4, 2025
ioquatix
left a comment
Member
There was a problem hiding this comment.
Let's take the conservative approach for now, we can revisit making JSON the default later.
ioquatix
pushed a commit
that referenced
this pull request
Jan 4, 2025
Marshal and JSON serialization are unavoidably different. A key difference being that JSON serializes ruby symbols as strings, while Marshal preserves them as symbols. * Support UTF-8 data when using the JSON serializer * Replace all instance of 'BINARY' with `Encoding::BINARY`
ioquatix
pushed a commit
that referenced
this pull request
Jan 4, 2025
Marshal and JSON serialization are unavoidably different. A key difference being that JSON serializes ruby symbols as strings, while Marshal preserves them as symbols. * Support UTF-8 data when using the JSON serializer * Replace all instance of 'BINARY' with `Encoding::BINARY`
Contributor
Author
ioquatix
pushed a commit
that referenced
this pull request
May 6, 2025
Marshal and JSON serialization are unavoidably different. A key difference being that JSON serializes ruby symbols as strings, while Marshal preserves them as symbols. * Support UTF-8 data when using the JSON serializer * Replace all instance of 'BINARY' with `Encoding::BINARY`
ioquatix
pushed a commit
that referenced
this pull request
May 9, 2025
Marshal and JSON serialization are unavoidably different. A key difference being that JSON serializes ruby symbols as strings, while Marshal preserves them as symbols. * Support UTF-8 data when using the JSON serializer * Replace all instance of 'BINARY' with `Encoding::BINARY`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is a follow-up on #39 that must be merged first.
I deliberately avoided allowing
Marshalserialization in the v2 encryptor because 1)Marshalhas been a source of RCE vulnerabilities and 2) serializing messages as JSON allows for better interoperability, making it trivial to access sessions created with rack-session in other languages.However, it's impossible to swap
MarhalwithJSONwithout breaking users' code that relies onMarhalbehavior thatJSONdoesn't mimic (e.g., preserving ruby symbols).So... I see 3 ways forward:
Happy to hear some feedback.