sorcery-jwt 0.2.0 → 0.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: 06d8787815dcfcbf9652ed2a264e817bf5a0b7e9f411069ac8df1d8059826824
4
- data.tar.gz: 9d51d9a8b2b516bfa0f3953e3fb6ba14947faa4c83405a7d2d02e734dd7efec0
3
+ metadata.gz: 0bda8036589ded6b4a9870c7b0bcae86e6e7a4a2c7a33e4541aba3ed0e6b13c5
4
+ data.tar.gz: cd0e7e47c7bd2b4a3a74e035c0e78a478beaf28d9b40d2d6dba353ae68fc0e9c
5
5
  SHA512:
6
- metadata.gz: 1cf6e7c1459975031eacc72405acc288a1de4396ee6c415862b475ad0bc2ec9fa3f164d17cec139960243c7eab913ad436cf55ecf06959e200d6d59d483d4bce
7
- data.tar.gz: fe7ec5f7c97409b00d290a595315b5431fb6a1182d06e69053b5a065e1995d213732e4c730175c7a2ab7bf48068129aa05303f1ca700c33150dded768aab5538
6
+ metadata.gz: 7ae9d70d53abf1cc192b2c1d37d91e62c70b0c0f7c83ce1618ab794d85978295e1a48be02ecff17a49653649c1c3b98ec6ecec375d29c2fc639d5dd0eef5f7fd
7
+ data.tar.gz: d4ef75f3664bcf002ebf684e0ea5d78637de18856fad4996275592a23d19d189dc2bde5c82498ebc9082c8733b819ec13de530eba927d0d6ad5e841a6581f24d
@@ -7,10 +7,17 @@ on:
7
7
  jobs:
8
8
  test:
9
9
  runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby: ["3.2", "3.3", "3.4"]
14
+ sorcery: ["0.16.5", "0.17.0", "0.18.0"]
15
+ env:
16
+ BUNDLE_GEMFILE: gemfiles/sorcery_${{ matrix.sorcery }}.gemfile
10
17
  steps:
11
18
  - uses: actions/checkout@v4
12
19
  - uses: ruby/setup-ruby@v1
13
20
  with:
14
- ruby-version: "3.4"
21
+ ruby-version: ${{ matrix.ruby }}
15
22
  bundler-cache: true
16
23
  - run: bundle exec rspec
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ PLAN.md
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1 (2026-09-03)
4
+
5
+ ### Changed
6
+
7
+ - Supported sorcery range widened to `>= 0.16.5, < 0.19` (0.17 and 0.18
8
+ verified). Previously pinned `< 0.17`, which blocked installs alongside
9
+ current sorcery.
10
+ - CI now runs a matrix: Ruby 3.2–3.4 × sorcery 0.16.5 / 0.17 / 0.18.
11
+
3
12
  ## 0.2.0 (2026-09-03)
4
13
 
5
14
  ### Security
data/Gemfile.lock CHANGED
@@ -1,13 +1,42 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sorcery-jwt (0.2.0)
4
+ sorcery-jwt (0.2.1)
5
5
  jwt (>= 1.0, < 3.0)
6
- sorcery (>= 0.13, < 0.17)
6
+ sorcery (>= 0.16.5, < 0.19)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
+ actionpack (8.1.3.1)
12
+ actionview (= 8.1.3.1)
13
+ activesupport (= 8.1.3.1)
14
+ nokogiri (>= 1.8.5)
15
+ rack (>= 2.2.4)
16
+ rack-session (>= 1.0.1)
17
+ rack-test (>= 0.6.3)
18
+ rails-dom-testing (~> 2.2)
19
+ rails-html-sanitizer (~> 1.6)
20
+ useragent (~> 0.16)
21
+ actionview (8.1.3.1)
22
+ activesupport (= 8.1.3.1)
23
+ builder (~> 3.1)
24
+ erubi (~> 1.11)
25
+ rails-dom-testing (~> 2.2)
26
+ rails-html-sanitizer (~> 1.6)
27
+ activesupport (8.1.3.1)
28
+ base64
29
+ bigdecimal
30
+ concurrent-ruby (~> 1.0, >= 1.3.1)
31
+ connection_pool (>= 2.2.5)
32
+ drb
33
+ i18n (>= 1.6, < 2)
34
+ json
35
+ logger (>= 1.4.2)
36
+ minitest (>= 5.1)
37
+ securerandom (>= 0.3)
38
+ tzinfo (~> 2.0, >= 2.0.5)
39
+ uri (>= 0.13.1)
11
40
  anonymous_loader (0.1.3)
12
41
  version_gem (~> 1.1, >= 1.1.14)
