m2m_keygen 0.5.0 → 0.5.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: b10fd7bdd2b0d18a6a4eb3884234067c9301279d9ed67d00f62d3b6741b1e54d
4
- data.tar.gz: 9458d8214b797f5b67e0f873e47989979d2820c239d7496f7ea95c92b9e958c0
3
+ metadata.gz: e77ffbc91cad386c8c18975760dd10daf92b7ff123ade516ac33d87efec7f198
4
+ data.tar.gz: 24e009d66e885a979d9d352c827ee01775c63c16cfcae11b2fe1d0b02d583281
5
5
  SHA512:
6
- metadata.gz: ce0d9d928ae0e158eb2e75696fb2cdcd57c69fdba591c318480e21d0f73252a8711753a14ccf00be623ca3e63cf50e84f7882c21197469a01f32de8a4daa38a3
7
- data.tar.gz: 55aeed0f80d63816313f8abd652e25ebec8dbd86bb5b7e8cbe3380fca5df7300a1c58c0767c3736dc4bad6aaf7466d2f47b4c77d036cd5a80e0afd4ff9af6cc7
6
+ metadata.gz: 9fa8e345b9c6f3fe60519b51814a4167cebe95e91b6e6446022b4220b0fbc0f9c807c0284579a752662978d909244d730fcafad4cfd9b116e26ac746e5d2b35f
7
+ data.tar.gz: 4470d359bda6e8b93da2f746a2ece1d35772bc0c3827f72fd5d23186dd4b4acedf2bed9a682633d5608cb555b85ce61b18bdbca40efe4a28e54e263a5bb77516
data/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.1] - 2026-07-04
11
+
12
+ ### Fixed
13
+
14
+ - `RackValidator` no longer raises when the Rack input stream is not rewindable
15
+ or is absent. Rack 3 made `rack.input#rewind` optional, and `Rack::Lint`
16
+ (rackup's development default) hides it; the body is now read once and only
17
+ rewound when the stream supports it.
18
+
10
19
  ## [0.5.0] - 2026-07-03
11
20
 
12
21
  **This release replaces the signature scheme with a new, incompatible one
@@ -148,7 +157,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
148
157
 
149
158
  - Basic skeleton for gem
150
159
 
151
- [unreleased]: https://github.com/zaratan/m2m_keygen_ruby/compare/v0.5.0...HEAD
160
+ [unreleased]: https://github.com/zaratan/m2m_keygen_ruby/compare/v0.5.1...HEAD
161
+ [0.5.1]: https://github.com/zaratan/m2m_keygen_ruby/releases/tag/v0.5.1
152
162
  [0.5.0]: https://github.com/zaratan/m2m_keygen_ruby/releases/tag/v0.5.0
153
163
  [0.4.9]: https://github.com/zaratan/m2m_keygen_ruby/releases/tag/v0.4.9
154
164
  [0.4.8]: https://github.com/zaratan/m2m_keygen_ruby/releases/tag/v0.4.8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- m2m_keygen (0.5.0)
4
+ m2m_keygen (0.5.1)
5
5
  rack (>= 2.2, < 4.0)
6
6
  sorbet-runtime (>= 0.5)
7
7
  zeitwerk (>= 2.6, < 3.0)
@@ -52,8 +52,7 @@ module M2mKeygen
52
52
  return false if nonce.bytesize > MAX_NONCE_BYTES
53
53
 
54
54
  expiry = request.env[@expiry_header].to_i
55
- body = request.body.read.to_s
56
- request.body.rewind
55
+ body = read_body(request)
57
56
 
58
57
  valid_signature =
59
58
  @signature.validate(
@@ -74,6 +73,21 @@ module M2mKeygen
74
73
 
75
74
  private
76
75
 
76
+ # Rack 3 no longer guarantees a rewindable (or even present) input stream:
77
+ # under `Rack::Lint` (rackup's development default) `#rewind` is not
78
+ # exposed, and `rack.input` itself is optional. Read what we can and only
79
+ # rewind when the stream supports it, so downstream readers still work
80
+ # where they used to.
81
+ sig { params(request: Rack::Request).returns(String) }
82
+ def read_body(request)
83
+ input = request.body
84
+ return '' if input.nil?
85
+
86
+ body = input.read.to_s
87
+ input.rewind if input.respond_to?(:rewind)
88
+ body
89
+ end
90
+
77
91
  sig { returns(T::Boolean) }
78
92
  def nonce_required?
79
93
  !@nonce_store.is_a?(NonceStore::Disabled)
@@ -3,5 +3,5 @@
3
3
 
4
4
  module M2mKeygen
5
5
  # Gem version
6
- VERSION = '0.5.0'
6
+ VERSION = '0.5.1'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: m2m_keygen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis <Zaratan> Pasin