omniauth-nitro-id 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 845f2b6ca9b463d9002a15e3eafcae81ef9fa393a06ff5f796bb1cf41210775b
4
- data.tar.gz: 9fcf3f89d26b6287f5eaec7974e73182d9dde71d8ace8afd5b5ef95450d28bba
3
+ metadata.gz: 12b486108d9239335a4eb1457b3a265484d795ba2ddfb9721e05fdb1f0b2158f
4
+ data.tar.gz: 798f33be066a605552fce8006ea80908a7c75e4e876af1be51df5731a378f1b1
5
5
  SHA512:
6
- metadata.gz: c536a888ecc063176283e54020d7fee1934663486897ca381cc797bfaf117da48fa075b0057fadd7f4a235441fe889574c04340edc870f5510784203e6f80ebe
7
- data.tar.gz: d630c1f4d187817b25d08a95cb8e80ace98ea1ebc21c860e80c67f49244280fc042c271ad3b77a3857161863f5227e76ae280473cbe169584aff6e324c0a372b
6
+ metadata.gz: 102501c792823e10ab52fce8163f2b87363c579b680f81561985d96f5919be1482ebba2282aa802b0e03ecbde8eabaa8ad50ee66cde3b31167101aaa47a09a06
7
+ data.tar.gz: 9eb1dd8bf0217c2259d2c35b6354b78b4819b59518055e79f32e5027b012350d37cb5506ff89b716321e666cc030442415fd77f7e945f00faf8b4b39ca6ee507
@@ -5,7 +5,7 @@ on:
5
5
 
6
6
  jobs:
7
7
  ruby:
8
- uses: powerhome/power-tools/.github/workflows/_ruby-workflow.yml@main
8
+ uses: powerhome/github-actions-workflows/.github/workflows/ruby-gem.yml@main
9
9
  with:
10
10
  package: '${{ github.workflow }}'
11
11
  ruby: '["2.7", "3.0", "3.1"]'
data/Gemfile.lock CHANGED
@@ -1,34 +1,34 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-nitro-id (1.2.1)
4
+ omniauth-nitro-id (1.3.0)
5
5
  omniauth-rails_csrf_protection (= 1.0.1)
