omniauth-nitro-id 1.1.1 → 1.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: d597ab3b4ec465274903767494f7261a93cb09afb365618dd6681752ee8ba0c0
4
- data.tar.gz: dbd6d14de7b47202b908d9fc67919832ad75d58c11ef971c3437b2c4c2ac9629
3
+ metadata.gz: 845f2b6ca9b463d9002a15e3eafcae81ef9fa393a06ff5f796bb1cf41210775b
4
+ data.tar.gz: 9fcf3f89d26b6287f5eaec7974e73182d9dde71d8ace8afd5b5ef95450d28bba
5
5
  SHA512:
6
- metadata.gz: 82db598358577adbdaccc0346501e8fd00a0dd3e24e09591b9dc51eb1e8e2d9b75a575e3115604c0916ff27bc5aed46a98df08e83de9e15daa5de7cbc358e3ce
7
- data.tar.gz: 5f0a78eeb7a3660ff3688b35d6324c9a0c4f39e2724084259b5ae41038299c56794b507fc585f307ef42386a71f67eca5723d3f013053b8522f58c900b499b0a
6
+ metadata.gz: c536a888ecc063176283e54020d7fee1934663486897ca381cc797bfaf117da48fa075b0057fadd7f4a235441fe889574c04340edc870f5510784203e6f80ebe
7
+ data.tar.gz: d630c1f4d187817b25d08a95cb8e80ace98ea1ebc21c860e80c67f49244280fc042c271ad3b77a3857161863f5227e76ae280473cbe169584aff6e324c0a372b
@@ -5,9 +5,8 @@ on:
5
5
 
6
6
  jobs:
7
7
  ruby:
8
- uses: powerhome/power-tools/.github/workflows/_ruby-package.yml@main
8
+ uses: powerhome/power-tools/.github/workflows/_ruby-workflow.yml@main
9
9
  with:
10
10
  package: '${{ github.workflow }}'
11
11
  ruby: '["2.7", "3.0", "3.1"]'
12
- rails: '["any"]'
13
12
  secrets: inherit
data/.gitignore CHANGED
@@ -1,7 +1,6 @@
1
1
  /.bundle/
2
2
  /.DS_store
3
3
  /.yardoc
4
- /Gemfile.lock
5
4
  /_yardoc/
6
5
  /coverage/
7
6
  /pkg/
