foreman_rh_cloud 11.4.0 → 11.4.1

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: 5dded98b552dea7166e0066c2eb60dfcd9f9c5b1ac4311ded2112c791cfd07eb
4
- data.tar.gz: ff43c40fe389fbdd371b2e5dc63034f7481cfe9802fb56b04d87f0ae4d5ad0a4
3
+ metadata.gz: 9f8fc6102624f1f64c8417c8417d1ba48e5db528a0551027ba3fd2fac84cb11e
4
+ data.tar.gz: 9a8a361d435e8ad403937c50b46c6ed3f56f127342320d00258480bd9dfad194
5
5
  SHA512:
6
- metadata.gz: e7af166c1a563dcd8a3e8da3c05b2c884893478fe2f622ba6e03390469c56c2e53cdcbd4463d7fe9a207f66d001971655fcb45bb526216f1eb3bfb2718b64589
7
- data.tar.gz: bfbc64a2087a4e8b349bc2758e6844350a0eab487a6fc4372e43b6c2eb923f7ea0e3200cc3e6c2312b45aa4fb8d66fcd65b668ef50e0adc27bc14131b1e6d50f
6
+ metadata.gz: b3d88a21a8bdb3990d0b5f76b20b9b43e1cac02d1c5f8c1adcbc565fa2291d67ede4c4fd5cc794b83db7569048853bf13dc1fa0eeb7fa0556c1e77c390ebf10e
7
+ data.tar.gz: 7309c277c4478897a0cf00d5fb2a18cf9007e2231bf6c63e16ee880feed2bc664ab340e9af84d092ae4b31bd8fe1e6e3c4f282a4628a56cd463eea2b3f234b2d
@@ -8,6 +8,10 @@ module ForemanRhCloud
8
8
  proxy: ForemanRhCloud.transformed_http_proxy_string,
9
9
  }.deep_merge(params)
10
10
 
11
+ if ForemanRhCloud.with_local_advisor_engine?
12
+ final_params[:ssl_ca_file] ||= ForemanRhCloud.ca_cert
13
+ end
14
+
11
15
  response = RestClient::Request.execute(final_params)
12
16
 
13
17
  logger.debug("Response headers for request url #{final_params[:url]} are: #{response.headers}")
@@ -34,7 +34,13 @@ module ForemanRhCloud
34
34
  ),
35
35
  }
36
36
  requested_url = original_request.original_fullpath.end_with?('/') ? original_request.path + '/' : original_request.path
37
- base_params.merge(path_params(requested_url, certs))
37
+ params = path_params(requested_url, certs)
38
+
39
+ if ForemanRhCloud.with_local_advisor_engine?
40
+ params[:ssl_ca_file] = ForemanRhCloud.ca_cert
41
+ end
42
+
43
+ base_params.merge(params)
38
44
  end
39
45
 
40
46
  def prepare_forward_payload(original_request, controller_name)
@@ -13,7 +13,18 @@ module ForemanRhCloud
13
13
 
14
14
  def fetch_rules_data
15
15
  advisor_url = "#{ForemanRhCloud.on_premise_url}/r/insights/v1/static/release/content.json"
16
- JSON.parse(Net::HTTP.get(URI.parse(advisor_url)), symbolize_names: true)
16
+ uri = URI.parse(advisor_url)
17
+ http = Net::HTTP.new(uri.host, uri.port)
18
+ http.use_ssl = true
19
+
20
+ # Set CA certificate
21
+ http.ca_file = ForemanRhCloud.ca_cert
22
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
23
+
24
+ request = Net::HTTP::Get.new(uri.request_uri)
25
+
26
+ response = http.request(request)
27
+ JSON.parse(response.body, symbolize_names: true)
17
28
  end
18
29
 
19
30
  def fetch_rules_and_resolutions
@@ -212,4 +212,15 @@ module ForemanRhCloud
212
212
  def self.with_local_advisor_engine?
213
213
  SETTINGS.dig(:foreman_rh_cloud, :use_local_advisor_engine) || false
214
214
  end
215
+
216
+ def self.ca_cert
217
+ # The reference to candlepin ca_cert_file can be removed
218
+ # once the setting is dropped. Foreman 3.15 introduces
219
+ # a single CA file that bundles all CAs.
220
+ if ::SETTINGS.dig(:katello, :candlepin, :ca_cert_file)
221
+ ::SETTINGS[:katello][:candlepin][:ca_cert_file]
222
+ else
223
+ ::SETTINGS[:ssl_ca_file]
224
+ end
225
+ end
215
226
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '11.4.0'.freeze
2
+ VERSION = '11.4.1'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "11.4.0",
3
+ "version": "11.4.1",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.4.0
4
+ version: 11.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foreman_ansible
@@ -697,7 +697,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
697
697
  - !ruby/object:Gem::Version
698
698
  version: '0'
699
699
  requirements: []
700
- rubygems_version: 3.6.2
700
+ rubygems_version: 3.6.7
701
701
  specification_version: 4
702
702
  summary: Summary of ForemanRhCloud.
703
703
  test_files: