foreman_rh_cloud 11.3.0 → 11.4.0

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: aabe6881c75f0293ff48b2a0dc207d8a0295c492cc7e1766659ef450a8eabcb5
4
- data.tar.gz: df041730744b9ac3a63314d2e39bd431260cb10677eef2c3a71d18fe17017dac
3
+ metadata.gz: 5dded98b552dea7166e0066c2eb60dfcd9f9c5b1ac4311ded2112c791cfd07eb
4
+ data.tar.gz: ff43c40fe389fbdd371b2e5dc63034f7481cfe9802fb56b04d87f0ae4d5ad0a4
5
5
  SHA512:
6
- metadata.gz: 2bd4865e3035115965e97c4f240e8494aa3ca7e4fa64b731d8cf1b8631847b60eb8aade9619fde9068a61eb168bfb2c245837e4b4b893356c1237eba4541e343
7
- data.tar.gz: c49768ca959a42d96a1efeb8eace4faf1516e676961f492006ca023e5fed4a464b082cc91248891bce7f594ea6dc22a6fbfd2537d3cf5973d0a6b66c826b4fd0
6
+ metadata.gz: e7af166c1a563dcd8a3e8da3c05b2c884893478fe2f622ba6e03390469c56c2e53cdcbd4463d7fe9a207f66d001971655fcb45bb526216f1eb3bfb2718b64589
7
+ data.tar.gz: bfbc64a2087a4e8b349bc2758e6844350a0eab487a6fc4372e43b6c2eb923f7ea0e3200cc3e6c2312b45aa4fb8d66fcd65b668ef50e0adc27bc14131b1e6d50f
@@ -63,6 +63,12 @@ module ForemanRhCloud
63
63
 
64
64
  def path_params(request_path, certs)
65
65
  case request_path
66
+ when lightspeed?
67
+ {
68
+ url: ForemanRhCloud.cert_base_url + request_path,
69
+ ssl_client_cert: OpenSSL::X509::Certificate.new(certs[:cert]),
70
+ ssl_client_key: OpenSSL::PKey.read(certs[:key]),
71
+ }
66
72
  when platform_request?