13
42
  auth-sanitizer (0.2.3)
@@ -15,7 +44,14 @@ GEM
15
44
  base64 (0.3.0)
16
45
  bcrypt (3.1.22)
17
46
  bigdecimal (4.1.2)
47
+ builder (3.3.0)
48
+ concurrent-ruby (1.3.8)
49
+ connection_pool (3.0.2)
50
+ crass (1.0.7)
18
51
  diff-lcs (1.6.2)
52
+ drb (2.2.3)
53
+ erb (6.0.7)
54
+ erubi (1.13.1)
19
55
  faraday (2.14.3)
20
56
  faraday-net_http (>= 2.0, < 3.5)
21
57
  json
@@ -24,14 +60,44 @@ GEM
24
60
  net-http (~> 0.5)
25
61
  hashie (5.1.0)
26
62
  logger
63
+ i18n (1.15.2)
64
+ concurrent-ruby (~> 1.0)
65
+ io-console (0.9.2)
66
+ irb (1.18.0)
67
+ pp (>= 0.6.0)
68
+ prism (>= 1.3.0)
69
+ rdoc (>= 4.0.0)
70
+ reline (>= 0.4.2)
27
71
  json (2.21.2)
28
72
  jwt (2.10.3)
29
73
  base64
30
74
  logger (1.7.0)
75
+ loofah (2.25.2)
76
+ crass (~> 1.0.2)
77
+ nokogiri (>= 1.12.0)
78
+ minitest (6.0.6)
79
+ drb (~> 2.0)
80
+ prism (~> 1.5)
31
81
  multi_xml (0.9.1)
32
82
  bigdecimal (>= 3.1, < 5)
33
83
  net-http (0.9.1)
34
84
  uri (>= 0.11.1)
85
+ nokogiri (1.19.4-aarch64-linux-gnu)
86
+ racc (~> 1.4)
87
+ nokogiri (1.19.4-aarch64-linux-musl)
88
+ racc (~> 1.4)
89
+ nokogiri (1.19.4-arm-linux-gnu)
90
+ racc (~> 1.4)
91
+ nokogiri (1.19.4-arm-linux-musl)
92
+ racc (~> 1.4)
93
+ nokogiri (1.19.4-arm64-darwin)
94
+ racc (~> 1.4)
95
+ nokogiri (1.19.4-x86_64-darwin)
96
+ racc (~> 1.4)
97
+ nokogiri (1.19.4-x86_64-linux-gnu)
98
+ racc (~> 1.4)
99
+ nokogiri (1.19.4-x86_64-linux-musl)
100
+ racc (~> 1.4)
35
101
  oauth (1.1.8)
36
102
  anonymous_loader (~> 0.1, >= 0.1.3)
37
103
  auth-sanitizer (~> 0.2, >= 0.2.3)
@@ -53,8 +119,47 @@ GEM
53
119
  rack (>= 1.2, < 4)
54
120
  snaky_hash (~> 2.0, >= 2.0.7)
55
121
  version_gem (~> 1.1, >= 1.1.14)
122
+ pp (0.6.4)
123
+ prettyprint
124
+ prettyprint (0.2.0)
125
+ prism (1.9.0)
126
+ racc (1.8.1)
56
127
  rack (3.2.7)
128
+ rack-session (2.1.2)
129
+ base64 (>= 0.1.0)
130
+ rack (>= 3.0.0)
131
+ rack-test (2.2.0)
132
+ rack (>= 1.3)
133
+ rackup (2.3.1)
134
+ rack (>= 3)
135
+ rails-dom-testing (2.3.0)
136
+ activesupport (>= 5.0.0)
137
+ minitest
138
+ nokogiri (>= 1.6)
139
+ rails-html-sanitizer (1.7.1)
140
+ loofah (~> 2.25, >= 2.25.2)
141
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
142
+ railties (8.1.3.1)
143
+ actionpack (= 8.1.3.1)
144
+ activesupport (= 8.1.3.1)
145
+ irb (~> 1.13)
146
+ rackup (>= 1.0.0)
147
+ rake (>= 12.2)
148
+ thor (~> 1.0, >= 1.2.2)
149
+ tsort (>= 0.2)
150
+ zeitwerk (~> 2.6)
57
151
  rake (13.4.2)
152
+ rbs (4.2.0)
153
+ logger
154
+ prism (>= 1.6.0)
155
+ tsort
156
+ rdoc (8.0.0)
157
+ erb
158
+ prism (>= 1.6.0)
159
+ rbs (>= 4.0.0)
160
+ tsort
161
+ reline (0.7.0)
162
+ io-console (~> 0.5)
58
163
  rspec (3.13.2)
