Skip to content

Commit d1220d8

Browse files
authored
Use client connection for GET requests (#21)
Ensure the configured client options (SSL, proxy, timeouts) are honored by performing GETs via the client connection when fetching the OpenID configuration and the JWKS certificates. Previously these requests used Faraday.get, bypassing the client’s settings. Additionally, add byebug for debugging, bump RuboCop and related cops, update the RuboCop todo, and ignore .byebug_history. Close ifad/omniauth-client#20
1 parent 48e7214 commit d1220d8

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@
1212
spec/examples.txt
1313

1414
Gemfile.lock
15+
16+
.byebug_history

.rubocop_todo.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
88
gemspec
99

1010
gem 'bundler'
11+
gem 'byebug'
1112
gem 'rake'
1213
gem 'rspec'
1314
gem 'simplecov'
1415
gem 'webmock'
1516

1617
if RUBY_VERSION >= '2.7'
17-
gem 'rubocop', '1.77.0'
18+
gem 'rubocop', '1.81.7'
1819
gem 'rubocop-packaging', '0.6.0'
19-
gem 'rubocop-performance', '1.25.0'
20+
gem 'rubocop-performance', '1.26.1'
2021
gem 'rubocop-rake', '0.7.1'
21-
gem 'rubocop-rspec', '3.6.0'
22+
gem 'rubocop-rspec', '3.7.0'
2223
end

lib/omniauth/strategies/keycloak.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def setup_phase
2828
config_url = URI.join(site, "#{auth_url_base}/realms/#{realm}/.well-known/openid-configuration")
2929

3030
log :debug, "Going to get Keycloak configuration. URL: #{config_url}"
31-
response = Faraday.get config_url
31+
response = client.connection.get config_url
3232
if response.status == 200
3333
json = JSON.parse(response.body)
3434

@@ -41,7 +41,7 @@ def setup_phase
4141

4242
options.client_options.merge!({ authorize_url: @authorize_url, token_url: @token_url })
4343
log :debug, "Going to get certificates. URL: #{@certs_endpoint}"
44-
certs = Faraday.get @certs_endpoint
44+
certs = client.connection.get @certs_endpoint
4545
if certs.status == 200
4646
json = JSON.parse(certs.body)
4747
@certs = json['keys']

0 commit comments

Comments
 (0)