data/Gemfile.lock ADDED
@@ -0,0 +1,259 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-nitro-id (1.2.1)
5
+ omniauth-rails_csrf_protection (= 1.0.1)
6
+ omniauth_openid_connect (~> 0.4.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (7.0.6)
12
+ actionview (= 7.0.6)
13
+ activesupport (= 7.0.6)
14
+ rack (~> 2.0, >= 2.2.4)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
+ actionview (7.0.6)
19
+ activesupport (= 7.0.6)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
+ activemodel (7.0.6)
25
+ activesupport (= 7.0.6)
26
+ activesupport (7.0.6)
27
+ concurrent-ruby (~> 1.0, >= 1.0.2)
28
+ i18n (>= 1.6, < 2)
29
+ minitest (>= 5.1)
30
+ tzinfo (~> 2.0)
31
+ addressable (2.8.4)
32
+ public_suffix (>= 2.0.2, < 6.0)
33
+ aes_key_wrap (1.1.0)
34
+ ast (2.4.2)
35
+ attr_required (1.0.1)
36
+ bindata (2.4.15)
37
+ builder (3.2.4)
38
+ coderay (1.1.3)
39
+ concurrent-ruby (1.2.2)
40
+ crass (1.0.6)
41
+ date (3.3.3)
42
+ diff-lcs (1.5.0)
43
+ erubi (1.12.0)
44
+ faraday (2.7.10)
45
+ faraday-net_http (>= 2.0, < 3.1)
46
+ ruby2_keywords (>= 0.0.4)
47
+ faraday-follow_redirects (0.3.0)
48
+ faraday (>= 1, < 3)
49
+ faraday-net_http (3.0.2)
50
+ ffi (1.15.5)
51
+ formatador (1.1.0)
52
+ guard (2.18.0)
53
+ formatador (>= 0.2.4)
54
+ listen (>= 2.7, < 4.0)
55
+ lumberjack (>= 1.0.12, < 2.0)
56
+ nenv (~> 0.1)
57
+ notiffany (~> 0.0)
58
+ pry (>= 0.13.0)
59
+ shellany (~> 0.0)
60
+ thor (>= 0.18.1)
61
+ guard-compat (1.2.1)
62
+ guard-rspec (4.7.3)
63
+ guard (~> 2.1)
64
+ guard-compat (~> 1.1)
65
+ rspec (>= 2.99.0, < 4.0)
66
+ hashie (5.0.0)
67
+ httpclient (2.8.3)
68
+ i18n (1.14.1)
69
+ concurrent-ruby (~> 1.0)
70
+ json (2.6.3)
71
+ json-jwt (1.16.3)
72
+ activesupport (>= 4.2)
73
+ aes_key_wrap
74
+ bindata
75
+ faraday (~> 2.0)
76
+ faraday-follow_redirects
77
+ license_finder (7.1.0)
78
+ bundler
79
+ rubyzip (>= 1, < 3)
80
+ thor (~> 1.2)
81
+ tomlrb (>= 1.3, < 2.1)
82
+ with_env (= 1.1.0)
83
+ xml-simple (~> 1.1.9)
84
+ listen (3.8.0)
85
+ rb-fsevent (~> 0.10, >= 0.10.3)
86
+ rb-inotify (~> 0.9, >= 0.9.10)
87
+ loofah (2.21.3)
88
+ crass (~> 1.0.2)
89
+ nokogiri (>= 1.12.0)
90
+ lumberjack (1.2.8)
91
+ mail (2.8.1)
92
+ mini_mime (>= 0.1.1)
93
+ net-imap
94
+ net-pop
95
+ net-smtp
96
+ method_source (1.0.0)
97
+ mini_mime (1.1.2)
98
+ mini_portile2 (2.8.4)
99
+ minitest (5.18.1)
100
+ nenv (0.3.0)
101
+ net-imap (0.3.6)
102
+ date
103
+ net-protocol
104
+ net-pop (0.1.2)
105
+ net-protocol
106
+ net-protocol (0.2.1)
107
+ timeout
108
+ net-smtp (0.3.3)
109
+ net-protocol
110
+ nokogiri (1.15.3)
111
+ mini_portile2 (~> 2.8.2)
112
+ racc (~> 1.4)
113
+ notiffany (0.1.3)
114
+ nenv (~> 0.1)
115
+ shellany (~> 0.0)
116
+ omniauth (2.1.1)
117
+ hashie (>= 3.4.6)
118
+ rack (>= 2.2.3)
119
+ rack-protection
120
+ omniauth-rails_csrf_protection (1.0.1)
121
+ actionpack (>= 4.2)
122
+ omniauth (~> 2.0)
123
+ omniauth_openid_connect (0.4.0)
124
+ addressable (~> 2.5)
125
+ omniauth (>= 1.9, < 3)
126
+ openid_connect (~> 1.1)
127
+ openid_connect (1.4.2)
128
+ activemodel
129
+ attr_required (>= 1.0.0)
130
+ json-jwt (>= 1.15.0)
131
+ net-smtp
132
+ rack-oauth2 (~> 1.21)
133
+ swd (~> 1.3)
134
+ tzinfo
135
+ validate_email
136
+ validate_url
137
+ webfinger (~> 1.2)
138
+ parallel (1.23.0)
139
+ parser (3.2.2.3)
140
+ ast (~> 2.4.1)
141
+ racc
142
+ pry (0.14.2)
143
+ coderay (~> 1.1)
144
+ method_source (~> 1.0)
145
+ public_suffix (5.0.3)
146
+ racc (1.7.1)
147
+ rack (2.2.7)
148
+ rack-oauth2 (1.21.3)
149
+ activesupport
150
+ attr_required
151
+ httpclient
152
+ json-jwt (>= 1.11.0)
153
+ rack (>= 2.1.0)
154
+ rack-protection (3.0.6)
155
+ rack
156
+ rack-test (2.1.0)
157
+ rack (>= 1.3)
158
+ rails-dom-testing (2.1.1)
159
+ activesupport (>= 5.0.0)
160
+ minitest
161
+ nokogiri (>= 1.6)
162
+ rails-html-sanitizer (1.6.0)
163
+ loofah (~> 2.21)
164
+ nokogiri (~> 1.14)
165
+ rainbow (3.1.1)
166
+ rake (13.0.6)
167
+ rb-fsevent (0.11.2)
168
+ rb-inotify (0.10.1)
169
+ ffi (~> 1.0)
170
+ regexp_parser (2.8.1)
171
+ rexml (3.2.5)
172
+ rspec (3.11.0)
173
+ rspec-core (~> 3.11.0)
174
+ rspec-expectations (~> 3.11.0)
175
+ rspec-mocks (~> 3.11.0)
176
+ rspec-core (3.11.0)
177
+ rspec-support (~> 3.11.0)
178
+ rspec-expectations (3.11.1)
179
+ diff-lcs (>= 1.2.0, < 2.0)
180
+ rspec-support (~> 3.11.0)
181
+ rspec-mocks (3.11.2)
182
+ diff-lcs (>= 1.2.0, < 2.0)
183
+ rspec-support (~> 3.11.0)
184
+ rspec-support (3.11.1)
185
+ rubocop (1.31.1)
186
+ json (~> 2.3)
187
+ parallel (~> 1.10)
188
+ parser (>= 3.1.0.0)
189
+ rainbow (>= 2.2.2, < 4.0)
190
+ regexp_parser (>= 1.8, < 3.0)
191
+ rexml (>= 3.2.5, < 4.0)
192
+ rubocop-ast (>= 1.18.0, < 2.0)
193
+ ruby-progressbar (~> 1.7)
194
+ unicode-display_width (>= 1.4.0, < 3.0)
195
+ rubocop-ast (1.29.0)
196
+ parser (>= 3.2.1.0)
197
+ rubocop-performance (1.18.0)
198
+ rubocop (>= 1.7.0, < 2.0)
199
+ rubocop-ast (>= 0.4.0)
200
+ rubocop-powerhome (0.5.0)
201
+ rubocop
202
+ rubocop-performance
203
+ rubocop-rails
204
+ rubocop-rake
205
+ rubocop-rspec
206
+ rubocop-rails (2.15.2)
207
+ activesupport (>= 4.2.0)
208
+ rack (>= 1.1)
209
+ rubocop (>= 1.7.0, < 2.0)
210
+ rubocop-rake (0.6.0)
211
+ rubocop (~> 1.0)
212
+ rubocop-rspec (2.12.1)
213
+ rubocop (~> 1.31)
214
+ ruby-progressbar (1.13.0)
215
+ ruby2_keywords (0.0.5)
216
+ rubyzip (2.3.2)
217
+ shellany (0.0.1)
218
+ swd (1.3.0)
219
+ activesupport (>= 3)
220
+ attr_required (>= 0.0.5)
221
+ httpclient (>= 2.4)
222
+ thor (1.2.2)
223
+ timeout (0.4.0)
224
+ tomlrb (2.0.3)
225
+ tzinfo (2.0.6)
226
+ concurrent-ruby (~> 1.0)
227
+ unicode-display_width (2.4.2)
228
+ validate_email (0.1.6)
229
+ activemodel (>= 3.0)
230
+ mail (>= 2.2.5)
231
+ validate_url (1.0.15)
232
+ activemodel (>= 3.0.0)
233
+ public_suffix
234
+ webfinger (1.2.0)
235
+ activesupport
236
+ httpclient (>= 2.4)
237
+ with_env (1.1.0)
238
+ xml-simple (1.1.9)
239
+ rexml
240
+
241
+ PLATFORMS
242
+ arm64-darwin-22
243
+ ruby
244
+ x86_64-linux
245
+
246
+ DEPENDENCIES
247
+ bundler
248
+ guard-rspec
249
+ license_finder (>= 7.0)
250
+ net-smtp
251
+ omniauth-nitro-id!
252
+ pry
253
+ rake (= 13.0.6)
254
+ rspec (= 3.11.0)
255
+ rubocop (= 1.31.1)
256
+ rubocop-powerhome (>= 0.4.1)
257
+
258
+ BUNDLED WITH
259
+ 2.4.17
data/docs/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.1] - 2023-07-25
11
+
12
+ ### Added
13
+
14
+ * Removed Faraday and JWT dependencies. PR [#14](https://github.com/powerhome/omniauth-nitro-id/pull/4)
15
+
16
+ ## [1.2.0] - 2023-07-24
17
+
18
+ ### Added
19
+
20
+ * Add `decode_logout_token` method. PR [#13](https://github.com/powerhome/omniauth-nitro-id/pull/13)
21
+
10
22
  ## [1.1.1] - 2023-03-06
11
23
 
12
24
  ### Added
@@ -25,7 +37,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
37
 
26
38
  * Initial release
27
39
 
28
- [Unreleased]: https://github.com/powerhome/omniauth-nitro-id/compare/v1.1.1...HEAD
40
+ [Unreleased]: https://github.com/powerhome/omniauth-nitro-id/compare/v1.2.1...HEAD
41
+ [1.2.1]: https://github.com/powerhome/omniauth-nitro-id/releases/tag/v1.2.1
42
+ [1.2.0]: https://github.com/powerhome/omniauth-nitro-id/releases/tag/v1.2.0
29
43
  [1.1.1]: https://github.com/powerhome/omniauth-nitro-id/releases/tag/v1.1.1
30
44
  [1.1.0]: https://github.com/powerhome/omniauth-nitro-id/releases/tag/v1.1.0
31
45
  [1.0.0]: https://github.com/powerhome/omniauth-nitro-id/releases/tag/v1.0.0
data/docs/README.md CHANGED
@@ -31,4 +31,13 @@ config.omniauth :nitro_id, {
31
31
  }
32
32
  ```
33
33
 
34
+ Decoding NitroID's RSA256-encoded logout token
35
+ ```ruby
36
+ token = params[:logout_token]
37
+ # eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzpoeWRyYS5vcGVuaWQuaWQtdG9rZW4iLCJ0eXAiOiJK...
38
+
39
+ OmniAuth::Strategies::NitroId.decode_logout_token(token)
40
+ # [{"aud"=>["196da0d5-adc6-4454-98f2-3cabae04855c"], "events"=>{"http://schemas.openid.net/event/backchannel-logout"=>{}}, "iat"=>1688672696, "iss"=>"https://id.powerhrg.com/" ...
41
+ ```
42
+
34
43
  Check out Power's [example Rails app](https://github.com/powerhome/example-rails-app) for details on how to use this gem with Devise.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module NitroId
5
- VERSION = "1.1.1"
5
+ VERSION = "1.2.1"
6
6
  end
7
7
  end
@@ -16,6 +16,19 @@ module OmniAuth
16
16
  end
17
17
  end
18
18
 
19
+ def self.decode_logout_token(token)
20
+ jwks = fetch_jwks
21
+ JSON::JWT.decode(token, jwks)
22
+ end
23
+
24
+ def self.fetch_jwks
25
+ key = ::OpenIDConnect.http_client.get("#{default_options[:issuer]}.well-known/jwks.json").body
26
+ json = key.is_a?(String) ? JSON.parse(key) : key
27
+ return JSON::JWK::Set.new(json["keys"]) if json.key?("keys")
28
+
29
+ JSON::JWK.new(json)
30
+ end
31
+
19
32
  private
20
33
 
21
34
  def fetch_key
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-nitro-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Greer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-06 00:00:00.000000000 Z
11
+ date: 2023-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth_openid_connect
@@ -177,6 +177,7 @@ files:
177
177
  - ".rspec"
178
178
  - ".rubocop.yml"
179
179
  - Gemfile
180
+ - Gemfile.lock
180
181
  - Guardfile
181
182
  - LICENSE.txt
182
183
  - Rakefile