redhat_access 2.2.11 → 2.2.12

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: e94c4f74c8bf19599836bcfa836469540b00cb9680dad9c9a21aaaddb2ef4c4f
4
- data.tar.gz: ec9a734f1907e2ebe6317accdaaa5b23d218eddc60ac2730f38040bd6f204dad
3
+ metadata.gz: d712c27863c4a01278f3e99c7db3550aeb0c93864ba8ca49ff2eba9c8bd9cd4c
4
+ data.tar.gz: a1848a0e157d1a99cf58ed460044e9bb684502a8942b77cd36d0c2d3743c82cf
5
5
  SHA512:
6
- metadata.gz: 3119df6ee719a94587de96ed060c8f505fce193c9c40d67555471a8a3176a000501d96a1b725c1bac132fe3e6edd1d9c8ed6f2717982e509bc0974fa7b6e75b6
7
- data.tar.gz: 180a8b8c3b4a528f4d16d7fa3b117851ce527ed646a51491c4928947136608799e49f8dd37858158e732125e5fa53256ac320dcced2e4b5407559d6f9ab965ec
6
+ metadata.gz: 9eee1ab2ffae45b52e35644efc1bd46440e7c5c818fbf09c37191e6c8bb2273765a9558506b9ee2af8038279be13fe826e9927d26b533f6cc73fa4eb0e6fe96d
7
+ data.tar.gz: e03fbd9dc81305e21d03b43263b3633e41093c2975e3282e81f62ab51b35e30b2d94115237e5127482912430b9809677620057841cdbecf1fee994c38ee4b4c0
@@ -201,22 +201,36 @@ module RedhatAccess
201
201
  end
202
202
 
203
203
  def get_portal_http_proxy
204
- proxy = nil
205
- if SETTINGS[:katello][:cdn_proxy] && SETTINGS[:katello][:cdn_proxy][:host]
206
- proxy_config = SETTINGS[:katello][:cdn_proxy]
207
- scheme = URI.parse(proxy_config[:host]).scheme
208
- uri = URI('')
209
- # Ruby's uri parser doesn't handle encoded characters so Katello added two new schemes to handle proxy
210
- # passwords. See https://github.com/Katello/katello/blob/master/app/lib/katello/util/proxy_uri.rb
211
- uri.scheme = 'proxy' if scheme == 'http'
212
- uri.scheme = 'proxys' if scheme == 'https'
213
- uri.host = URI.parse(proxy_config[:host]).host
214
- uri.port = proxy_config[:port] if proxy_config[:port]
215
- uri.user = CGI.escape(proxy_config[:user]) if proxy_config[:user]
216
- uri.password = CGI.escape(proxy_config[:password]) if proxy_config[:password]
217
- proxy = uri.to_s
204
+ begin
205
+ @http_proxy_string ||=
206
+ begin
207
+ if Setting[:content_default_http_proxy]
208
+ HttpProxy.unscoped.find_by(name: Setting[:content_default_http_proxy])&.full_url
209
+ end
210
+ end
211
+
212
+ if @http_proxy_string.blank?
213
+ if SETTINGS[:katello][:cdn_proxy] && SETTINGS[:katello][:cdn_proxy][:host]
214
+ proxy_config = SETTINGS[:katello][:cdn_proxy]
215
+ scheme = URI.parse(proxy_config[:host]).scheme
216
+ uri = URI('')
217
+ # Ruby's uri parser doesn't handle encoded characters so Katello added two new schemes to handle proxy
218
+ # passwords. See https://github.com/Katello/katello/blob/master/app/lib/katello/util/proxy_uri.rb
219
+ uri.scheme = 'proxy' if scheme == 'http'
220
+ uri.scheme = 'proxys' if scheme == 'https'
221
+ uri.host = URI.parse(proxy_config[:host]).host
222
+ uri.port = proxy_config[:port] if proxy_config[:port]
223
+ uri.user = CGI.escape(proxy_config[:user]) if proxy_config[:user]
224
+ uri.password = CGI.escape(proxy_config[:password]) if proxy_config[:password]
225
+ @http_proxy_string = uri.to_s
226
+ end
227
+ end
228
+ Rails.logger.debug("Insights proxy url = #{@http_proxy_string}")
229
+ @http_proxy_string
230
+ rescue => error
231
+ Rails.logger.debug("Something bad happened trying to get the proxy url: #{error}")
232
+ return nil
218
233
  end
219
- proxy
220
234
  end
221
235
 
222
236
  def get_http_user_agent
@@ -1,3 +1,3 @@
1
1
  module RedhatAccess
2
- VERSION = "2.2.11"
2
+ VERSION = "2.2.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redhat_access
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.11
4
+ version: 2.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindani Phiri
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-21 00:00:00.000000000 Z
12
+ date: 2020-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redhat_access_lib