foreman_rh_cloud 13.0.4 → 13.0.6
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/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +47 -26
- data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +46 -25
- data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +32 -11
- data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +46 -25
- data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +46 -25
- data/app/controllers/concerns/insights_cloud/package_profile_upload_extensions.rb +2 -3
- data/app/services/foreman_rh_cloud/cert_auth.rb +13 -3
- data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +3 -1
- data/app/services/foreman_rh_cloud/tags_auth.rb +2 -1
- data/lib/foreman_inventory_upload/async/create_missing_insights_facets.rb +29 -0
- data/lib/foreman_inventory_upload/async/generate_host_report.rb +20 -0
- data/lib/foreman_inventory_upload/async/generate_report_job.rb +1 -1
- data/lib/foreman_inventory_upload/async/host_inventory_report_job.rb +39 -0
- data/lib/foreman_inventory_upload/async/single_host_report_job.rb +20 -0
- data/lib/foreman_inventory_upload/async/upload_report_job.rb +2 -1
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +2 -2
- data/lib/foreman_inventory_upload/generators/slice.rb +3 -3
- data/lib/foreman_inventory_upload/scripts/uploader.sh.erb +7 -1
- data/lib/foreman_rh_cloud/engine.rb +0 -21
- data/lib/foreman_rh_cloud/plugin.rb +10 -10
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/insights_cloud/async/vmaas_reposcan_sync.rb +8 -1
- data/lib/tasks/rh_cloud_inventory.rake +14 -32
- data/locale/foreman_rh_cloud.pot +55 -18
- data/locale/fr/foreman_rh_cloud.po +48 -27
- data/locale/ja/foreman_rh_cloud.po +47 -26
- data/locale/ka/foreman_rh_cloud.po +32 -11
- data/locale/ko/foreman_rh_cloud.po +47 -26
- data/locale/zh_CN/foreman_rh_cloud.po +47 -26
- data/package.json +1 -1
- data/test/unit/fact_helpers_test.rb +47 -0
- data/test/unit/lib/insights_cloud/async/vmaas_reposcan_sync_test.rb +12 -2
- data/test/unit/slice_generator_test.rb +57 -0
- data/webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js +57 -21
- data/webpack/InsightsHostDetailsTab/__tests__/InsightsTotalRiskChart.test.js +194 -0
- data/webpack/InsightsVulnerabilityHostIndexExtensions/CVECountCell.js +8 -2
- data/webpack/InsightsVulnerabilityHostIndexExtensions/__tests__/CVECountCell.test.js +48 -2
- metadata +6 -2
- data/app/services/foreman_rh_cloud/gateway_request.rb +0 -26
@@ -18,36 +18,67 @@ import SkeletonLoader from 'foremanReact/components/common/SkeletonLoader';
|
|
18
18
|
import { insightsCloudUrl } from '../InsightsCloudSync/InsightsCloudSyncHelpers';
|
19
19
|
import { getInitialRisks, theme } from './InsightsTabConstants';
|
20
20
|
|
21
|
-
const InsightsTotalRiskCard = ({ hostDetails
|
21
|
+
const InsightsTotalRiskCard = ({ hostDetails }) => {
|
22
|
+
const { id, insights_attributes: insightsFacet } = hostDetails;
|
23
|
+
const uuid = insightsFacet?.uuid;
|
24
|
+
// eslint-disable-next-line camelcase
|
25
|
+
const isIop = insightsFacet?.use_iop_mode;
|
22
26
|
const [totalRisks, setTotalRisks] = useState(getInitialRisks());
|
23
27
|
const hashHistory = useHistory();
|
24
28
|
const dispatch = useDispatch();
|
25
29
|
const API_KEY = `HOST_${id}_RECOMMENDATIONS`;
|
26
30
|
const API_OPTIONS = useMemo(() => ({ key: API_KEY }), [API_KEY]);
|
27
|
-
const url = id && insightsCloudUrl(`hits/${id}`); // This will keep the API call from being triggered if there's no host id.
|
28
|
-
const {
|
29
|
-
status = STATUS.PENDING,
|
30
|
-
response: { hits = [] },
|
31
|
-
} = useAPI('get', url, API_OPTIONS);
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
// This will keep the API call from being triggered if there's no host id.
|
33
|
+
const url = isIop
|
34
|
+
? uuid && insightsCloudUrl(`api/insights/v1/system/${uuid}`)
|
35
|
+
: id && insightsCloudUrl(`hits/${id}`);
|
36
|
+
const { status = STATUS.PENDING, response } = useAPI('get', url, API_OPTIONS);
|
37
|
+
|
38
|
+
const checkRisks = useMemo(() => {
|
39
|
+
if (!response || status !== STATUS.RESOLVED) {
|
40
|
+
return getInitialRisks();
|
41
|
+
}
|
42
|
+
|
43
|
+
const risks = getInitialRisks();
|
44
|
+
if (isIop) {
|
45
|
+
const {
|
46
|
+
low_hits: lowHits = 0,
|
47
|
+
moderate_hits: moderateHits = 0,
|
48
|
+
important_hits: importantHits = 0,
|
49
|
+
critical_hits: criticalHits = 0,
|
50
|
+
hits = 0,
|
51
|
+
} = response;
|
52
|
+
|
53
|
+
risks[1].value += lowHits;
|
54
|
+
risks[2].value += moderateHits;
|
55
|
+
risks[3].value += importantHits;
|
56
|
+
risks[4].value += criticalHits;
|
57
|
+
risks.total = hits;
|
58
|
+
} else {
|
59
|
+
const { hits = [] } = response;
|
36
60
|
hits.forEach(({ total_risk: risk }) => {
|
37
61
|
risks[risk].value += 1;
|
38
62
|
});
|
39
63
|
risks.total = hits.length;
|
40
|
-
setTotalRisks(risks);
|
41
64
|
}
|
42
|
-
|
65
|
+
return risks;
|
66
|
+
}, [response, status, isIop]);
|
67
|
+
|
68
|
+
useEffect(() => {
|
69
|
+
setTotalRisks(checkRisks);
|
70
|
+
}, [checkRisks]);
|
71
|
+
|
72
|
+
if (!insightsFacet) return null;
|
43
73
|
|
44
74
|
const onChartClick = (evt, { index }) => {
|
45
75
|
hashHistory.push(`/Insights`);
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
76
|
+
!isIop &&
|
77
|
+
dispatch(
|
78
|
+
push({
|
79
|
+
search: `search=total_risk+%3D+${index + 1}`,
|
80
|
+
})
|
81
|
+
);
|
51
82
|
};
|
52
83
|
|
53
84
|
const onChartHover = (evt, { index }) => [
|
@@ -61,11 +92,16 @@ const InsightsTotalRiskCard = ({ hostDetails: { id } }) => {
|
|
61
92
|
const { 1: low, 2: moderate, 3: important, 4: critical, total } = totalRisks;
|
62
93
|
|
63
94
|
// eslint-disable-next-line react/prop-types
|
64
|
-
const LegendLabel = ({ index, ...rest }) =>
|
65
|
-
|
66
|
-
<ChartLabel {...rest}
|
67
|
-
|
68
|
-
|
95
|
+
const LegendLabel = ({ index, ...rest }) => {
|
96
|
+
if (isIop) {
|
97
|
+
return <ChartLabel {...rest} />;
|
98
|
+
}
|
99
|
+
return (
|
100
|
+
<a key={index} onClick={() => onChartClick(null, { index })}>
|
101
|
+
<ChartLabel {...rest} />
|
102
|
+
</a>
|
103
|
+
);
|
104
|
+
};
|
69
105
|
|
70
106
|
const legend = (
|
71
107
|
<ChartLegend
|
@@ -0,0 +1,194 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
3
|
+
import '@testing-library/jest-dom';
|
4
|
+
import { Provider } from 'react-redux';
|
5
|
+
import { ConnectedRouter } from 'connected-react-router';
|
6
|
+
import { createMemoryHistory } from 'history';
|
7
|
+
import configureMockStore from 'redux-mock-store';
|
8
|
+
import { STATUS } from 'foremanReact/constants';
|
9
|
+
import * as APIHooks from 'foremanReact/common/hooks/API/APIHooks';
|
10
|
+
import InsightsTotalRiskCard from '../InsightsTotalRiskChart';
|
11
|
+
|
12
|
+
jest.mock('foremanReact/common/hooks/API/APIHooks');
|
13
|
+
jest.mock('foremanReact/common/I18n', () => ({
|
14
|
+
translate: jest.fn(str => str),
|
15
|
+
}));
|
16
|
+
|
17
|
+
const mockStore = configureMockStore();
|
18
|
+
const history = createMemoryHistory();
|
19
|
+
const store = mockStore({
|
20
|
+
router: {
|
21
|
+
location: {
|
22
|
+
pathname: '/',
|
23
|
+
search: '',
|
24
|
+
hash: '',
|
25
|
+
state: null,
|
26
|
+
},
|
27
|
+
action: 'POP',
|
28
|
+
},
|
29
|
+
});
|
30
|
+
|
31
|
+
const defaultHostDetails = {
|
32
|
+
id: 1,
|
33
|
+
insights_attributes: {
|
34
|
+
uuid: 'test-uuid',
|
35
|
+
use_iop_mode: false,
|
36
|
+
},
|
37
|
+
};
|
38
|
+
|
39
|
+
const renderComponent = (props = {}) => {
|
40
|
+
const allProps = {
|
41
|
+
hostDetails: defaultHostDetails,
|
42
|
+
...props,
|
43
|
+
};
|
44
|
+
|
45
|
+
return render(
|
46
|
+
<Provider store={store}>
|
47
|
+
<ConnectedRouter history={history}>
|
48
|
+
<InsightsTotalRiskCard {...allProps} />
|
49
|
+
</ConnectedRouter>
|
50
|
+
</Provider>
|
51
|
+
);
|
52
|
+
};
|
53
|
+
|
54
|
+
describe('InsightsTotalRiskChart', () => {
|
55
|
+
beforeEach(() => {
|
56
|
+
store.clearActions();
|
57
|
+
jest.clearAllMocks();
|
58
|
+
});
|
59
|
+
|
60
|
+
it('should show loading state initially', () => {
|
61
|
+
APIHooks.useAPI.mockReturnValue({
|
62
|
+
status: STATUS.PENDING,
|
63
|
+
response: null,
|
64
|
+
});
|
65
|
+
|
66
|
+
renderComponent();
|
67
|
+
// SkeletonLoader shows loading state when status is PENDING
|
68
|
+
expect(screen.queryByText('No results found')).not.toBeInTheDocument();
|
69
|
+
expect(
|
70
|
+
screen.queryByTestId('rh-cloud-total-risk-card')
|
71
|
+
).not.toBeInTheDocument();
|
72
|
+
});
|
73
|
+
|
74
|
+
it('should display error state when API fails', async () => {
|
75
|
+
APIHooks.useAPI.mockReturnValue({
|
76
|
+
status: STATUS.ERROR,
|
77
|
+
response: null,
|
78
|
+
});
|
79
|
+
|
80
|
+
renderComponent();
|
81
|
+
expect(screen.getByText('No results found')).toBeInTheDocument();
|
82
|
+
expect(
|
83
|
+
screen.queryByTestId('rh-cloud-total-risk-card')
|
84
|
+
).not.toBeInTheDocument();
|
85
|
+
});
|
86
|
+
|
87
|
+
it('should handle non-IoP mode API response correctly', async () => {
|
88
|
+
const mockResponse = {
|
89
|
+
hits: [
|
90
|
+
{ total_risk: 1 },
|
91
|
+
{ total_risk: 2 },
|
92
|
+
{ total_risk: 2 },
|
93
|
+
{ total_risk: 3 },
|
94
|
+
{ total_risk: 4 },
|
95
|
+
],
|
96
|
+
};
|
97
|
+
|
98
|
+
APIHooks.useAPI.mockReturnValue({
|
99
|
+
status: STATUS.RESOLVED,
|
100
|
+
response: mockResponse,
|
101
|
+
});
|
102
|
+
|
103
|
+
renderComponent();
|
104
|
+
|
105
|
+
await waitFor(() => {
|
106
|
+
// Check if total number of recommendations is displayed
|
107
|
+
expect(screen.getByText('5')).toBeInTheDocument();
|
108
|
+
// Check if risk levels are displayed correctly
|
109
|
+
expect(screen.getByText(/Low: 1/)).toBeInTheDocument();
|
110
|
+
expect(screen.getByText(/Moderate: 2/)).toBeInTheDocument();
|
111
|
+
expect(screen.getByText(/Important: 1/)).toBeInTheDocument();
|
112
|
+
expect(screen.getByText(/Critical: 1/)).toBeInTheDocument();
|
113
|
+
});
|
114
|
+
});
|
115
|
+
|
116
|
+
it('should handle IOP mode API response correctly', async () => {
|
117
|
+
const mockResponse = {
|
118
|
+
low_hits: 2,
|
119
|
+
moderate_hits: 3,
|
120
|
+
important_hits: 1,
|
121
|
+
critical_hits: 2,
|
122
|
+
hits: 8,
|
123
|
+
};
|
124
|
+
|
125
|
+
APIHooks.useAPI.mockReturnValue({
|
126
|
+
status: STATUS.RESOLVED,
|
127
|
+
response: mockResponse,
|
128
|
+
});
|
129
|
+
|
130
|
+
renderComponent({
|
131
|
+
hostDetails: {
|
132
|
+
...defaultHostDetails,
|
133
|
+
insights_attributes: {
|
134
|
+
...defaultHostDetails.insights_attributes,
|
135
|
+
use_iop_mode: true,
|
136
|
+
},
|
137
|
+
},
|
138
|
+
});
|
139
|
+
|
140
|
+
await waitFor(() => {
|
141
|
+
// Check if total number of recommendations is displayed
|
142
|
+
expect(screen.getByText('8')).toBeInTheDocument();
|
143
|
+
// Check if risk levels are displayed correctly
|
144
|
+
expect(screen.getByText(/Low: 2/)).toBeInTheDocument();
|
145
|
+
expect(screen.getByText(/Moderate: 3/)).toBeInTheDocument();
|
146
|
+
expect(screen.getByText(/Important: 1/)).toBeInTheDocument();
|
147
|
+
expect(screen.getByText(/Critical: 2/)).toBeInTheDocument();
|
148
|
+
});
|
149
|
+
});
|
150
|
+
|
151
|
+
it('should show empty state when no recommendations exist', async () => {
|
152
|
+
APIHooks.useAPI.mockReturnValue({
|
153
|
+
status: STATUS.RESOLVED,
|
154
|
+
response: { hits: [] },
|
155
|
+
});
|
156
|
+
|
157
|
+
renderComponent();
|
158
|
+
|
159
|
+
await waitFor(() => {
|
160
|
+
expect(screen.getByText(/Low: 0/)).toBeInTheDocument();
|
161
|
+
expect(screen.getByText(/Moderate: 0/)).toBeInTheDocument();
|
162
|
+
expect(screen.getByText(/Important: 0/)).toBeInTheDocument();
|
163
|
+
expect(screen.getByText(/Critical: 0/)).toBeInTheDocument();
|
164
|
+
});
|
165
|
+
});
|
166
|
+
|
167
|
+
it('should use correct API endpoint based on IOP mode', () => {
|
168
|
+
renderComponent({
|
169
|
+
hostDetails: {
|
170
|
+
...defaultHostDetails,
|
171
|
+
insights_attributes: {
|
172
|
+
...defaultHostDetails.insights_attributes,
|
173
|
+
use_iop_mode: true,
|
174
|
+
},
|
175
|
+
},
|
176
|
+
});
|
177
|
+
|
178
|
+
expect(APIHooks.useAPI).toHaveBeenCalledWith(
|
179
|
+
'get',
|
180
|
+
expect.stringContaining('/api/insights/v1/system/test-uuid'),
|
181
|
+
expect.any(Object)
|
182
|
+
);
|
183
|
+
|
184
|
+
jest.clearAllMocks();
|
185
|
+
|
186
|
+
renderComponent();
|
187
|
+
|
188
|
+
expect(APIHooks.useAPI).toHaveBeenCalledWith(
|
189
|
+
'get',
|
190
|
+
expect.stringContaining('/hits/1'),
|
191
|
+
expect.any(Object)
|
192
|
+
);
|
193
|
+
});
|
194
|
+
});
|
@@ -3,25 +3,31 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import { UnknownIcon } from '@patternfly/react-icons';
|
4
4
|
import { Link } from 'react-router-dom';
|
5
5
|
import { useAPI } from 'foremanReact/common/hooks/API/APIHooks';
|
6
|
-
|
7
6
|
import { insightsCloudUrl } from '../InsightsCloudSync/InsightsCloudSyncHelpers';
|
7
|
+
import { useAdvisorEngineConfig } from '../common/Hooks/ConfigHooks';
|
8
8
|
|
9
9
|
const vulnerabilityApiPath = path =>
|
10
10
|
insightsCloudUrl(`api/vulnerability/v1/${path}`);
|
11
11
|
|
12
12
|
export const CVECountCell = ({ hostDetails }) => {
|
13
|
+
const isIopEnabled = useAdvisorEngineConfig();
|
14
|
+
|
13
15
|
// eslint-disable-next-line camelcase
|
14
16
|
const uuid = hostDetails?.subscription_facet_attributes?.uuid;
|
15
17
|
|
16
18
|
const key = `HOST_CVE_COUNT_${uuid}`;
|
17
19
|
const response = useAPI(
|
18
|
-
uuid ? 'get' : null,
|
20
|
+
isIopEnabled && uuid ? 'get' : null,
|
19
21
|
vulnerabilityApiPath(`systems?uuid=${uuid}`),
|
20
22
|
{
|
21
23
|
key,
|
22
24
|
}
|
23
25
|
);
|
24
26
|
|
27
|
+
if (!isIopEnabled) {
|
28
|
+
return <UnknownIcon />;
|
29
|
+
}
|
30
|
+
|
25
31
|
if (uuid === undefined) {
|
26
32
|
return <UnknownIcon />;
|
27
33
|
}
|
@@ -2,8 +2,11 @@ import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
3
3
|
import { API } from 'foremanReact/redux/API';
|
4
4
|
import { CVECountCell } from '../CVECountCell';
|
5
|
+
import * as ConfigHooks from '../../common/Hooks/ConfigHooks';
|
5
6
|
|
6
7
|
jest.mock('foremanReact/redux/API');
|
8
|
+
jest.mock('../../common/Hooks/ConfigHooks');
|
9
|
+
|
7
10
|
API.get.mockImplementation(async () => ({
|
8
11
|
data: [
|
9
12
|
{
|
@@ -14,15 +17,58 @@ API.get.mockImplementation(async () => ({
|
|
14
17
|
],
|
15
18
|
}));
|
16
19
|
|
20
|
+
const hostDetailsMock = {
|
21
|
+
name: 'test-host.example.com',
|
22
|
+
subscription_facet_attributes: {
|
23
|
+
uuid: 'test-uuid-123',
|
24
|
+
},
|
25
|
+
};
|
26
|
+
|
17
27
|
describe('CVECountCell', () => {
|
18
|
-
|
19
|
-
|
28
|
+
beforeEach(() => {
|
29
|
+
ConfigHooks.useAdvisorEngineConfig.mockReturnValue(true);
|
30
|
+
});
|
31
|
+
|
32
|
+
afterEach(() => {
|
33
|
+
jest.clearAllMocks();
|
34
|
+
});
|
35
|
+
|
36
|
+
it('renders an empty cves count column when no subscription UUID', () => {
|
37
|
+
const hostDetailsMockIoP = {
|
20
38
|
name: 'test-host.example.com',
|
21
39
|
subscription_facet_attributes: {
|
22
40
|
uuid: null, // no subscription
|
23
41
|
},
|
24
42
|
};
|
43
|
+
render(<CVECountCell hostDetails={hostDetailsMockIoP} />);
|
44
|
+
expect(screen.getByRole('img', { hidden: true })).toBeTruthy();
|
45
|
+
});
|
46
|
+
|
47
|
+
it('renders UnknownIcon when IoP is not enabled', () => {
|
48
|
+
ConfigHooks.useAdvisorEngineConfig.mockReturnValue(false);
|
49
|
+
render(<CVECountCell hostDetails={hostDetailsMock} />);
|
50
|
+
expect(screen.getByRole('img', { hidden: true })).toBeTruthy();
|
51
|
+
expect(ConfigHooks.useAdvisorEngineConfig).toHaveBeenCalled();
|
52
|
+
});
|
53
|
+
|
54
|
+
it('renders UnknownIcon when IoP is enabled but CVE API call fails', () => {
|
55
|
+
// Mock successful IoP config
|
56
|
+
ConfigHooks.useAdvisorEngineConfig.mockReturnValue(true);
|
57
|
+
// Mock CVE API failure - override the global mock for this test
|
58
|
+
API.get.mockImplementationOnce(async () => {
|
59
|
+
throw new Error('CVE API call failed');
|
60
|
+
});
|
61
|
+
|
62
|
+
render(<CVECountCell hostDetails={hostDetailsMock} />);
|
63
|
+
// Should render UnknownIcon when CVE API fails
|
64
|
+
expect(screen.getByRole('img', { hidden: true })).toBeTruthy();
|
65
|
+
expect(ConfigHooks.useAdvisorEngineConfig).toHaveBeenCalled();
|
66
|
+
});
|
67
|
+
|
68
|
+
it('renders UnknownIcon when IoP is undefined (API call pending)', () => {
|
69
|
+
ConfigHooks.useAdvisorEngineConfig.mockReturnValue(undefined);
|
25
70
|
render(<CVECountCell hostDetails={hostDetailsMock} />);
|
26
71
|
expect(screen.getByRole('img', { hidden: true })).toBeTruthy();
|
72
|
+
expect(ConfigHooks.useAdvisorEngineConfig).toHaveBeenCalled();
|
27
73
|
});
|
28
74
|
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_rh_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.0.
|
4
|
+
version: 13.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Red Hat Cloud team
|
@@ -139,7 +139,6 @@ files:
|
|
139
139
|
- app/services/foreman_rh_cloud/cloud_presence.rb
|
140
140
|
- app/services/foreman_rh_cloud/cloud_request.rb
|
141
141
|
- app/services/foreman_rh_cloud/cloud_request_forwarder.rb
|
142
|
-
- app/services/foreman_rh_cloud/gateway_request.rb
|
143
142
|
- app/services/foreman_rh_cloud/hit_remediations_retriever.rb
|
144
143
|
- app/services/foreman_rh_cloud/hits_uploader.rb
|
145
144
|
- app/services/foreman_rh_cloud/insights_api_forwarder.rb
|
@@ -185,13 +184,17 @@ files:
|
|
185
184
|
- db/seeds.d/50_job_templates.rb
|
186
185
|
- lib/foreman_inventory_upload.rb
|
187
186
|
- lib/foreman_inventory_upload/async/async_helpers.rb
|
187
|
+
- lib/foreman_inventory_upload/async/create_missing_insights_facets.rb
|
188
188
|
- lib/foreman_inventory_upload/async/delayed_start.rb
|
189
189
|
- lib/foreman_inventory_upload/async/generate_all_reports_job.rb
|
190
|
+
- lib/foreman_inventory_upload/async/generate_host_report.rb
|
190
191
|
- lib/foreman_inventory_upload/async/generate_report_job.rb
|
192
|
+
- lib/foreman_inventory_upload/async/host_inventory_report_job.rb
|
191
193
|
- lib/foreman_inventory_upload/async/progress_output.rb
|
192
194
|
- lib/foreman_inventory_upload/async/queue_for_upload_job.rb
|
193
195
|
- lib/foreman_inventory_upload/async/remove_insights_hosts_job.rb
|
194
196
|
- lib/foreman_inventory_upload/async/shell_process.rb
|
197
|
+
- lib/foreman_inventory_upload/async/single_host_report_job.rb
|
195
198
|
- lib/foreman_inventory_upload/async/upload_report_job.rb
|
196
199
|
- lib/foreman_inventory_upload/generators/archived_report.rb
|
197
200
|
- lib/foreman_inventory_upload/generators/fact_helpers.rb
|
@@ -621,6 +624,7 @@ files:
|
|
621
624
|
- webpack/InsightsHostDetailsTab/__tests__/InsightsTabIntegration.test.js
|
622
625
|
- webpack/InsightsHostDetailsTab/__tests__/InsightsTabReducer.test.js
|
623
626
|
- webpack/InsightsHostDetailsTab/__tests__/InsightsTabSelectors.test.js
|
627
|
+
- webpack/InsightsHostDetailsTab/__tests__/InsightsTotalRiskChart.test.js
|
624
628
|
- webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTab.test.js.snap
|
625
629
|
- webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabActions.test.js.snap
|
626
630
|
- webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabReducer.test.js.snap
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module ForemanRhCloud
|
2
|
-
module GatewayRequest
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
|
5
|
-
include CloudRequest
|
6
|
-
|
7
|
-
def execute_cloud_request(params)
|
8
|
-
certs = params.delete(:certs) || foreman_certificates
|
9
|
-
final_params = {
|
10
|
-
ssl_client_cert: OpenSSL::X509::Certificate.new(certs[:cert]),
|
11
|
-
ssl_client_key: OpenSSL::PKey.read(certs[:key]),
|
12
|
-
ssl_ca_file: Setting[:ssl_ca_file],
|
13
|
-
verify_ssl: OpenSSL::SSL::VERIFY_PEER,
|
14
|
-
}.deep_merge(params)
|
15
|
-
|
16
|
-
super(final_params)
|
17
|
-
end
|
18
|
-
|
19
|
-
def foreman_certificates
|
20
|
-
{
|
21
|
-
cert: File.read(Setting[:ssl_certificate]),
|
22
|
-
key: File.read(Setting[:ssl_priv_key]),
|
23
|
-
}
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|