59
164
  rspec-core (~> 3.13.0)
60
165
  rspec-expectations (~> 3.13.0)
@@ -68,19 +173,33 @@ GEM
68
173
  diff-lcs (>= 1.2.0, < 2.0)
69
174
  rspec-support (~> 3.13.0)
70
175
  rspec-support (3.13.7)
176
+ securerandom (0.4.1)
71
177
  snaky_hash (2.0.7)
72
178
  hashie (>= 0.1.0, < 6)
73
179
  version_gem (~> 1.1, >= 1.1.14)
74
- sorcery (0.16.5)
180
+ sorcery (0.18.0)
75
181
  bcrypt (~> 3.1)
76
182
  oauth (>= 0.6)
77
183
  oauth2 (~> 2.0)
184
+ railties (>= 7.1)
185
+ thor (1.5.0)
186
+ tsort (0.2.0)
187
+ tzinfo (2.0.6)
188
+ concurrent-ruby (~> 1.0)
78
189
  uri (1.1.1)
190
+ useragent (0.16.11)
79
191
  version_gem (1.1.15)
192
+ zeitwerk (2.8.3)
80
193
 
81
194
  PLATFORMS
82
- ruby
83
- x86_64-linux
195
+ aarch64-linux-gnu
196
+ aarch64-linux-musl
197
+ arm-linux-gnu
198
+ arm-linux-musl
199
+ arm64-darwin
200
+ x86_64-darwin
201
+ x86_64-linux-gnu
202
+ x86_64-linux-musl
84
203
 
85
204
  DEPENDENCIES
86
205
  rake (~> 13.0)
@@ -1,5 +1,5 @@
1
1
  module Sorcery
2
2
  module Jwt
3
- VERSION = "0.2.0".freeze
3
+ VERSION = "0.2.1".freeze
4
4
  end
5
5
  end
data/sorcery-jwt.gemspec CHANGED
@@ -36,5 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency "rspec", "~> 3.0"
37
37
 
38
38
  spec.add_runtime_dependency "jwt", ">= 1.0", "< 3.0"
39
- spec.add_runtime_dependency "sorcery", ">= 0.13", "< 0.17"
39
+ spec.add_runtime_dependency "sorcery", ">= 0.16.5", "< 0.19"
40
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorcery-jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hayden Luckenbach
@@ -63,20 +63,20 @@ dependencies:
63
63
  requirements:
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
- version: '0.13'
66
+ version: 0.16.5
67
67
  - - "<"
68
68
  - !ruby/object:Gem::Version
69
- version: '0.17'
69
+ version: '0.19'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: '0.13'
76
+ version: 0.16.5
77
77
  - - "<"
78
78
  - !ruby/object:Gem::Version
79
- version: '0.17'
79
+ version: '0.19'
80
80
  description: Adds JWT issuance and authentication to the Sorcery authentication library,
81
81
  for API-only Rails apps.
82
82
  executables: []
@@ -86,12 +86,12 @@ files:
86
86
  - ".github/workflows/ci.yml"
87
87
  - ".gitignore"
88
88
  - ".rspec"
89
+ - ".ruby-version"
89
90
  - CHANGELOG.md
90
91
  - CODE_OF_CONDUCT.md
91
92
  - Gemfile
92
93
  - Gemfile.lock
93
94
  - LICENSE.txt
94
- - PLAN.md
95
95
  - README.md
96
96
  - Rakefile
97
97
  - bin/console