6
6
  omniauth_openid_connect (~> 0.4.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (7.0.6)
12
- actionview (= 7.0.6)
13
- activesupport (= 7.0.6)
11
+ actionpack (7.0.7)
12
+ actionview (= 7.0.7)
13
+ activesupport (= 7.0.7)
14
14
  rack (~> 2.0, >= 2.2.4)
15
15
  rack-test (>= 0.6.3)
16
16
  rails-dom-testing (~> 2.0)
17
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (7.0.6)
19
- activesupport (= 7.0.6)
18
+ actionview (7.0.7)
19
+ activesupport (= 7.0.7)
20
20
  builder (~> 3.1)
21
21
  erubi (~> 1.4)
22
22
  rails-dom-testing (~> 2.0)
23
23
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activemodel (7.0.6)
25
- activesupport (= 7.0.6)
26
- activesupport (7.0.6)
24
+ activemodel (7.0.7)
25
+ activesupport (= 7.0.7)
26
+ activesupport (7.0.7)
27
27
  concurrent-ruby (~> 1.0, >= 1.0.2)
28
28
  i18n (>= 1.6, < 2)
29
29
  minitest (>= 5.1)
30
30
  tzinfo (~> 2.0)
31
- addressable (2.8.4)
31
+ addressable (2.8.5)
32
32
  public_suffix (>= 2.0.2, < 6.0)
33
33
  aes_key_wrap (1.1.0)
34
34
  ast (2.4.2)
@@ -87,18 +87,18 @@ GEM
87
87
  loofah (2.21.3)
88
88
  crass (~> 1.0.2)
89
89
  nokogiri (>= 1.12.0)
90
- lumberjack (1.2.8)
90
+ lumberjack (1.2.9)
91
91
  mail (2.8.1)
92
92
  mini_mime (>= 0.1.1)
93
93
  net-imap
94
94
  net-pop
95
95
  net-smtp
96
96
  method_source (1.0.0)
97
- mini_mime (1.1.2)
97
+ mini_mime (1.1.5)
98
98
  mini_portile2 (2.8.4)
99
- minitest (5.18.1)
99
+ minitest (5.19.0)
100
100
  nenv (0.3.0)
101
- net-imap (0.3.6)
101
+ net-imap (0.3.7)
102
102
  date
103
103
  net-protocol
104
104
  net-pop (0.1.2)
@@ -107,9 +107,13 @@ GEM
107
107
  timeout
108
108
  net-smtp (0.3.3)
109
109
  net-protocol
110
- nokogiri (1.15.3)
110
+ nokogiri (1.15.4)
111
111
  mini_portile2 (~> 2.8.2)
112
112
  racc (~> 1.4)
113
+ nokogiri (1.15.4-arm64-darwin)
114
+ racc (~> 1.4)
115
+ nokogiri (1.15.4-x86_64-linux)
116
+ racc (~> 1.4)
113
117
  notiffany (0.1.3)
114
118
  nenv (~> 0.1)
115
119
  shellany (~> 0.0)
@@ -144,18 +148,18 @@ GEM
144
148
  method_source (~> 1.0)
145
149
  public_suffix (5.0.3)
146
150
  racc (1.7.1)
147
- rack (2.2.7)
151
+ rack (2.2.8)
148
152
  rack-oauth2 (1.21.3)
149
153
  activesupport
150
154
  attr_required
151
155
  httpclient
152
156
  json-jwt (>= 1.11.0)
153
157
  rack (>= 2.1.0)
154
- rack-protection (3.0.6)
155
- rack
158
+ rack-protection (3.1.0)
159
+ rack (~> 2.2, >= 2.2.4)
156
160
  rack-test (2.1.0)
157
161
  rack (>= 1.3)
158
- rails-dom-testing (2.1.1)
162
+ rails-dom-testing (2.2.0)
159
163
  activesupport (>= 5.0.0)
160
164
  minitest
161
165
  nokogiri (>= 1.6)
@@ -168,7 +172,7 @@ GEM
168
172
  rb-inotify (0.10.1)
169
173
  ffi (~> 1.0)
170
174
  regexp_parser (2.8.1)
171
- rexml (3.2.5)
175
+ rexml (3.2.6)
172
176
  rspec (3.11.0)
173
177
  rspec-core (~> 3.11.0)
174
178
  rspec-expectations (~> 3.11.0)
@@ -194,7 +198,7 @@ GEM
194
198
  unicode-display_width (>= 1.4.0, < 3.0)
195
199
  rubocop-ast (1.29.0)
196
200
  parser (>= 3.2.1.0)
197
- rubocop-performance (1.18.0)
201
+ rubocop-performance (1.19.0)
198
202
  rubocop (>= 1.7.0, < 2.0)
199
203
  rubocop-ast (>= 0.4.0)
200
204
  rubocop-powerhome (0.5.0)
data/docs/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.3.0] - 2023-08-22
11
+
12
+ ### Added
13
+
14
+ * Add `introspect_token` method. PR [#22](https://github.com/powerhome/omniauth-nitro-id/pull/22)
15
+
10
16
  ## [1.2.1] - 2023-07-25
11
17
 
12
18
  ### Added
@@ -37,7 +43,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
37
43
 
38
44
  * Initial release
39
45
 
40
- [Unreleased]: https://github.com/powerhome/omniauth-nitro-id/compare/v1.2.1...HEAD
46
+ [Unreleased]: https://github.com/powerhome/omniauth-nitro-id/compare/v1.3.0...HEAD
47
+ [1.3.0]: https://github.com/powerhome/omniauth-nitro-id/releases/tag/v1.3.0
41
48
  [1.2.1]: https://github.com/powerhome/omniauth-nitro-id/releases/tag/v1.2.1
42
49
  [1.2.0]: https://github.com/powerhome/omniauth-nitro-id/releases/tag/v1.2.0
43
50
  [1.1.1]: https://github.com/powerhome/omniauth-nitro-id/releases/tag/v1.1.1
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module NitroId
5
- VERSION = "1.2.1"
5
+ VERSION = "1.3.0"
6
6
  end
7
7
  end
@@ -6,6 +6,8 @@ require_relative "../../extensions/discovery"
6
6
  module OmniAuth
7
7
  module Strategies
8
8
  class BaseStrategy < OmniAuth::Strategies::OpenIDConnect
9
+ class APIError < StandardError; end
10
+
9
11
  def public_key
10
12
  @public_key ||= if options.discovery
11
13
  config.jwks
@@ -29,6 +31,19 @@ module OmniAuth
29
31
  JSON::JWK.new(json)
30
32
  end
31
33
 
34
+ def self.introspect_token(token, api_key)
35
+ options = {
36
+ header: { Authorization: api_key },
37
+ body: { token: token },
38
+ }
39
+
40
+ response = ::OpenIDConnect.http_client.post("#{default_options[:issuer]}api/tokens/introspect", **options)
41
+
42
+ raise APIError, "#{default_options[:name]} error: #{response.status}" if response.status.to_i >= 400
43
+
44
+ JSON.parse(response.body)
45
+ end
46
+
32
47
  private
33
48
 
34
49
  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.2.1
4
+ version: 1.3.0
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-07-25 00:00:00.000000000 Z
11
+ date: 2023-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth_openid_connect