Skip to content

Support :message_pack as cookies serializer#48103

Merged
jonathanhefner merged 1 commit intorails:mainfrom
jonathanhefner:message_pack-cookies-serializer
May 8, 2023
Merged

Support :message_pack as cookies serializer#48103
jonathanhefner merged 1 commit intorails:mainfrom
jonathanhefner:message_pack-cookies-serializer

Conversation

@jonathanhefner
Copy link
Member

@jonathanhefner jonathanhefner commented May 1, 2023

This commit adds support for :message_pack and :message_pack_allow_marshal as serializers for config.action_dispatch.cookies_serializer, just like config.active_support.message_serializer.

The :message_pack serializer can fall back to deserializing with AS::JSON, and the :message_pack_allow_marshal serializer can fall back to deserializing with AS::JSON or Marshal. Additionally, the :marshal, :json, and :hybrid / :json_allow_marshal serializers can now fall back to deserializing with AS::MessagePack. These behaviors make it easier to migrate between cookies serializers.

This commit adds support for `:message_pack` and `:message_pack_allow_marshal`
as serializers for `config.action_dispatch.cookies_serializer`, just
like `config.active_support.message_serializer`.

The `:message_pack` serializer can fall back to deserializing with
`AS::JSON`, and the `:message_pack_allow_marshal` serializer can fall
back to deserializing with `AS::JSON` or `Marshal`.  Additionally, the
`:marshal`, `:json`, and `:hybrid` / `:json_allow_marshal` serializers
can now fall back to deserializing with `AS::MessagePack`.  These
behaviors make it easier to migrate between cookies serializers.
@jonathanhefner jonathanhefner force-pushed the message_pack-cookies-serializer branch from ffdfd27 to c924ba0 Compare May 8, 2023 20:17
@jonathanhefner jonathanhefner marked this pull request as ready for review May 8, 2023 20:38
@jonathanhefner jonathanhefner merged commit 8226bba into rails:main May 8, 2023
jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request Sep 10, 2023
This covers rails#47770, rails#47964, rails#48103, and rails#48104, plus the follow-up
changes to `ActiveSupport::Cache::Store` options from rails#48449 and rails#48451.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant