foreman_openscap 5.1.0 → 5.1.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/graphql/mutations/oval_policies/create.rb +33 -0
- data/app/helpers/policies_helper.rb +1 -1
- data/app/models/concerns/foreman_openscap/oval_facet_hostgroup_extensions.rb +1 -0
- data/app/models/concerns/foreman_openscap/policy_common.rb +1 -1
- data/app/services/foreman_openscap/oval/configure.rb +16 -13
- data/app/services/foreman_openscap/oval/setup_check.rb +1 -1
- data/lib/foreman_openscap/engine.rb +1 -0
- data/lib/foreman_openscap/version.rb +1 -1
- data/webpack/components/EditableInput.js +16 -10
- data/webpack/components/IndexTable/index.js +7 -2
- data/webpack/components/LinkButton.js +14 -2
- data/webpack/components/withLoading.js +3 -1
- data/webpack/graphql/mutations/createOvalPolicy.gql +22 -0
- data/webpack/graphql/queries/ovalPolicy.gql +3 -0
- data/webpack/helpers/formFieldsHelper.js +51 -1
- data/webpack/helpers/globalIdHelper.js +4 -2
- data/webpack/helpers/pathsHelper.js +5 -3
- data/webpack/helpers/toastsHelper.js +3 -0
- data/webpack/routes/OvalContents/OvalContentsIndex/__tests__/OvalContentsIndex.fixtures.js +6 -1
- data/webpack/routes/OvalPolicies/OvalPoliciesIndex/OvalPoliciesTable.js +18 -1
- data/webpack/routes/OvalPolicies/OvalPoliciesNew/HostgroupSelect.js +135 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesNew/NewOvalPolicyForm.js +119 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesNew/NewOvalPolicyFormHelpers.js +107 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesNew/OvalPoliciesNew.js +32 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesNew/__tests__/OvalPoliciesNew.fixtures.js +147 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesNew/__tests__/OvalPoliciesNew.test.js +172 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesNew/index.js +11 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/CvesTable.js +2 -2
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/DetailsTab.js +2 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/OvalPoliciesShowHelper.js +4 -3
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/__tests__/OvalPoliciesEdit.test.js +27 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/__tests__/OvalPoliciesShow.fixtures.js +11 -1
- data/webpack/routes/routes.js +7 -0
- data/webpack/testHelper.js +22 -0
- metadata +39 -42
- data/locale/de/foreman_openscap.edit.po +0 -0
- data/locale/en_GB/foreman_openscap.edit.po +0 -0
- data/locale/es/foreman_openscap.edit.po +0 -0
- data/locale/fr/foreman_openscap.edit.po +0 -0
- data/locale/gl/foreman_openscap.edit.po +0 -0
- data/locale/it/foreman_openscap.edit.po +0 -0
- data/locale/ja/foreman_openscap.edit.po +0 -0
- data/locale/ko/foreman_openscap.edit.po +0 -0
- data/locale/pt_BR/foreman_openscap.edit.po +0 -0
- data/locale/ru/foreman_openscap.edit.po +0 -0
- data/locale/sv_SE/foreman_openscap.edit.po +0 -0
- data/locale/zh_CN/foreman_openscap.edit.po +0 -0
- data/locale/zh_TW/foreman_openscap.edit.po +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import { mockFactory, admin, intruder } from '../../../../testHelper';
|
1
|
+
import { mockFactory, admin, intruder, viewer } from '../../../../testHelper';
|
2
2
|
import ovalPolicyQuery from '../../../../graphql/queries/ovalPolicy.gql';
|
3
3
|
import cvesQuery from '../../../../graphql/queries/cves.gql';
|
4
4
|
import hostgroupsQuery from '../../../../graphql/queries/hostgroups.gql';
|
@@ -16,6 +16,9 @@ export const ovalPolicy = {
|
|
16
16
|
weekday: 'tuesday',
|
17
17
|
dayOfMonth: null,
|
18
18
|
description: 'A very strict policy',
|
19
|
+
meta: {
|
20
|
+
canEdit: true,
|
21
|
+
},
|
19
22
|
hostgroups: {
|
20
23
|
nodes: [
|
21
24
|
{
|
@@ -33,6 +36,8 @@ export const ovalPolicy = {
|
|
33
36
|
},
|
34
37
|
};
|
35
38
|
|
39
|
+
const noEditPolicy = { ...ovalPolicy, meta: { canEdit: false } };
|
40
|
+
|
36
41
|
const cvesResult = {
|
37
42
|
totalCount: 1,
|
38
43
|
nodes: [
|
@@ -112,3 +117,8 @@ export const policyHostgroupsDeniedMock = hostgroupsMockFactory(
|
|
112
117
|
{ totalCount: 0, nodes: [] },
|
113
118
|
{ currentUser: intruder }
|
114
119
|
);
|
120
|
+
export const policyEditPermissionsMock = policyDetailMockFactory(
|
121
|
+
{ id: ovalPolicy.id },
|
122
|
+
noEditPolicy,
|
123
|
+
{ currentUser: viewer }
|
124
|
+
);
|
data/webpack/routes/routes.js
CHANGED
@@ -3,6 +3,7 @@ import OvalContentsIndex from './OvalContents/OvalContentsIndex';
|
|
3
3
|
import OvalContentsShow from './OvalContents/OvalContentsShow';
|
4
4
|
import OvalContentsNew from './OvalContents/OvalContentsNew';
|
5
5
|
import OvalPoliciesIndex from './OvalPolicies/OvalPoliciesIndex';
|
6
|
+
import OvalPoliciesNew from './OvalPolicies/OvalPoliciesNew';
|
6
7
|
import OvalPoliciesShow from './OvalPolicies/OvalPoliciesShow';
|
7
8
|
|
8
9
|
import {
|
@@ -11,6 +12,7 @@ import {
|
|
11
12
|
ovalContentsNewPath,
|
12
13
|
ovalPoliciesPath,
|
13
14
|
ovalPoliciesShowPath,
|
15
|
+
ovalPoliciesNewPath,
|
14
16
|
} from '../helpers/pathsHelper';
|
15
17
|
|
16
18
|
export default [
|
@@ -34,6 +36,11 @@ export default [
|
|
34
36
|
render: props => <OvalPoliciesIndex {...props} />,
|
35
37
|
exact: true,
|
36
38
|
},
|
39
|
+
{
|
40
|
+
path: ovalPoliciesNewPath,
|
41
|
+
render: props => <OvalPoliciesNew {...props} />,
|
42
|
+
exact: true,
|
43
|
+
},
|
37
44
|
{
|
38
45
|
path: ovalPoliciesShowPath,
|
39
46
|
render: props => <OvalPoliciesShow {...props} />,
|
data/webpack/testHelper.js
CHANGED
@@ -4,6 +4,7 @@ import store from 'foremanReact/redux';
|
|
4
4
|
import { MockedProvider } from '@apollo/react-testing';
|
5
5
|
import { MemoryRouter } from 'react-router-dom';
|
6
6
|
import { getForemanContext } from 'foremanReact/Root/Context/ForemanContext';
|
7
|
+
import { waitFor } from '@testing-library/react';
|
7
8
|
|
8
9
|
export const withRedux = Component => props => (
|
9
10
|
<Provider store={store}>
|
@@ -42,6 +43,14 @@ export const withMockedProvider = Component => props => {
|
|
42
43
|
// use to resolve async mock requests for apollo MockedProvider
|
43
44
|
export const tick = () => new Promise(resolve => setTimeout(resolve, 0));
|
44
45
|
|
46
|
+
export const wait = async (tickCount = 1) => {
|
47
|
+
for (let i = 1; i < tickCount; i++) {
|
48
|
+
// eslint-disable-next-line no-await-in-loop
|
49
|
+
await waitFor(tick);
|
50
|
+
}
|
51
|
+
return waitFor(tick);
|
52
|
+
};
|
53
|
+
|
45
54
|
export const historyMock = {
|
46
55
|
location: {
|
47
56
|
search: '',
|
@@ -76,6 +85,19 @@ export const intruder = userFactory('intruder', [
|
|
76
85
|
},
|
77
86
|
]);
|
78
87
|
|
88
|
+
export const viewer = userFactory('viewer', [
|
89
|
+
{
|
90
|
+
__typename: 'Permission',
|
91
|
+
id: 'MDE6UGVybWlzc2lvbi0yOTY=',
|
92
|
+
name: 'view_oval_contents',
|
93
|
+
},
|
94
|
+
{
|
95
|
+
__typename: 'Permission',
|
96
|
+
id: 'MDE6UGVybWlzc2lvbi0yNzU=',
|
97
|
+
name: 'view_oval_policies',
|
98
|
+
},
|
99
|
+
]);
|
100
|
+
|
79
101
|
export const mockFactory = (resultName, query) => (
|
80
102
|
variables,
|
81
103
|
modelResults,
|
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: 5.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- slukasik@redhat.com
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- app/controllers/scap_contents_controller.rb
|
74
74
|
- app/controllers/tailoring_files_controller.rb
|
75
75
|
- app/graphql/mutations/oval_contents/delete.rb
|
76
|
+
- app/graphql/mutations/oval_policies/create.rb
|
76
77
|
- app/graphql/mutations/oval_policies/delete.rb
|
77
78
|
- app/graphql/mutations/oval_policies/update.rb
|
78
79
|
- app/graphql/types/cve.rb
|
@@ -320,45 +321,32 @@ files:
|
|
320
321
|
- locale/Makefile
|
321
322
|
- locale/action_names.rb
|
322
323
|
- locale/de/LC_MESSAGES/foreman_openscap.mo
|
323
|
-
- locale/de/foreman_openscap.edit.po
|
324
324
|
- locale/de/foreman_openscap.po
|
325
325
|
- locale/en_GB/LC_MESSAGES/foreman_openscap.mo
|
326
|
-
- locale/en_GB/foreman_openscap.edit.po
|
327
326
|
- locale/en_GB/foreman_openscap.po
|
328
327
|
- locale/es/LC_MESSAGES/foreman_openscap.mo
|
329
|
-
- locale/es/foreman_openscap.edit.po
|
330
328
|
- locale/es/foreman_openscap.po
|
331
329
|
- locale/foreman_openscap.pot
|
332
330
|
- locale/fr/LC_MESSAGES/foreman_openscap.mo
|
333
|
-
- locale/fr/foreman_openscap.edit.po
|
334
331
|
- locale/fr/foreman_openscap.po
|
335
332
|
- locale/gl/LC_MESSAGES/foreman_openscap.mo
|
336
|
-
- locale/gl/foreman_openscap.edit.po
|
337
333
|
- locale/gl/foreman_openscap.po
|
338
334
|
- locale/it/LC_MESSAGES/foreman_openscap.mo
|
339
|
-
- locale/it/foreman_openscap.edit.po
|
340
335
|
- locale/it/foreman_openscap.po
|
341
336
|
- locale/ja/LC_MESSAGES/foreman_openscap.mo
|
342
|
-
- locale/ja/foreman_openscap.edit.po
|
343
337
|
- locale/ja/foreman_openscap.po
|
344
338
|
- locale/ko/LC_MESSAGES/foreman_openscap.mo
|
345
|
-
- locale/ko/foreman_openscap.edit.po
|
346
339
|
- locale/ko/foreman_openscap.po
|
347
340
|
- locale/pt_BR/LC_MESSAGES/foreman_openscap.mo
|
348
|
-
- locale/pt_BR/foreman_openscap.edit.po
|
349
341
|
- locale/pt_BR/foreman_openscap.po
|
350
342
|
- locale/ru/LC_MESSAGES/foreman_openscap.mo
|
351
|
-
- locale/ru/foreman_openscap.edit.po
|
352
343
|
- locale/ru/foreman_openscap.po
|
353
344
|
- locale/sv_SE/LC_MESSAGES/foreman_openscap.mo
|
354
|
-
- locale/sv_SE/foreman_openscap.edit.po
|
355
345
|
- locale/sv_SE/foreman_openscap.po
|
356
346
|
- locale/zanata.xml
|
357
347
|
- locale/zh_CN/LC_MESSAGES/foreman_openscap.mo
|
358
|
-
- locale/zh_CN/foreman_openscap.edit.po
|
359
348
|
- locale/zh_CN/foreman_openscap.po
|
360
349
|
- locale/zh_TW/LC_MESSAGES/foreman_openscap.mo
|
361
|
-
- locale/zh_TW/foreman_openscap.edit.po
|
362
350
|
- locale/zh_TW/foreman_openscap.po
|
363
351
|
- package.json
|
364
352
|
- test/factories/arf_report_factory.rb
|
@@ -444,6 +432,7 @@ files:
|
|
444
432
|
- webpack/components/withDeleteModal.js
|
445
433
|
- webpack/components/withLoading.js
|
446
434
|
- webpack/global_index.js
|
435
|
+
- webpack/graphql/mutations/createOvalPolicy.gql
|
447
436
|
- webpack/graphql/mutations/deleteOvalContent.gql
|
448
437
|
- webpack/graphql/mutations/deleteOvalPolicy.gql
|
449
438
|
- webpack/graphql/mutations/updateOvalPolicy.gql
|
@@ -463,6 +452,7 @@ files:
|
|
463
452
|
- webpack/helpers/permissionsHelper.js
|
464
453
|
- webpack/helpers/tableHelper.js
|
465
454
|
- webpack/helpers/toastHelper.js
|
455
|
+
- webpack/helpers/toastsHelper.js
|
466
456
|
- webpack/index.js
|
467
457
|
- webpack/routes/OvalContents/OvalContentsIndex/OvalContentsIndex.js
|
468
458
|
- webpack/routes/OvalContents/OvalContentsIndex/OvalContentsTable.js
|
@@ -487,6 +477,13 @@ files:
|
|
487
477
|
- webpack/routes/OvalPolicies/OvalPoliciesIndex/__tests__/OvalPoliciesIndex.fixtures.js
|
488
478
|
- webpack/routes/OvalPolicies/OvalPoliciesIndex/__tests__/OvalPoliciesIndex.test.js
|
489
479
|
- webpack/routes/OvalPolicies/OvalPoliciesIndex/index.js
|
480
|
+
- webpack/routes/OvalPolicies/OvalPoliciesNew/HostgroupSelect.js
|
481
|
+
- webpack/routes/OvalPolicies/OvalPoliciesNew/NewOvalPolicyForm.js
|
482
|
+
- webpack/routes/OvalPolicies/OvalPoliciesNew/NewOvalPolicyFormHelpers.js
|
483
|
+
- webpack/routes/OvalPolicies/OvalPoliciesNew/OvalPoliciesNew.js
|
484
|
+
- webpack/routes/OvalPolicies/OvalPoliciesNew/__tests__/OvalPoliciesNew.fixtures.js
|
485
|
+
- webpack/routes/OvalPolicies/OvalPoliciesNew/__tests__/OvalPoliciesNew.test.js
|
486
|
+
- webpack/routes/OvalPolicies/OvalPoliciesNew/index.js
|
490
487
|
- webpack/routes/OvalPolicies/OvalPoliciesShow/CvesTab.js
|
491
488
|
- webpack/routes/OvalPolicies/OvalPoliciesShow/CvesTable.js
|
492
489
|
- webpack/routes/OvalPolicies/OvalPoliciesShow/DetailsTab.js
|
@@ -505,7 +502,7 @@ homepage: https://github.com/theforeman/foreman_openscap
|
|
505
502
|
licenses:
|
506
503
|
- GPL-3.0
|
507
504
|
metadata: {}
|
508
|
-
post_install_message:
|
505
|
+
post_install_message:
|
509
506
|
rdoc_options: []
|
510
507
|
require_paths:
|
511
508
|
- lib
|
@@ -520,41 +517,46 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
520
517
|
- !ruby/object:Gem::Version
|
521
518
|
version: '0'
|
522
519
|
requirements: []
|
523
|
-
rubygems_version: 3.1.
|
524
|
-
signing_key:
|
520
|
+
rubygems_version: 3.1.6
|
521
|
+
signing_key:
|
525
522
|
specification_version: 4
|
526
523
|
summary: Foreman plug-in for displaying OpenSCAP audit reports
|
527
524
|
test_files:
|
528
525
|
- test/factories/arf_report_factory.rb
|
529
526
|
- test/factories/asset_factory.rb
|
530
|
-
- test/factories/policy_arf_report_factory.rb
|
531
|
-
- test/factories/policy_factory.rb
|
532
|
-
- test/factories/scap_content_related.rb
|
533
|
-
- test/factories/compliance_log_factory.rb
|
534
527
|
- test/factories/compliance_host_factory.rb
|
528
|
+
- test/factories/compliance_log_factory.rb
|
535
529
|
- test/factories/oval_content_factory.rb
|
536
530
|
- test/factories/oval_policy_factory.rb
|
531
|
+
- test/factories/policy_arf_report_factory.rb
|
532
|
+
- test/factories/policy_factory.rb
|
533
|
+
- test/factories/scap_content_related.rb
|
537
534
|
- test/files/arf_report/arf_report.bz2
|
538
535
|
- test/files/arf_report/arf_report.html
|
539
536
|
- test/files/arf_report/arf_report.json
|
540
537
|
- test/files/arf_report/arf_report_msg_desc_changed.json
|
541
538
|
- test/files/arf_report/arf_report_msg_value_changed.json
|
539
|
+
- test/files/oval_contents/ansible-2.9.oval.xml.bz2
|
542
540
|
- test/files/scap_contents/ssg-fedora-ds.xml
|
543
541
|
- test/files/tailoring_files/ssg-firefox-ds-tailoring-2.xml
|
544
542
|
- test/files/tailoring_files/ssg-firefox-ds-tailoring.xml
|
545
|
-
- test/
|
546
|
-
- test/functional/api/v2/compliance/scap_content_profiles_controller_test.rb
|
547
|
-
- test/functional/api/v2/compliance/scap_contents_controller_test.rb
|
548
|
-
- test/functional/api/v2/compliance/tailoring_files_controller_test.rb
|
543
|
+
- test/fixtures/cve_fixtures.rb
|
549
544
|
- test/functional/api/v2/compliance/arf_reports_controller_test.rb
|
550
545
|
- test/functional/api/v2/compliance/oval_contents_controller_test.rb
|
551
546
|
- test/functional/api/v2/compliance/oval_policies_controller_test.rb
|
552
547
|
- test/functional/api/v2/compliance/oval_reports_controller_test.rb
|
553
548
|
- test/functional/api/v2/compliance/policies_controller_test.rb
|
549
|
+
- test/functional/api/v2/compliance/scap_content_profiles_controller_test.rb
|
550
|
+
- test/functional/api/v2/compliance/scap_contents_controller_test.rb
|
551
|
+
- test/functional/api/v2/compliance/tailoring_files_controller_test.rb
|
554
552
|
- test/functional/api/v2/hosts_controller_test.rb
|
555
553
|
- test/functional/arf_reports_controller_test.rb
|
556
554
|
- test/functional/openscap_proxies_controller_test.rb
|
557
555
|
- test/functional/tailoring_files_controller_test.rb
|
556
|
+
- test/graphql/mutations/oval_policies/delete_mutation_test.rb
|
557
|
+
- test/graphql/queries/oval_content_query_test.rb
|
558
|
+
- test/graphql/queries/oval_contents_query_test.rb
|
559
|
+
- test/graphql/queries/oval_policies_query_test.rb
|
558
560
|
- test/helpers/arf_report_dashboard_helper_test.rb
|
559
561
|
- test/helpers/policy_dashboard_helper_test.rb
|
560
562
|
- test/lib/foreman_openscap/bulk_upload_test.rb
|
@@ -565,24 +567,19 @@ test_files:
|
|
565
567
|
- test/unit/concerns/openscap_proxy_extenstions_test.rb
|
566
568
|
- test/unit/message_cleaner_test.rb
|
567
569
|
- test/unit/openscap_host_test.rb
|
570
|
+
- test/unit/oval_host_test.rb
|
571
|
+
- test/unit/oval_policy_test.rb
|
572
|
+
- test/unit/oval_status_test.rb
|
568
573
|
- test/unit/policy_mailer_test.rb
|
574
|
+
- test/unit/policy_test.rb
|
569
575
|
- test/unit/scap_content_test.rb
|
570
|
-
- test/unit/services/report_dashboard/data_test.rb
|
571
|
-
- test/unit/services/tailoring_files_proxy_check_test.rb
|
572
|
-
- test/unit/services/oval/cves_test.rb
|
573
|
-
- test/unit/services/oval/setup_test.rb
|
574
|
-
- test/unit/services/oval/setup_check_test.rb
|
575
576
|
- test/unit/services/config_name_service_test.rb
|
576
|
-
- test/unit/services/lookup_key_overrider_test.rb
|
577
577
|
- test/unit/services/hostgroup_overrider_test.rb
|
578
|
+
- test/unit/services/lookup_key_overrider_test.rb
|
579
|
+
- test/unit/services/oval/cves_test.rb
|
580
|
+
- test/unit/services/oval/setup_check_test.rb
|
581
|
+
- test/unit/services/oval/setup_test.rb
|
582
|
+
- test/unit/services/report_dashboard/data_test.rb
|
583
|
+
- test/unit/services/tailoring_files_proxy_check_test.rb
|
578
584
|
- test/unit/tailoring_file_test.rb
|
579
|
-
- test/unit/oval_host_test.rb
|
580
|
-
- test/unit/oval_policy_test.rb
|
581
|
-
- test/unit/oval_status_test.rb
|
582
|
-
- test/unit/policy_test.rb
|
583
|
-
- test/fixtures/cve_fixtures.rb
|
584
|
-
- test/graphql/queries/oval_contents_query_test.rb
|
585
|
-
- test/graphql/queries/oval_policies_query_test.rb
|
586
|
-
- test/graphql/queries/oval_content_query_test.rb
|
587
|
-
- test/graphql/mutations/oval_policies/delete_mutation_test.rb
|
588
585
|
- test/test_plugin_helper.rb
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|