67
73
  {
68
74
  url: ForemanRhCloud.cert_base_url + request_path.sub('/redhat_access/r/insights/platform', '/api'),
@@ -95,6 +101,10 @@ module ForemanRhCloud
95
101
  headers
96
102
  end
97
103
 
104
+ def lightspeed?
105
+ ->(request_path) { request_path.include? '/lightspeed' }
106
+ end
107
+
98
108
  def platform_request?
99
109
  ->(request_path) { request_path.include? '/platform' }
100
110
  end
data/config/routes.rb CHANGED
@@ -49,6 +49,10 @@ Rails.application.routes.draw do
49
49
  end
50
50
  end
51
51
 
52
+ scope :module => :'insights_cloud/api' do
53
+ match '/api/lightspeed/*path', to: 'machine_telemetries#forward_request', via: :all
54
+ end
55
+
52
56
  # API routes
53
57
 
54
58
  namespace :api, :defaults => { :format => 'json' } do
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '11.3.0'.freeze
2
+ VERSION = '11.4.0'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "11.3.0",
3
+ "version": "11.4.0",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,6 +3,8 @@ require 'rest-client'
3
3
 
4
4
  module InsightsCloud::Api
5
5
  class MachineTelemetriesControllerTest < ActionController::TestCase
6
+ include KatelloCVEHelper
7
+
6
8
  setup do
7
9
  FactoryBot.create(:common_parameter, name: InsightsCloud.enable_client_param, key_type: 'boolean', value: true)
8
10
  end
@@ -122,9 +124,8 @@ module InsightsCloud::Api
122
124
  setup do
123
125
  UpstreamOnlySettingsTestHelper.set_if_available('allow_multiple_content_views')
124
126
  User.current = User.find_by(login: 'secret_admin')
125
-
126
- @env = FactoryBot.create(:katello_k_t_environment)
127
- @env2 = FactoryBot.create(:katello_k_t_environment, organization: @env.organization)
127
+ env = FactoryBot.create(:katello_k_t_environment)
128
+ env2 = FactoryBot.create(:katello_k_t_environment, organization: env.organization)
128
129
 
129
130
  @host = FactoryBot.create(
130
131
  :host,
@@ -132,19 +133,8 @@ module InsightsCloud::Api
132
133
  :with_content,
133
134
  :with_hostgroup,
134
135
  :with_parameter,
135
- content_view_environments: [
136
- FactoryBot.create(
137
- :katello_content_view_environment,
138
- content_view: FactoryBot.create(:katello_content_view, organization: @env.organization),
139
- lifecycle_environment: @env
140
- ),
141
- FactoryBot.create(
142
- :katello_content_view_environment,
143
- content_view: FactoryBot.create(:katello_content_view, organization: @env.organization),
144
- lifecycle_environment: @env2
145
- ),
146
- ],
147
- organization: @env.organization
136
+ content_view_environments: [make_cve(lifecycle_environment: env), make_cve(lifecycle_environment: env2)],
137
+ organization: env.organization
148
138
  )
149
139
 
150
140
  @host.subscription_facet.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
@@ -4,6 +4,7 @@ require 'foreman_tasks/test_helpers'
4
4
  class InventoryFullSyncTest < ActiveSupport::TestCase
5
5
  include ForemanTasks::TestHelpers::WithInThreadExecutor
6
6
  include MockCerts
7
+ include KatelloCVEHelper
7
8
 
8
9
  setup do
9
10
  User.current = User.find_by(login: 'secret_admin')
@@ -11,15 +12,15 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
11
12
  InventorySync::Async::InventoryFullSync.any_instance.stubs(:plan_self_host_sync)
12
13
  Organization.any_instance.stubs(:manifest_expired?).returns(false)
13
14
 
14
- env = FactoryBot.create(:katello_k_t_environment)
15
- cv = env.content_views << FactoryBot.create(:katello_content_view, organization: env.organization)
15
+ cve = make_cve
16
+ env = cve.lifecycle_environment
16
17
 
17
18
  # this host would pass our plugin queries, so it could be uploaded to the cloud.
18
19
  @host1 = FactoryBot.create(
19
20
  :host,
20
21
  :with_subscription,
21
22
  :with_content,
22
- content_view: cv.first,
23
+ content_view: cve.content_view,
23
24
  lifecycle_environment: env,
24
25
  organization: env.organization
25
26
  )
@@ -33,7 +34,7 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
33
34
  :host,
34
35
  :with_subscription,
35
36
  :with_content,
36
- content_view: cv.first,
37
+ content_view: cve.content_view,
37
38
  lifecycle_environment: env,
38
39
  organization: env.organization
39
40
  )
@@ -46,7 +47,7 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
46
47
  :host,
47
48
  :with_subscription,
48
49
  :with_content,
49
- content_view: cv.first,
50
+ content_view: cve.content_view,
50
51
  lifecycle_environment: env,
51
52
  organization: env.organization
52
53
  )
@@ -4,19 +4,19 @@ require 'foreman_tasks/test_helpers'
4
4
  class InventoryHostsSyncTest < ActiveSupport::TestCase
5
5
  include ForemanTasks::TestHelpers::WithInThreadExecutor
6
6
  include MockCerts
7
+ include KatelloCVEHelper
7
8
 
8
9
  setup do
9
10
  User.current = User.find_by(login: 'secret_admin')
10
-
11
- env = FactoryBot.create(:katello_k_t_environment)
12
- cv = env.content_views << FactoryBot.create(:katello_content_view, organization: env.organization)
13
-
11
+ cve = make_cve
12
+ env = cve.lifecycle_environment
13
+ cv = cve.content_view
14
14
  # this host would pass our plugin queries, so it could be uploaded to the cloud.
