Commit fa2ddf483de787bbcfc57cc42a7be41c23d191de
1 parent
80b76bb0
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
oauth_client: accept proxy configuration from ENV
Showing
2 changed files
with
8 additions
and
2 deletions
Show diff stats
plugins/oauth_client/controllers/public/oauth_client_plugin_public_controller.rb
plugins/oauth_client/lib/oauth_client_plugin.rb
| ... | ... | @@ -55,7 +55,7 @@ class OauthClientPlugin < Noosfero::Plugin |
| 55 | 55 | |
| 56 | 56 | Rails.application.config.middleware.use OmniAuth::Builder do |
| 57 | 57 | PROVIDERS.each do |provider, options| |
| 58 | - provider provider, :setup => lambda { |env| | |
| 58 | + setup = lambda { |env| | |
| 59 | 59 | request = Rack::Request.new env |
| 60 | 60 | strategy = env['omniauth.strategy'] |
| 61 | 61 | |
| ... | ... | @@ -66,7 +66,12 @@ class OauthClientPlugin < Noosfero::Plugin |
| 66 | 66 | |
| 67 | 67 | strategy.options.client_id = providers[provider][:client_id] |
| 68 | 68 | strategy.options.client_secret = providers[provider][:client_secret] |
| 69 | - }, :path_prefix => '/plugin/oauth_client', :callback_path => "/plugin/oauth_client/public/callback/#{provider}" | |
| 69 | + } | |
| 70 | + | |
| 71 | + provider provider, :setup => setup, | |
| 72 | + :path_prefix => '/plugin/oauth_client', | |
| 73 | + :callback_path => "/plugin/oauth_client/public/callback/#{provider}", | |
| 74 | + :client_options => { :connection_opts => { :proxy => ENV["HTTP_PROXY"] || ENV["http_proxy"] || ENV["HTTPS_PROXY"] || ENV["https_proxy"] } } | |
| 70 | 75 | end |
| 71 | 76 | |
| 72 | 77 | unless Rails.env.production? | ... | ... |