foreman_openscap 8.0.0 → 8.0.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 +4 -4
- data/app/models/concerns/foreman_openscap/compliance_status_scoped_search.rb +6 -2
- data/app/models/concerns/foreman_openscap/hostgroup_extensions.rb +2 -2
- data/app/models/foreman_openscap/asset.rb +1 -1
- data/db/migrate/20240426143215_remove_orphaned_asset_policies.rb +6 -0
- data/lib/foreman_openscap/version.rb +1 -1
- data/test/unit/concerns/hostgroup_extensions_test.rb +10 -0
- data/webpack/components/OpenscapRemediationWizard/steps/ReviewHosts.js +10 -2
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bf645bb17178ebf3a7845c4955f6b100814e3fcae13f834bcaa4b94522e6d67
|
4
|
+
data.tar.gz: e5a773297d59f9d7f81c3a26085b73534424149aac6dec6a205798d98f3764e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c51175dfdebd026cf1cd0f75a77cb04b10ed2c1fbdb05c74557a5385ff390b6b6e979f5ec7433229e965fb35ab8528c7d817a368d16b3483ca8ac80f228f3341
|
7
|
+
data.tar.gz: df041f57fe9dfa77f4568579c0294f92d2c7ce16b391884cc35fce39c2c60447b0aa648ee2c9edb8bd3322dc0c6ae1bccbf9d8b6bca0296cd32a3b89f53c51b4
|
@@ -109,11 +109,15 @@ module ForemanOpenscap
|
|
109
109
|
|
110
110
|
included do
|
111
111
|
if ForemanOpenscap.with_katello?
|
112
|
-
has_one :
|
112
|
+
has_one :content_facet, :through => :host
|
113
|
+
has_many :content_view_environment_content_facets, through: :content_facet, class_name: 'Katello::ContentViewEnvironmentContentFacet'
|
114
|
+
has_many :content_view_environments, through: :content_view_environment_content_facets
|
115
|
+
has_many :content_views, through: :content_view_environments
|
116
|
+
has_many :lifecycle_environments, through: :content_view_environments
|
113
117
|
|
114
118
|
has_many :host_collections, :through => :host
|
115
119
|
|
116
|
-
scoped_search :relation => :
|
120
|
+
scoped_search :relation => :lifecycle_environments, :on => :name, :complete_value => true, :rename => :lifecycle_environment
|
117
121
|
scoped_search :relation => :host_collections, :on => :name, :complete_value => true, :rename => :host_collection,
|
118
122
|
:operators => ['= ', '!= '], :ext_method => :search_by_host_collection_name
|
119
123
|
end
|
@@ -5,8 +5,8 @@ module ForemanOpenscap
|
|
5
5
|
include InheritedPolicies
|
6
6
|
|
7
7
|
included do
|
8
|
-
|
9
|
-
has_many :asset_policies, :through => :
|
8
|
+
has_many :assets, :as => :assetable, :class_name => "::ForemanOpenscap::Asset", dependent: :destroy
|
9
|
+
has_many :asset_policies, :through => :assets, :class_name => "::ForemanOpenscap::AssetPolicy"
|
10
10
|
has_many :policies, :through => :asset_policies, :class_name => "::ForemanOpenscap::Policy"
|
11
11
|
end
|
12
12
|
|
@@ -0,0 +1,6 @@
|
|
1
|
+
class RemoveOrphanedAssetPolicies < ActiveRecord::Migration[6.0]
|
2
|
+
def up
|
3
|
+
orphaned_asset_policy_ids = ForemanOpenscap::AssetPolicy.left_outer_joins(:asset).where(asset: { id: nil }).pluck(:asset_id)
|
4
|
+
ForemanOpenscap::AssetPolicy.where(asset_id: orphaned_asset_policy_ids).delete_all
|
5
|
+
end
|
6
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'test_plugin_helper'
|
2
|
+
|
3
|
+
class HostgroupExtensionsTest < ActiveSupport::TestCase
|
4
|
+
test "should remove all linked assets on hostgroup destroy" do
|
5
|
+
hostgroup = FactoryBot.create(:hostgroup)
|
6
|
+
FactoryBot.create_list(:asset, 3, :assetable_id => hostgroup.id, :assetable_type => 'Hostgroup')
|
7
|
+
asset_scope = ::ForemanOpenscap::Asset.where(:assetable_id => hostgroup.id, :assetable_type => 'Hostgroup')
|
8
|
+
assert_difference("asset_scope.count", -3) { hostgroup.destroy }
|
9
|
+
end
|
10
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable camelcase */
|
1
2
|
import React, { useContext, useState, useEffect } from 'react';
|
2
3
|
import PropTypes from 'prop-types';
|
3
4
|
import {
|
@@ -160,11 +161,18 @@ const ReviewHosts = () => {
|
|
160
161
|
const columns = {
|
161
162
|
name: {
|
162
163
|
title: __('Name'),
|
163
|
-
wrapper: ({ id,
|
164
|
+
wrapper: ({ id, display_name: displayName }) => (
|
165
|
+
<a href={foremanUrl(`hosts/${id}`)}>{displayName}</a>
|
166
|
+
),
|
164
167
|
isSorted: true,
|
168
|
+
weight: 50,
|
169
|
+
isRequired: true,
|
165
170
|
},
|
166
|
-
|
171
|
+
os_title: {
|
167
172
|
title: __('OS'),
|
173
|
+
wrapper: hostDetails => hostDetails?.operatingsystem_name,
|
174
|
+
isSorted: true,
|
175
|
+
weight: 200,
|
168
176
|
},
|
169
177
|
};
|
170
178
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_openscap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0.
|
4
|
+
version: 8.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- slukasik@redhat.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -326,6 +326,7 @@ files:
|
|
326
326
|
- db/migrate/20210409095625_add_oval_policy_reference_to_cve.rb
|
327
327
|
- db/migrate/20210819143316_drop_unused_tables.rb
|
328
328
|
- db/migrate/20230912122310_add_fixes_to_message.rb
|
329
|
+
- db/migrate/20240426143215_remove_orphaned_asset_policies.rb
|
329
330
|
- db/seeds.d/75-job_templates.rb
|
330
331
|
- db/seeds.d/openscap_feature.rb
|
331
332
|
- db/seeds.d/openscap_policy_notification.rb
|
@@ -449,6 +450,7 @@ files:
|
|
449
450
|
- test/unit/arf_report_test.rb
|
450
451
|
- test/unit/compliance_status_test.rb
|
451
452
|
- test/unit/concerns/host_extensions_test.rb
|
453
|
+
- test/unit/concerns/hostgroup_extensions_test.rb
|
452
454
|
- test/unit/concerns/openscap_proxy_extenstions_test.rb
|
453
455
|
- test/unit/message_cleaner_test.rb
|
454
456
|
- test/unit/openscap_host_test.rb
|
@@ -635,6 +637,7 @@ test_files:
|
|
635
637
|
- test/unit/arf_report_test.rb
|
636
638
|
- test/unit/compliance_status_test.rb
|
637
639
|
- test/unit/concerns/host_extensions_test.rb
|
640
|
+
- test/unit/concerns/hostgroup_extensions_test.rb
|
638
641
|
- test/unit/concerns/openscap_proxy_extenstions_test.rb
|
639
642
|
- test/unit/message_cleaner_test.rb
|
640
643
|
- test/unit/openscap_host_test.rb
|