Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore uuid field in GET /manager/version/check response #6157

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker/imposter/manager/version/check.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"data": {
"uuid": "7f828fd6-ef68-4656-b363-247b5861b84c",
"last_check_date": "2023-10-04T14:52:07.319561Z",
"current_version": "v4.8.0",
"update_check": true,
Expand Down
2 changes: 1 addition & 1 deletion plugins/main/public/components/settings/api/api-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export const ApiTable = compose(
color="primary"
iconType="questionInCircle"
aria-label="Info about the error"
onClick={() => this.props.copyToClipBoard(item.downReason)}
onClick={() => this.props.copyToClipBoard(api.error.detail)}
jbiset marked this conversation as resolved.
Show resolved Hide resolved
/>
</EuiToolTip>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ describe('getUpdates function', () => {
mockedGetWazuhCore.mockImplementation(() => ({
controllers: {
WazuhHostsCtrl: jest.fn().mockImplementation(() => ({
getHostsEntries: jest.fn().mockImplementation(() => [{ id: 'api id' }]),
getHostsEntries: jest
.fn()
.mockImplementation(() => [{ id: 'api id' }]),
})),
},
services: {
Expand All @@ -86,6 +88,7 @@ describe('getUpdates function', () => {
request: jest.fn().mockImplementation(() => ({
data: {
data: {
uuid: '7f828fd6-ef68-4656-b363-247b5861b84c',
current_version: '4.3.1',
last_available_patch: {
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
import { SAVED_OBJECT_UPDATES } from '../../../common/constants';
import { getSavedObject, setSavedObject } from '../saved-object';
import { getWazuhCore } from '../../plugin-services';
import _ from 'lodash';

export const getUpdates = async (checkAvailableUpdates?: boolean): Promise<AvailableUpdates> => {
try {
Expand All @@ -27,7 +28,7 @@ export const getUpdates = async (checkAvailableUpdates?: boolean): Promise<Avail
hosts?.map(async (api) => {
const data = {};
const method = 'GET';
const path = '/manager/version/check';
const path = '/manager/version/check?force_query=true';
const options = {
apiHostID: api.id,
forceRefresh: true,
Expand All @@ -51,8 +52,10 @@ export const getUpdates = async (checkAvailableUpdates?: boolean): Promise<Avail
? API_UPDATES_STATUS.AVAILABLE_UPDATES
: API_UPDATES_STATUS.UP_TO_DATE;

const updateWithoutUUID = _.omit(update, 'uuid');

return {
...update,
...updateWithoutUUID,
api_id: api.id,
status,
};
Expand Down
Loading