jwt_signed_request 2.6.0 → 4.0.0

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: fb9e7a555755580bb4b37387799d44d3bc4d67d7a157060fce83183827250d15
4
- data.tar.gz: b4ed152d2dfa73fc961280a6d7c09fd480565195c280f76b71e6326268ba894d
3
+ metadata.gz: 2ff089359ca0be223ce8129057dd85f41347deefc047a38a430ccbb2807900c3
4
+ data.tar.gz: 7b48dda198a6b50b11c23cd9ee729dafdc4eac46cd916a9d8537452b30f2498c
5
5
  SHA512:
6
- metadata.gz: 6d7f1c2fe8ffac7c069d11231ae797fb92967cece0ed2c441167d02ebec178edb6d9474d02a0e4ec3d9a4840d8df0888cb6b00029f99190e0b24f1fceaf2f0f2
7
- data.tar.gz: 0b38896799b5021d54266010534f5360819d95363b7f09a276e7b729df8d708bacd9c861e1ae194e3b6f2bd7894e7f32f2e1e60d486d00b07b84705d2cbc4713
6
+ metadata.gz: 3c386999814a23ef7453316d2d9082d6e1ae706989eeff1c2bab49414f4f9dc1e9eca36c0f936e6139a05adb5e99540dc5cb3eff4192348e10d80e2200e84333
7
+ data.tar.gz: c0b80b1fda09d9dcb1260f229acfeff185cdb8ada149d9729ea2950f356e6fe09126639182811438d19f35658d5c6ad9fbe49b3ae02d612d96234ed7f11d0218
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # JWT Signed Request
2
- [![travis ci build](https://api.travis-ci.org/envato/jwt_signed_request.svg)](https://travis-ci.org/envato/jwt_signed_request)
2
+
3
+ [![License MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/envato/jwt_signed_request/blob/master/LICENSE.txt)
4
+ [![Gem Version](https://img.shields.io/gem/v/jwt_signed_request.svg?maxAge=2592000)](https://rubygems.org/gems/jwt_signed_request)
5
+ [![Gem Downloads](https://img.shields.io/gem/dt/jwt_signed_request.svg?maxAge=2592000)](https://rubygems.org/gems/jwt_signed_request)
6
+ [![Test Suite](https://github.com/envato/jwt_signed_request/workflows/tests/badge.svg?branch=master)](https://github.com/envato/jwt_signed_request/actions?query=branch%3Amaster+workflow%3Atests)
3
7
 
4
8
  Request signing and verification for Internal APIs using JWT.
5
9
 
@@ -17,6 +21,14 @@ then run:
17
21
  $ bundle
18
22
  ```
19
23
 
24
+ ## Stale PRs
25
+
26
+ We use the "stale" workflow to manage our PRs.
27
+ If you have a PR open for 60 days without any activity, it will automatically be labelled `stale-pr`.
28
+ If there is no activity for 7 days after this label is applied, the PR will be automatically closed.
29
+
30
+ If you have a PR that has a sensible reason for being open for a long period of time with no activity, you can apply the `do-not-auto-close` label to avoid it being automatically closed.
31
+
20
32
  ## Generating EC Keys
21
33
 
22
34
  We should be using a public key encryption algorithm such as **ES256**. To generate your public/private key pair using **ES256** run:
@@ -269,3 +281,39 @@ For bug fixes, documentation changes, and small features:
269
281
  5. Create a new Pull Request
270
282
 
271
283
  For larger new features: Do everything as above, but first also make contact with the project maintainers to be sure your change fits with the project direction and you won't be wasting effort going in the wrong direction
284
+
285
+ ### Compatibility
286
+
287
+ Compatibility with multiple versions of the [JWT gem] is tested via the [appraisal gem].
288
+
289
+ Configured versions are defined in [Appraisals](./Appraisals), which at time of writing looked like this:
290
+
291
+ ```ruby
292
+ # Latest JWT minor versions
293
+ # Source: https://rubygems.org/gems/jwt/versions
294
+ %w[
295
+ 1.5.6
296
+ 2.0.0
297
+ 2.1.0
298
+ 2.2.1
299
+ ].each do |jwt_version|
300
+ ```
301
+
302
+ Ensure you set up your local environment by running:
303
+
304
+ ```sh
305
+ bundle exec appraisal install
306
+ ```
307
+
308
+ Run the test suite like this:
309
+
310
+ ```sh
311
+ # Test all configured versions
312
+ bundle exec appraisal rspec
313
+
314
+ # Target a specific configured version
315
+ bundle exec appraisal jwt-1.5.6 rspec
316
+ ```
317
+
318
+ [JWT gem]: https://github.com/jwt/ruby-jwt
319
+ [appraisal gem]: https://github.com/thoughtbot/appraisal
@@ -9,7 +9,8 @@ module JWTSignedRequest
9
9
  def initialize(app, bearer_schema: nil, **options)
10
10
  @bearer_schema = bearer_schema
11
11
  @options = options
12
- super(app)
12
+
13
+ initializer_args_requires_options? ? super(app, options) : super(app)
13
14
  end
14
15
 
15
16
  def call(env)
@@ -39,6 +40,10 @@ module JWTSignedRequest
39
40
  def bearer_schema?
40
41
  bearer_schema == true
41
42
  end
43
+
44
+ def initializer_args_requires_options?
45
+ Gem::Version.new(::Faraday::VERSION) >= Gem::Version.new('1.2.0')
46
+ end
42
47
  end
43
48
  end
44
49
  end
@@ -109,6 +109,9 @@ module JWTSignedRequest
109
109
  end
110
110
 
111
111
  def request_body
112
+ return '' if request.body.nil?
113
+
114
+ request.body.rewind
112
115
  string = request.body.read
113
116
  request.body.rewind
114
117
  string
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JWTSignedRequest
4
- VERSION = '2.6.0'
4
+ VERSION = '4.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jwt_signed_request
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Envato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-05 00:00:00.000000000 Z
11
+ date: 2024-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: appraisal
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,21 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rack-test
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
@@ -67,7 +81,7 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: rack-test
84
+ name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
@@ -147,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
161
  - !ruby/object:Gem::Version
148
162
  version: '0'
149
163
  requirements: []
150
- rubygems_version: 3.1.2
164
+ rubygems_version: 3.5.6
151
165
  signing_key:
152
166
  specification_version: 4
153
167
  summary: JWT request signing and verification for Internal APIs