stripe 19.6.1 → 19.6.2

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: 2658d175c0e9668ca5effb73396f22b9f19a3df059558de5ae56912db9e9547a
4
- data.tar.gz: 29e5fb8e31fa57e3011a24117be58d99eb0f06d1385014ba135df1a936abe7db
3
+ metadata.gz: 310e2209501ef945d302084ec788e94effc1d49d7b28ae696f96c72ba8b16352
4
+ data.tar.gz: 8b6c08b64f0f314f69a276b37c251079b19b17fff9b36e362751096a3896fac3
5
5
  SHA512:
6
- metadata.gz: 2a55bcb93a02feb6f0f766bf10ef9fde2a30be1535bead833583cbb24e49e9ca791ab0910a02d957f66bb2b1bec5e701ba8e330554a0a9536036cbed79e516e7
7
- data.tar.gz: e992a203be967077d537facef9323182a643d6004197b7d563a93a98c79fb745283d6b8c23526fae44b0067f5f9f994e5e26e8ff17ac3228cd883a93393aedbf
6
+ metadata.gz: 5fa01da68c76512fb633bd82c8c36010cfd5b6d85ea38d1ba71acc6464859c5093514d9b8bb3c68b71616dfbdc238f286f436a2726d887066f173e1363b899c4
7
+ data.tar.gz: 79467cd47cd0712f1c95605a89ac2790b06c865c47d8dc438031479a1d5d72713bce5872fa9c38fc5d110b73adacb5457074fd3e92f7769858fc2d9a405dcb4e
@@ -13,7 +13,7 @@ module Stripe
13
13
 
14
14
  # Creates a new StripeContext with the given segments.
15
15
  def initialize(segments = nil)
16
- @segments = (segments || []).map(&:to_s).freeze
16
+ @segments = (segments || []).map { |segment| (segment.is_a?(String) ? segment.dup : segment.to_s).freeze }.freeze
17
17
  end
18
18
 
19
19
  # Parses a context string into a StripeContext instance.
@@ -54,6 +54,12 @@ module Stripe
54
54
  # Alias for == to support eql? method
55
55
  alias eql? ==
56
56
 
57
+ # As with equality in #== and #eql?, contexts with equivalent segments
58
+ # hash to the same value.
59
+ def hash
60
+ @segments.hash
61
+ end
62
+
57
63
  # Returns a human-readable representation for debugging.
58
64
  def inspect
59
65
  "#<#{self.class}:0x#{object_id.to_s(16)} segments=#{@segments.inspect}>"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "19.6.1"
4
+ VERSION = "19.6.2"
5
5
  end
@@ -135,6 +135,14 @@ module Stripe
135
135
  )
136
136
  end
137
137
 
138
+ if secret.nil? || secret.empty?
139
+ raise SignatureVerificationError.new(
140
+ "No webhook secret value was provided. It should start with " \
141
+ "`whsec_`",
142
+ header, http_body: payload
143
+ )
144
+ end
145
+
138
146
  expected_sig = compute_signature(timestamp, payload, secret)
139
147
  unless signatures.any? { |s| Util.secure_compare(expected_sig, s) }
140
148
  raise SignatureVerificationError.new(
@@ -16,7 +16,7 @@ module Stripe
16
16
  )
17
17
  .returns(::Stripe::V2::Core::EventNotification)
18
18
  end
19
- def parse_event_notification(payload, sig_header, secret, tolerance: Webhook::DEFAULT_TOLERANCE); end
19
+ def parse_event_notification(payload, sig_header, secret, tolerance: ::Stripe::Webhook::DEFAULT_TOLERANCE); end
20
20
 
21
21
  # Constructs a [thin event notification](https://docs.stripe.com/event-destinations#thin-payload) from
22
22
  # an incoming webhook without first verifying its authenticity. Should be used after calling
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 19.6.1
4
+ version: 19.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-01 00:00:00.000000000 Z
11
+ date: 2026-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal