omniauth-keycloak 1.4.3 → 1.5.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: 1494d8bd1dd545a49d8448e285844233045785b1bd0db84a1883cb28d8e8b2c9
4
- data.tar.gz: ae275636ef1ba0a5cc32afab8511c62bd57e1fb253def902816182b6dff3ef50
3
+ metadata.gz: 2d8d99fcc7f0918b7fb7dd8190badbb8a0f47864171ad4f2db3a5f7576f010ac
4
+ data.tar.gz: 5ecaebf0b46ac4c953c93d53642d7dc71e074c68dc54736e3958f1f44e4489fb
5
5
  SHA512:
6
- metadata.gz: d87ac330e9f9663c09873f15a424c1f0357dfe75cf1dee07bee227248173067a7f39cc9de0d42b0f6f97c4a3bc03daee3ee7a2cc3ce4442af97d429ed1c2dc6f
7
- data.tar.gz: f37f008f98a366938113c48f76cf19e74f3406fb0a66f695b4b934706e27375c61020cd1ec0b86a08f4ffe6465b905ff1ce5a953ee8f81dcdf06cd0f76302921
6
+ metadata.gz: 24b46f0e102b524ee70ce0a751135d7ea4eec64db1406d2a67af2c45434e634d61879b0fd78a6e57bbdc1f2632495a1d09335bd61069ad59bb86a0b807895146
7
+ data.tar.gz: d7165cafe46c8cd15aba9efff3229e91287061e6d52853b4e64ae0fc23618e4bc49b5d45aae11badaff048ba0e08d5db8a8724f5f56b266fb53669ff3621a403
data/CHANGELOG.md CHANGED
@@ -1,5 +1,72 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.4.4](https://github.com/ccrockett/omniauth-keycloak/tree/v1.4.4) (2022-07-25)
4
+
5
+ [Full Changelog](https://github.com/ccrockett/omniauth-keycloak/compare/v1.4.3...v1.4.4)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Fix NoMethodError when querying for JSON Web keys [\#31](https://github.com/ccrockett/omniauth-keycloak/pull/31) ([Kazhuu](https://github.com/Kazhuu))
10
+ - expose id\_token inside extra hash of auth hash [\#26](https://github.com/ccrockett/omniauth-keycloak/pull/26) ([rah-wtag](https://github.com/rah-wtag))
11
+
12
+ ## [v1.4.3](https://github.com/ccrockett/omniauth-keycloak/tree/v1.4.3) (2022-07-24)
13
+
14
+ [Full Changelog](https://github.com/ccrockett/omniauth-keycloak/compare/v1.4.2...v1.4.3)
15
+
16
+ **Fixed bugs:**
17
+
18
+ - Error: uninitialized constant OmniAuth::Strategies::KeycloakOpenId::MultiJson after gem update [\#30](https://github.com/ccrockett/omniauth-keycloak/issues/30)
19
+
20
+ ## [v1.4.2](https://github.com/ccrockett/omniauth-keycloak/tree/v1.4.2) (2022-06-14)
21
+
22
+ [Full Changelog](https://github.com/ccrockett/omniauth-keycloak/compare/v1.4.1...v1.4.2)
23
+
24
+ **Closed issues:**
25
+
26
+ - Adjust endpoints to updated Keycloak paths [\#29](https://github.com/ccrockett/omniauth-keycloak/issues/29)
27
+ - Expose id\_token inside extra hash of auth hash [\#25](https://github.com/ccrockett/omniauth-keycloak/issues/25)
28
+
29
+ **Merged pull requests:**
30
+
31
+ - Set omniauth version to \>= 2.0 [\#28](https://github.com/ccrockett/omniauth-keycloak/pull/28) ([hobbypunk90](https://github.com/hobbypunk90))
32
+
33
+ ## [v1.4.1](https://github.com/ccrockett/omniauth-keycloak/tree/v1.4.1) (2022-05-25)
34
+
35
+ [Full Changelog](https://github.com/ccrockett/omniauth-keycloak/compare/v1.4.0...v1.4.1)
36
+
37
+ **Closed issues:**
38
+
39
+ - Get Request is now Post Request [\#23](https://github.com/ccrockett/omniauth-keycloak/issues/23)
40
+ - Is the "/auth/" part mandatory in Keycloak's configuration URL? [\#19](https://github.com/ccrockett/omniauth-keycloak/issues/19)
41
+ - Add example instructions for Keycloak configuration [\#14](https://github.com/ccrockett/omniauth-keycloak/issues/14)
42
+
43
+ **Merged pull requests:**
44
+
45
+ - Bump bindata from 2.4.9 to 2.4.10 [\#22](https://github.com/ccrockett/omniauth-keycloak/pull/22) ([dependabot[bot]](https://github.com/apps/dependabot))
46
+
47
+ ## [v1.4.0](https://github.com/ccrockett/omniauth-keycloak/tree/v1.4.0) (2021-12-18)
48
+
49
+ [Full Changelog](https://github.com/ccrockett/omniauth-keycloak/compare/v1.3.0...v1.4.0)
50
+
51
+ **Closed issues:**
52
+
53
+ - Are there any reason to specify one certificate key to decode JWT? [\#17](https://github.com/ccrockett/omniauth-keycloak/issues/17)
54
+ - No route matches \[POST\] "/auth/keycloak\_openid" [\#15](https://github.com/ccrockett/omniauth-keycloak/issues/15)
55
+
56
+ **Merged pull requests:**
57
+
58
+ - Use JSON::JWK::Set instead of JSON::JWK [\#21](https://github.com/ccrockett/omniauth-keycloak/pull/21) ([hobbypunk90](https://github.com/hobbypunk90))
59
+ - Allow pass a Proc to the setup option when you specify a strategy [\#18](https://github.com/ccrockett/omniauth-keycloak/pull/18) ([Cambero](https://github.com/Cambero))
60
+ - Add information on how to use it to readme [\#16](https://github.com/ccrockett/omniauth-keycloak/pull/16) ([frenesim](https://github.com/frenesim))
61
+
62
+ ## [v1.3.0](https://github.com/ccrockett/omniauth-keycloak/tree/v1.3.0) (2021-05-17)
63
+
64
+ [Full Changelog](https://github.com/ccrockett/omniauth-keycloak/compare/v1.2.1...v1.3.0)
65
+
66
+ **Merged pull requests:**
67
+
68
+ - Bump Omniauth dependencies to v2 [\#13](https://github.com/ccrockett/omniauth-keycloak/pull/13) ([offner](https://github.com/offner))
69
+
3
70
  ## [v1.2.1](https://github.com/ccrockett/omniauth-keycloak/tree/v1.2.1) (2020-12-19)
4
71
 
5
72
  [Full Changelog](https://github.com/ccrockett/omniauth-keycloak/compare/v1.2.0...v1.2.1)
@@ -14,6 +81,7 @@
14
81
 
15
82
  - Raise errors on setup failure and logging with OmniAuth::Strategy::log method [\#10](https://github.com/ccrockett/omniauth-keycloak/pull/10) ([alexpetrov](https://github.com/alexpetrov))
16
83
  - Bump json from 2.1.0 to 2.3.1 [\#9](https://github.com/ccrockett/omniauth-keycloak/pull/9) ([dependabot[bot]](https://github.com/apps/dependabot))
84
+ - Bump rack from 2.2.2 to 2.2.3 [\#7](https://github.com/ccrockett/omniauth-keycloak/pull/7) ([dependabot[bot]](https://github.com/apps/dependabot))
17
85
 
18
86
  ## [v1.2.0](https://github.com/ccrockett/omniauth-keycloak/tree/v1.2.0) (2020-05-28)
19
87
 
@@ -21,7 +89,6 @@
21
89
 
22
90
  **Merged pull requests:**
23
91
 
24
- - Bump rack from 2.2.2 to 2.2.3 [\#7](https://github.com/ccrockett/omniauth-keycloak/pull/7) ([dependabot[bot]](https://github.com/apps/dependabot))
25
92
  - Bump activesupport from 6.0.1 to 6.0.3.1 [\#6](https://github.com/ccrockett/omniauth-keycloak/pull/6) ([dependabot[bot]](https://github.com/apps/dependabot))
26
93
  - Update rake requirement from ~\> 10.0 to ~\> 13.0 [\#4](https://github.com/ccrockett/omniauth-keycloak/pull/4) ([dependabot[bot]](https://github.com/apps/dependabot))
27
94
  - Bump rack from 2.0.7 to 2.0.8 [\#2](https://github.com/ccrockett/omniauth-keycloak/pull/2) ([dependabot[bot]](https://github.com/apps/dependabot))
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-keycloak (1.4.2)
4
+ omniauth-keycloak (1.4.4)
5
5
  faraday
6
- json-jwt (~> 1.13.0)
6
+ json-jwt (> 1.13.0)
7
7
  omniauth (>= 2.0)
8
8
  omniauth-oauth2 (~> 1.7.1)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.0.3)
13
+ activesupport (7.0.4.2)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 1.6, < 2)
16
16
  minitest (>= 5.1)
@@ -18,44 +18,48 @@ GEM
18
18
  addressable (2.8.0)
19
19
  public_suffix (>= 2.0.2, < 5.0)
20
20
  aes_key_wrap (1.1.0)
21
- bindata (2.4.10)
22
- concurrent-ruby (1.1.10)
21
+ bindata (2.4.15)
22
+ concurrent-ruby (1.2.2)
23
23
  crack (0.4.5)
24
24
  rexml
25
25
  diff-lcs (1.4.4)
26
26
  docile (1.4.0)
27
- faraday (2.3.0)
28
- faraday-net_http (~> 2.0)
27
+ faraday (2.7.4)
28
+ faraday-net_http (>= 2.0, < 3.1)
29
29
  ruby2_keywords (>= 0.0.4)
30
- faraday-net_http (2.0.3)
30
+ faraday-follow_redirects (0.3.0)
31
+ faraday (>= 1, < 3)
32
+ faraday-net_http (3.0.2)
31
33
  hashdiff (1.0.1)
32
34
  hashie (5.0.0)
33
- i18n (1.10.0)
35
+ i18n (1.12.0)
34
36
  concurrent-ruby (~> 1.0)
35
- json-jwt (1.13.0)
37
+ json-jwt (1.16.3)
36
38
  activesupport (>= 4.2)
37
39
  aes_key_wrap
38
40
  bindata
39
- jwt (2.3.0)
40
- minitest (5.15.0)
41
- multi_json (1.15.0)
41
+ faraday (~> 2.0)
42
+ faraday-follow_redirects
43
+ jwt (2.7.0)
44
+ minitest (5.17.0)
42
45
  multi_xml (0.6.0)
43
- oauth2 (1.4.9)
46
+ oauth2 (2.0.9)
44
47
  faraday (>= 0.17.3, < 3.0)
45
48
  jwt (>= 1.0, < 3.0)
46
- multi_json (~> 1.3)
47
49
  multi_xml (~> 0.5)
48
- rack (>= 1.2, < 3)
49
- omniauth (2.0.4)
50
+ rack (>= 1.2, < 4)
51
+ snaky_hash (~> 2.0)
52
+ version_gem (~> 1.1)
53
+ omniauth (2.1.1)
50
54
  hashie (>= 3.4.6)
51
- rack (>= 1.6.2, < 3)
55
+ rack (>= 2.2.3)
52
56
  rack-protection
53
- omniauth-oauth2 (1.7.2)
54
- oauth2 (~> 1.4)
57
+ omniauth-oauth2 (1.7.3)
58
+ oauth2 (>= 1.4, < 3)
55
59
  omniauth (>= 1.9, < 3)
56
60
  public_suffix (4.0.6)
57
- rack (2.2.3)
58
- rack-protection (2.2.0)
61
+ rack (3.0.4.1)
62
+ rack-protection (3.0.5)
59
63
  rack
60
64
  rake (13.0.1)
61
65
  rexml (3.2.5)
@@ -79,8 +83,12 @@ GEM
79
83
  simplecov_json_formatter (~> 0.1)
80
84
  simplecov-html (0.12.3)
81
85
  simplecov_json_formatter (0.1.3)
82
- tzinfo (2.0.4)
86
+ snaky_hash (2.0.1)
87
+ hashie
88
+ version_gem (~> 1.1, >= 1.1.1)
89
+ tzinfo (2.0.6)
83
90
  concurrent-ruby (~> 1.0)
91
+ version_gem (1.1.1)
84
92
  webmock (3.14.0)
85
93
  addressable (>= 2.8.0)
86
94
  crack (>= 0.3.2)
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Keycloak
3
- VERSION = "1.4.3"
3
+ VERSION = "1.5.0"
4
4
  end
5
5
  end
@@ -18,7 +18,8 @@ module OmniAuth
18
18
  def setup_phase
19
19
  super
20
20
 
21
- if @authorize_url.nil? || @token_url.nil?
21
+ if (@authorize_url.nil? || @token_url.nil?) && !OmniAuth.config.test_mode
22
+
22
23
  prevent_site_option_mistake
23
24
 
24
25
  realm = options.client_options[:realm].nil? ? options.client_id : options.client_options[:realm]
@@ -47,11 +48,11 @@ module OmniAuth
47
48
  log :debug, "Going to get certificates. URL: #{@certs_endpoint}"
48
49
  certs = Faraday.get @certs_endpoint
49
50
  if (certs.status == 200)
50
- json = JSON.parse(response.body)
51
+ json = JSON.parse(certs.body)
51
52
  @certs = json["keys"]
52
53
  log :debug, "Successfully got certificate. Certificate length: #{@certs.length}"
53
54
  else
54
- message = "Coundn't get certificate. URL: #{@certs_endpoint}"
55
+ message = "Couldn't get certificate. URL: #{@certs_endpoint}"
55
56
  log :error, message
56
57
  raise IntegrationError, message if raise_on_failure
57
58
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_dependency "omniauth", ">= 2.0"
27
27
  spec.add_dependency "omniauth-oauth2", "~> 1.7.1"
28
- spec.add_dependency "json-jwt", "~> 1.13.0"
28
+ spec.add_dependency "json-jwt", "> 1.13.0"
29
29
  spec.add_dependency "faraday"
30
30
 
31
31
  spec.add_development_dependency "bundler", "~> 2.2"
@@ -51,6 +51,30 @@ RSpec.describe OmniAuth::Strategies::KeycloakOpenId do
51
51
  end
52
52
  end
53
53
 
54
+ describe "test mode" do
55
+ let(:config_url) { "http://localhost:8080/realms/example-realm/.well-known/openid-configuration" }
56
+
57
+ subject do
58
+ stub_request(:get, config_url)
59
+ OmniAuth::Strategies::KeycloakOpenId.new('keycloak-openid', 'Example-Client', 'b53c572b-9f3b-4e79-bf8b-f03c799ba6ec',
60
+ client_options: {site: 'http://localhost:8080/', realm: 'example-realm', base_url: ''})
61
+ end
62
+
63
+ before do
64
+ OmniAuth.config.test_mode = true
65
+ end
66
+
67
+ after do
68
+ OmniAuth.config.test_mode = false
69
+ end
70
+
71
+ it 'should not fetch configuration when in test mode' do
72
+ subject.setup_phase
73
+ expect(a_request(:get, config_url)).not_to have_been_made
74
+ OmniAuth.config.test_mode = false
75
+ end
76
+ end
77
+
54
78
  describe 'client base_url option set' do
55
79
  context 'to blank string' do
56
80
  let(:new_body_endpoints) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-keycloak
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Crockett
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-24 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: json-jwt
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.13.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.13.0
55
55
  - !ruby/object:Gem::Dependency
@@ -166,7 +166,7 @@ homepage: https://github.com/ccrockett/omniauth-keycloak
166
166
  licenses:
167
167
  - MIT
168
168
  metadata: {}
169
- post_install_message:
169
+ post_install_message:
170
170
  rdoc_options: []
171
171
  require_paths:
172
172
  - lib
@@ -181,8 +181,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  - !ruby/object:Gem::Version
182
182
  version: 3.1.2
183
183
  requirements: []
184
- rubygems_version: 3.1.2
185
- signing_key:
184
+ rubygems_version: 3.3.7
185
+ signing_key:
186
186
  specification_version: 4
187
187
  summary: Omniauth strategy for Keycloak
188
188
  test_files: []