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 +4 -4
- data/CHANGELOG.md +11 -1
- data/Gemfile.lock +1 -1
- data/lib/m2m_keygen/rack_validator.rb +16 -2
- data/lib/m2m_keygen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e77ffbc91cad386c8c18975760dd10daf92b7ff123ade516ac33d87efec7f198
|
|
4
|
+
data.tar.gz: 24e009d66e885a979d9d352c827ee01775c63c16cfcae11b2fe1d0b02d583281
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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
|
@@ -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
|
|
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)
|
data/lib/m2m_keygen/version.rb
CHANGED