15
15
  @host1 = FactoryBot.create(
16
16
  :host,
17
17
  :with_subscription,
18
18
  :with_content,
19
- content_view: cv.first,
19
+ content_view: cv,
20
20
  lifecycle_environment: env,
21
21
  organization: env.organization
22
22
  )
@@ -30,7 +30,7 @@ class InventoryHostsSyncTest < ActiveSupport::TestCase
30
30
  :host,
31
31
  :with_subscription,
32
32
  :with_content,
33
- content_view: cv.first,
33
+ content_view: cv,
34
34
  lifecycle_environment: env,
35
35
  organization: env.organization
36
36
  )
@@ -118,6 +118,20 @@ module CandlepinIsolation
118
118
  end
119
119
  end
120
120
 
121
+ module KatelloCVEHelper
122
+ def make_cve(lifecycle_environment: nil, content_view: nil)
123
+ env = lifecycle_environment || FactoryBot.create(:katello_k_t_environment)
124
+ content_view ||= FactoryBot.create(:katello_content_view, organization: env.organization)
125
+ cvv = ::Katello::ContentViewVersion.create!(:major => 2, :content_view => content_view)
126
+ FactoryBot.create(
127
+ :katello_content_view_environment,
128
+ content_view_version: cvv,
129
+ content_view: content_view,
130
+ lifecycle_environment: env
131
+ )
132
+ end
133
+ end
134
+
121
135
  module UpstreamOnlySettingsTestHelper
122
136
  def self.set_if_available(setting_name, value: true)
123
137
  Setting[setting_name] = value
@@ -2,18 +2,18 @@ require 'test_plugin_helper'
2
2
 
3
3
  class ArchivedReportGeneratorTest < ActiveSupport::TestCase
4
4
  include MockForemanHostname
5
+ include KatelloCVEHelper
5
6
 
6
7
  setup do
7
8
  User.current = User.find_by(login: 'secret_admin')
8
-
9
- env = FactoryBot.create(:katello_k_t_environment)
10
- cv = env.content_views << FactoryBot.create(:katello_content_view, organization: env.organization)
9
+ cve = make_cve
10
+ env = cve.lifecycle_environment
11
11
 
12
12
  @host = FactoryBot.create(
13
13
  :host,
14
14
  :with_subscription,
15
15
  :with_content,
16
- content_view: cv.first,
16
+ content_view: cve.content_view,
17
17
  lifecycle_environment: env,
18
18
  organization: env.organization
19
19
  )
@@ -1,21 +1,22 @@
1
1
  require 'test_plugin_helper'
2
2
 
3
3
  class BranchInfoTest < ActiveSupport::TestCase
4
+ include KatelloCVEHelper
5
+
4
6
  setup do
5
7
  User.current = User.find_by(login: 'secret_admin')
6
8
 
7
- @env = FactoryBot.create(:katello_k_t_environment)
8
- cv = @env.content_views << FactoryBot.create(:katello_content_view, organization: @env.organization)
9
-
9
+ cve = make_cve
10
+ env = cve.lifecycle_environment
10
11
  @host = FactoryBot.create(
11
12
  :host,
12
13
  :with_subscription,
13
14
  :with_content,
14
15
  :with_hostgroup,
15
16
  :with_parameter,
16
- content_view: cv.first,
17
- lifecycle_environment: @env,
18
- organization: @env.organization
17
+ content_view: cve.content_view,
18
+ lifecycle_environment: env,
19
+ organization: env.organization
19
20
  )
20
21
 
21
22
  @host.subscription_facet.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
@@ -3,13 +3,12 @@ require 'test_plugin_helper'
3
3
  class SliceGeneratorTest < ActiveSupport::TestCase
4
4
  include KatelloLocationFix
5
5
  include CandlepinIsolation
6
+ include KatelloCVEHelper
6
7
 
7
8
  setup do
8
9
  User.current = User.find_by(login: 'secret_admin')
9
-
10
- env = FactoryBot.create(:katello_k_t_environment)
11
- cv = env.content_views << FactoryBot.create(:katello_content_view, organization: env.organization)
12
-
10
+ cve = make_cve
11
+ env = cve.lifecycle_environment
13
12
  location = FactoryBot.create(:location)
