mailkick 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29547fd14ea942978a05dce4e217a19095b3e60b32d4f3d0da658603d02b2ef1
4
- data.tar.gz: 5df27e5ebc7a4be7c60ea04251a78baaba22cf19d958a9043e0fdf30ec3760e2
3
+ metadata.gz: 2d27cea2a7290b64e0b7d59322124923e5c84069040d43df800269bd17069aec
4
+ data.tar.gz: 4a40900192322ef6e5f04940277713ce43d0c64c3a672ec29ec3a5dbd2269e80
5
5
  SHA512:
6
- metadata.gz: d656f3001137374753348508afe6a86a226039a9fba1873fad479d6f6b8f43ecf79f59e28fca498a505ab7b8467b44863fe8b6866f13c305530bc497976f5f49
7
- data.tar.gz: 06b66e4eb5e9ba1705e8f62eaa3a953e8ff3fef54d65ca44ff6981313d36408e38533154258107cca82a8b02033772e311ee11be07e71dddb99a05be1bee2772
6
+ metadata.gz: 39fc8af0c0b60f613834f05e9b02b8bbe795cb483ce62e4a99016d257ae0345ff7a97d024d5e4c9791b04f5074e51679b92175470e987e613152034aa8ee5128
7
+ data.tar.gz: b1f1ed3b224be6bfb74d87851e029a797783b7bf25d4d19c09a2b1867b3ce6a1803e19cabf7942ec9eedd1575c3aff6f6279386373fe8a6af807f659bb395817
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
+ ## 1.1.1 (2023-01-30)
2
+
3
+ - Switched to JSON for serialization with non-default `secret_token`
4
+
1
5
  ## 1.1.0 (2023-01-29)
2
6
 
3
7
  - Improved secret token generation
8
+ - Switched to JSON for serialization with default `secret_token`
4
9
 
5
10
  ## 1.0.1 (2021-06-20)
6
11
 
@@ -0,0 +1,15 @@
1
+ # need custom class due to
2
+ # https://github.com/rails/rails/issues/47185
3
+ module Mailkick
4
+ class Serializer
5
+ def self.dump(value)
6
+ JSON.dump(value)
7
+ end
8
+
9
+ def self.load(value)
10
+ JSON.load(value)
11
+ rescue JSON::ParserError
12
+ Marshal.load(value)
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Mailkick
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
data/lib/mailkick.rb CHANGED
@@ -2,11 +2,13 @@
2
2
  require "active_support"
3
3
 
4
4
  # stdlib
5
+ require "json"
5
6
  require "set"
6
7
 
7
8
  # modules
8
9
  require "mailkick/legacy"
9
10
  require "mailkick/model"
11
+ require "mailkick/serializer"
10
12
  require "mailkick/service"
11
13
  require "mailkick/service/aws_ses"
12
14
  require "mailkick/service/mailchimp"
@@ -44,10 +46,8 @@ module Mailkick
44
46
  @@message_verifier = nil
45
47
  end
46
48
 
47
- # TODO use JSON serializer
48
- # can't currently rotate serializer without rotating token or digest
49
49
  def self.message_verifier
50
- @@message_verifier ||= ActiveSupport::MessageVerifier.new(Mailkick.secret_token)
50
+ @@message_verifier ||= ActiveSupport::MessageVerifier.new(Mailkick.secret_token, serializer: Serializer)
51
51
  end
52
52
 
53
53
  def self.generate_token(subscriber, list)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -45,6 +45,7 @@ files:
45
45
  - lib/mailkick/engine.rb
46
46
  - lib/mailkick/legacy.rb
47
47
  - lib/mailkick/model.rb
48
+ - lib/mailkick/serializer.rb
48
49
  - lib/mailkick/service.rb
49
50
  - lib/mailkick/service/aws_ses.rb
50
51
  - lib/mailkick/service/mailchimp.rb