data/PLAN.md DELETED
@@ -1,94 +0,0 @@
1
- # Sorcery::Jwt — Completion plan (1.0.0, no rewrite)
2
-
3
- Goal: ship 1.0.0 = the **existing API**, bug-fixed, tested, CI'd, compatible
4
- with current sorcery. No architectural changes. Everything that would break
5
- the public API is deferred (§5).
6
-
7
- Public API frozen as-is (from `0.1.13`):
8
- `issue_token(payload)` · `decode_token(token)` · `token_valid?(token)` ·
9
- `login_from_jwt` (login source) · `login_and_issue_token(*credentials)` ·
10
- token claims `id` + `email` · config: `jwt_secret`, `jwt_algorithm`,
11
- `session_expiry`.
12
-
13
- Current version `0.1.13`. Target `1.0.0`. Est. **~3 days**.
14
-
15
- ---
16
-
17
- ## Phase 0 — Environment & packaging *(~0.5 day)*
18
-
19
- - [ ] Install Ruby 3.2+ (none on this machine).
20
- - [ ] Refresh `Gemfile.lock` on modern Bundler; drop `spec.add_development_dependency "bundler"`.
21
- - [ ] Fill gemspec: `authors`, `email`, `description`, `metadata[...]`
22
- (`homepage_uri`, `source_code_uri`, `changelog_uri`).
23
- - [ ] Dependency check: gemspec allows `sorcery (>= 0.13, < 0.17)` and
24
- `jwt (>= 1.0, < 3.0)`. Latest sorcery is **0.18.0** (Dec 2025, needs
25
- Ruby ≥ 3.2). Plan: test 0.16.5 / 0.17 / 0.18, widen the range to what
26
- CI proves. Keep `jwt < 3.0` unless 3.x is proven stable.
27
-
28
- ## Phase 1 — Bug fixes, API unchanged *(~0.5 day)*
29
-
30
- All fixes are in-place; no caller-visible changes except corrected behavior.
31
-
32
- - [ ] **Auth bypass** (`login_from_jwt`): `decoded_token.first.slice("id",
33
- "email")` can be `{}` for a validly-signed token → `find_by({})`
34
- returns the first user in the table. Fix: reject empty slice before
35
- lookup (~2 lines). This is the only security-critical item.
36
- - [ ] `token_valid?`: `.present?` is an undeclared ActiveSupport dependency.
37
- Replace with a plain truthy check; add spec proving it works without
38
- ActiveSupport loaded.
39
- - [ ] Failed JWT login sets `@current_user = false` → `nil` (sorcery
40
- convention).
41
- - [ ] Keep the `JWT::ExpiredSignature` rescue clause (redundant on jwt 2.x,
42
- correct on 1.x — harmless either way).
43
-
44
- ## Phase 2 — Test suite *(~1 day, the long pole)*
45
-
46
- - [ ] PORO test doubles, not a dummy Rails app: stub `User#find_by` /
47
- `authenticate`, fake controller with stubbed `request.headers`.
48
- Time-box **half a day**; if sorcery's Model included-hook fights a
49
- PORO, mirror sorcery's own spec helper pattern instead.
50
- - [ ] Specs (all public methods + failure modes):
51
- - issue → decode round-trip; `exp` set and enforced
52
- - wrong secret / wrong algorithm → rejected
53
- - **missing claims → no login** (bypass regression test)
54
- - valid sig, user not in DB → no login
55
- - `token_valid?` without ActiveSupport
56
- - `login_and_issue_token` bad credentials → nil, no `current_user`
57
- - missing/malformed Authorization header → no login, no exception
58
- - [ ] **Ship `0.2.0`** here: tested + security fix for the existing user base
59
- (95K downloads on 0.1.13), zero API break. Don't hold it for 1.0.
60
-
61
- ## Phase 3 — Compat verification + CI *(~0.5 day)*
62
-
63
- - [ ] Replace `.travis.yml` with GitHub Actions: `bundle exec rspec` on
64
- Ruby 3.2 / 3.3 / 3.4 × sorcery 0.16.5 / 0.17 / 0.18 (or appraisal).
65
- - [ ] Fix whatever breaks on sorcery 0.17/0.18 (candidate:
66
- `Config.login_sources` internals, `Time.now` usage).
67
- - [ ] Set final dependency ranges from what CI proves green.
68
-
69
- ## Phase 4 — Docs + release *(~0.5 day)*
70
-
71
- - [ ] README: claim contract (`id` + `email` required in payload), config
72
- reference, security notes (no built-in revocation — link
73
- waiting-for-dev revocation strategies), upstream note (sorcery v1
74
- plans an official JWT plugin).
75
- - [ ] `CHANGELOG.md` 0.1.13 → 1.0.0: framing = same API, bugs fixed, suite +
76
- CI added, current sorcery supported. No breaking changes from 0.1.13.
77
- - [ ] `bundle exec rake build`, install locally, smoke test.
78
- - [ ] Tag `v1.0.0`, `gem push` (hayfever owns the rubygems slot).
79
-
80
- ---
81
-
82
- ## 5. Explicitly deferred (API-breaking — out of scope for 1.0)
83
-
84
- From the earlier review; revisit only if upstream v1 stalls indefinitely:
85
-
86
- - `token_version` revocation (logout / password-change invalidation)
87
- - Refresh tokens with rotation + reuse detection
88
- - `sub` / `iat` / `jti` claims, `exp` leeway, email decoupling
89
- - `authenticate_from_token` encapsulation (decode contract stays as-is)
90
-
91
- Endgame note: upstream sorcery is active (commits through mid-2026, V1
92
- roadmap on main) and plans an official `sorcery-jwt` plugin for v1 — same
93
- gem name we own. After 1.0, talk to maintainers (history in
94
- sorcery-rework#9) about handover vs. parallel.