14
13
 
15
14
  @host = FactoryBot.create(
@@ -17,7 +16,7 @@ class SliceGeneratorTest < ActiveSupport::TestCase
17
16
  :redhat,
18
17
  :with_subscription,
19
18
  :with_content,
20
- content_view: cv.first,
19
+ content_view: cve.content_view,
21
20
  lifecycle_environment: env,
22
21
  organization: env.organization,
23
22
  location: location
@@ -3,6 +3,7 @@ require 'test_plugin_helper'
3
3
  class TagsGeneratorTest < ActiveSupport::TestCase
4
4
  include KatelloLocationFix
5
5
  include CandlepinIsolation
6
+ include KatelloCVEHelper
6
7
 
7
8
  setup do
8
9
  UpstreamOnlySettingsTestHelper.set_if_available('allow_multiple_content_views')
@@ -25,18 +26,7 @@ class TagsGeneratorTest < ActiveSupport::TestCase
25
26
  organization: env.organization,
26
27
  location: @location2,
27
28
  hostgroup: @hostgroup2,
28
- content_view_environments: [
29
- FactoryBot.create(
30
- :katello_content_view_environment,
31
- content_view: FactoryBot.create(:katello_content_view, organization: env.organization),
32
- lifecycle_environment: env
33
- ),
34
- FactoryBot.create(
35
- :katello_content_view_environment,
36
- content_view: FactoryBot.create(:katello_content_view, organization: env.organization),
37
- lifecycle_environment: env2
38
- ),
39
- ]
29
+ content_view_environments: [make_cve(lifecycle_environment: env), make_cve(lifecycle_environment: env2)]
40
30
  )
41
31
 
42
32
  @host.organization.pools << FactoryBot.create(:katello_pool, account_number: '1234', cp_id: 1)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.3.0
4
+ version: 11.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-03-24 00:00:00.000000000 Z
10
+ date: 2025-04-07 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: foreman_ansible
@@ -17,6 +16,9 @@ dependencies:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
18
  version: 15.0.0
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 16.0.0
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +26,29 @@ dependencies:
24
26
  - - ">="
25
27
  - !ruby/object:Gem::Version
26
28
  version: 15.0.0
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: 16.0.0
32
+ - !ruby/object:Gem::Dependency
33
+ name: foreman_remote_execution
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: 15.0.0
39
+ - - "<"
40
+ - !ruby/object:Gem::Version
41
+ version: 16.0.0
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: 15.0.0
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: 16.0.0
27
52
  - !ruby/object:Gem::Dependency
28
53
  name: foreman-tasks
29
54
  requirement: !ruby/object:Gem::Requirement
@@ -31,6 +56,9 @@ dependencies:
31
56
  - - ">="
32
57
  - !ruby/object:Gem::Version
33
58
  version: 10.0.0
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: 11.0.0
34
62
  type: :runtime
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +66,9 @@ dependencies:
38
66
  - - ">="
39
67
  - !ruby/object:Gem::Version
40
68
  version: 10.0.0
69
+ - - "<"
70
+ - !ruby/object:Gem::Version
71
+ version: 11.0.0
41
72
  - !ruby/object:Gem::Dependency
42
73
  name: katello
43
74
  requirement: !ruby/object:Gem::Requirement
@@ -649,7 +680,6 @@ homepage: https://github.com/theforeman/foreman_rh_cloud
649
680
  licenses:
650
681
  - GPL-3.0
651
682
  metadata: {}
652
- post_install_message:
653
683
  rdoc_options: []
654
684
  require_paths:
655
685
  - lib
@@ -667,8 +697,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
667
697
  - !ruby/object:Gem::Version
668
698
  version: '0'
669
699
  requirements: []
670
- rubygems_version: 3.2.33
671
- signing_key:
700
+ rubygems_version: 3.6.2
672
701
  specification_version: 4
673
702
  summary: Summary of ForemanRhCloud.
674
703
  test_files: