mailkube 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11e623e291d499bfa611c9eb8e4e768b8a93dbffafe84422dfc0692f0e4c719a
4
- data.tar.gz: 2f945465f2bb22cd7633aeb05901f53a48311d41c748c216264c8862720f50bc
3
+ metadata.gz: afd85d0c480e7cff16fd2df6344b221acf946f644e97e7f9d7b33f2472ac5c51
4
+ data.tar.gz: 32f66b35b8f0e9631ca737ffcc1c51b6e1b98be6746f9a1d4019c623ce24e9ff
5
5
  SHA512:
6
- metadata.gz: 4d02cc6a359397afb79581541156aa4f6774b7f187c798d63d4e3e2923024e095d40c5d7676c5024b6b319bffc28bec7ed9c89be98d668c8300ae6c5b5155ac2
7
- data.tar.gz: 4ee50cef68dfaaae7a8dacc2c76ab6b6bb02e5fbaa4f642014c6224ce45ba90d8e72558a98a1ee009b480cc6b0711b185d6a4fb58f4bcb60f48e454bc365c32e
6
+ metadata.gz: e7d1a7c1e83031bbd5fca5533ecff6635361726c401b20112e856d3b62ca62211764c3498501a36d9907a6de7a2b9d0d0304d0002a725f4f4c8c013c6e3a35d0
7
+ data.tar.gz: 9c7ecae8c33e302db1a539d4fbc88ec46bd1b3edf60cda62820e7b4d3ae8d499d67f116736bec04a6445f50692dc3b7a76d108b2e209e9faa983eac9890a1a17
@@ -11,5 +11,5 @@ module Mailkube
11
11
  # semantic-release rewrites this line **in the release runner** just before the gem is built, and
12
12
  # commits nothing back to `main` (see `.rules/RELEASE.md`). So a checkout reports `0.0.0` and an
13
13
  # installed gem reports the real version: that is intended, not a bug to fix by hardcoding one.
14
- VERSION = "1.2.0"
14
+ VERSION = "1.2.1"
15
15
  end
@@ -15,8 +15,15 @@ module Mailkube
15
15
  # The prefix the server puts before the hex digest in `X-Webhook-Sig`.
16
16
  SIGNATURE_PREFIX = "sha256="
17
17
  # Decode webhook payloads deep-frozen, so a receiver cannot mutate an event it is about to
18
- # forward or log. Passed **positionally** because that is the shape `JSON.parse` declares
19
- # (`(source, opts)`); as keywords Steep reports an unexpected keyword.
18
+ # forward or log. Splatted as **keywords** at the call site, because json 3.0 made every
19
+ # `JSON.parse` option keyword-only: a positional hash now raises `ArgumentError`, and it is
20
+ # not coming back (ruby/json#1078 is closed as "not planned" — only `JSON.dump`'s positional
21
+ # `limit` was restored, in 3.0.1).
22
+ #
23
+ # The splat is also the compatible direction, which is why there is no `json` floor in the
24
+ # gemspec and the gem stays stdlib-only: json 2.x declares `(source, opts = nil)`, and Ruby
25
+ # collects keywords into the trailing positional Hash for a method that declares none. One
26
+ # call site, both majors. Verified against json 2.21.2 and 3.0.2 on Ruby 3.4.
20
27
  PARSE_OPTIONS = { freeze: true }.freeze
21
28
 
22
29
  # Verify a webhook's signature and timestamp freshness over the raw body.
@@ -65,7 +72,7 @@ module Mailkube
65
72
  # @return [Events::Event] the parsed event; narrow it with `case` or `is_a?`.
66
73
  # @raise [Error] when the body is not a JSON object.
67
74
  def self.parse_event(payload)
68
- body = JSON.parse(payload, PARSE_OPTIONS)
75
+ body = JSON.parse(payload, **PARSE_OPTIONS)
69
76
  raise Error, "webhook payload is not a JSON object" unless body.is_a?(Hash)
70
77
 
71
78
  Events::REGISTRY.fetch(body["type"], Events::UnknownEvent).new(body)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailkube
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mail Tactic Corporation