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

Compatibility with Opensearch Dashboard 2.17.1 #7131

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to the Wazuh app project will be documented in this file.

## Wazuh v5.0.0 - OpenSearch Dashboards 2.16.0 - Revision 00
## Wazuh v5.0.0 - OpenSearch Dashboards 2.17.1 - Revision 00

### Added

Expand Down
2 changes: 1 addition & 1 deletion docker/imposter/wazuh-config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
plugin: openapi
specFile: https://raw.githubusercontent.com/wazuh/wazuh/master/api/api/spec/spec.yaml
specFile: https://raw.githubusercontent.com/wazuh/wazuh/v4.9.1/api/api/spec/spec.yaml
system:
stores:
# this store is preloaded from file
Expand Down
3 changes: 3 additions & 0 deletions docker/osd-dev/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ os_versions=(
'2.14.0'
'2.15.0'
'2.16.0'
'2.17.1'
)

osd_versions=(
Expand All @@ -40,6 +41,8 @@ osd_versions=(
'2.14.0'
'2.15.0'
'2.16.0'
'2.17.1'
'2.17.1.arm'
)

wzs_version=(
Expand Down
3 changes: 1 addition & 2 deletions docker/osd-dev/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,9 @@ services:
- ${OSD_PORT}:5601
environment:
- 'LOGS=/proc/1/fd/1'
entrypoint: ['tail', '-f', '/dev/null']
volumes:
- osd_cache:/home/node/.cache
- '${SRC}/main:/home/node/kbn/plugins/wazuh'
- '${SRC}/main:/home/node/kbn/plugins/main'
- '${SRC}/wazuh-core:/home/node/kbn/plugins/wazuh-core'
- '${SRC}/wazuh-check-updates:/home/node/kbn/plugins/wazuh-check-updates'
- '${SRC}/wazuh-engine:/home/node/kbn/plugins/wazuh-engine'
Expand Down
2 changes: 1 addition & 1 deletion plugins/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "5.0.0",
"revision": "00",
"pluginPlatform": {
"version": "2.16.0"
"version": "2.17.1"
},
"description": "Wazuh dashboard",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ exports[`AgentStatTable component Renders correctly to match the snapshot 1`] =
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="left"
iconSize="m"
iconType="importAction"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ exports[`[component] InputForm Renders correctly to match the snapshot: Input: s
exports[`[component] InputForm Renders correctly to match the snapshot: Input: switch 1`] = `
<div>
<div
class="euiSwitch"
class="euiSwitch euiSwitch--primary"
>
<button
aria-checked="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ exports[`Table Default component renders correctly to match the snapshot 1`] = `
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="right"
iconSize="s"
iconType="arrowDown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ exports[`Table With Search Bar component renders correctly to match the snapshot
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="left"
iconSize="m"
textProps={
Expand Down Expand Up @@ -716,6 +717,7 @@ exports[`Table With Search Bar component renders correctly to match the snapshot
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="right"
iconSize="s"
iconType="arrowDown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ exports[`Table WZ API component renders correctly to match the snapshot 1`] = `
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="right"
iconSize="s"
iconType="arrowDown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ exports[`Export Table Csv component renders correctly to match the snapshot 1`]
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="left"
iconSize="m"
iconType="importAction"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ exports[`SubscriptionTab component renders correctly to match the snapshot 1`] =
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="left"
iconSize="m"
iconType="questionInCircle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ exports[`ApiAuthTab component renders correctly to match the snapshot 1`] = `
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="left"
iconSize="m"
iconType="questionInCircle"
Expand Down Expand Up @@ -336,6 +337,7 @@ exports[`ApiAuthTab component renders correctly to match the snapshot 1`] = `
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="left"
iconSize="m"
textProps={
Expand Down Expand Up @@ -373,6 +375,7 @@ exports[`ApiAuthTab component renders correctly to match the snapshot 1`] = `
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="left"
iconSize="m"
textProps={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ exports[`GeneralTab component renders correctly to match the snapshot 1`] = `
>
<EuiButtonContent
className="euiButtonEmpty__content"
iconGap="m"
iconSide="left"
iconSize="m"
iconType="questionInCircle"
Expand Down
2 changes: 1 addition & 1 deletion plugins/wazuh-check-updates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "5.0.0",
"revision": "00",
"pluginPlatform": {
"version": "2.16.0"
"version": "2.17.1"
},
"description": "Wazuh Check Updates",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion plugins/wazuh-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "5.0.0",
"revision": "00",
"pluginPlatform": {
"version": "2.16.0"
"version": "2.17.1"
},
"description": "Wazuh Core",
"private": true,
Expand Down
6 changes: 6 additions & 0 deletions plugins/wazuh-engine/common/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export enum API_UPDATES_STATUS {
UP_TO_DATE = 'upToDate',
AVAILABLE_UPDATES = 'availableUpdates',
DISABLED = 'disabled',
ERROR = 'error',
}
4 changes: 2 additions & 2 deletions plugins/wazuh-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "5.0.0",
"revision": "00",
"pluginPlatform": {
"version": "2.16.0"
"version": "2.17.1"
},
"description": "Wazuh Engine",
"private": true,
Expand All @@ -22,4 +22,4 @@
"@testing-library/user-event": "^14.5.0",
"@types/": "testing-library/user-event"
}
}
}
9 changes: 8 additions & 1 deletion plugins/wazuh-engine/server/plugin-services.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { CoreStart } from 'opensearch-dashboards/server';
import {
CoreStart,
ISavedObjectsRepository,
} from 'opensearch-dashboards/server';
import { createGetterSetter } from '../../../src/plugins/opensearch_dashboards_utils/common';
import { WazuhCorePluginStart } from '../../wazuh-core/server';

export const [getInternalSavedObjectsClient, setInternalSavedObjectsClient] =
createGetterSetter<ISavedObjectsRepository>('SavedObjectsRepository');
export const [getCore, setCore] = createGetterSetter<CoreStart>('Core');
export const [getWazuhCore, setWazuhCore] =
createGetterSetter<WazuhCorePluginStart>('WazuhCore');
export const [getWazuhCheckUpdatesServices, setWazuhCheckUpdatesServices] =
createGetterSetter<any>('WazuhCheckUpdatesServices');
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import {
getInternalSavedObjectsClient,
getWazuhCore,
getWazuhCheckUpdatesServices,
} from '../../plugin-services';
import { getSavedObject } from './get-saved-object';

jest.mock('../../plugin-services', () => ({
getInternalSavedObjectsClient: jest.fn(),
getWazuhCheckUpdatesServices: jest.fn(),
}));

const mockedGetInternalObjectsClient =
getInternalSavedObjectsClient as jest.Mock;
const mockedGetWazuhCheckUpdatesServices =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import {
getInternalSavedObjectsClient,
getWazuhCore,
getWazuhCheckUpdatesServices,
} from '../../plugin-services';
import { setSavedObject } from './set-saved-object';

jest.mock('../../plugin-services', () => ({
getInternalSavedObjectsClient: jest.fn(),
getWazuhCheckUpdatesServices: jest.fn(),
}));

const mockedGetInternalObjectsClient =
getInternalSavedObjectsClient as jest.Mock;
const mockedGetWazuhCheckUpdatesServices =
getWazuhCheckUpdatesServices as jest.Mock;
jest.mock('../../plugin-services');

describe('setSavedObject function', () => {
afterEach(() => {
Expand Down
17 changes: 13 additions & 4 deletions plugins/wazuh-engine/server/services/updates/get-updates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,25 @@ import { API_UPDATES_STATUS } from '../../../common/types';
import { getUpdates } from './get-updates';
import { SAVED_OBJECT_UPDATES } from '../../../common/constants';

const mockedGetSavedObject = getSavedObject as jest.Mock;
jest.mock('../saved-object/get-saved-object');
jest.mock('../../plugin-services', () => ({
getInternalSavedObjectsClient: jest.fn(),
getWazuhCheckUpdatesServices: jest.fn(),
getWazuhCore: jest.fn(),
}));

jest.mock('../saved-object/get-saved-object', () => ({
getSavedObject: jest.fn(),
}));
jest.mock('../saved-object/set-saved-object', () => ({
setSavedObject: jest.fn(),
}));

const mockedGetSavedObject = getSavedObject as jest.Mock;
const mockedSetSavedObject = setSavedObject as jest.Mock;
jest.mock('../saved-object/set-saved-object');

const mockedGetWazuhCore = getWazuhCore as jest.Mock;
const mockedGetWazuhCheckUpdatesServices =
getWazuhCheckUpdatesServices as jest.Mock;
jest.mock('../../plugin-services');

describe('getUpdates function', () => {
afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import {
getWazuhCheckUpdatesServices,
} from '../../plugin-services';

jest.mock('../../plugin-services', () => ({
getInternalSavedObjectsClient: jest.fn(),
getWazuhCheckUpdatesServices: jest.fn(),
}));

const mockedGetSavedObject = getSavedObject as jest.Mock;
jest.mock('../saved-object/get-saved-object');

const mockedGetWazuhCore = getWazuhCore as jest.Mock;
const mockedGetWazuhCheckUpdatesServices =
getWazuhCheckUpdatesServices as jest.Mock;
jest.mock('../../plugin-services');

describe('getUserPreferences function', () => {
afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@ import { updateUserPreferences } from '.';
import { getSavedObject } from '../saved-object/get-saved-object';
import { setSavedObject } from '../saved-object/set-saved-object';
import { SAVED_OBJECT_USER_PREFERENCES } from '../../../common/constants';
import {
getWazuhCore,
getWazuhCheckUpdatesServices,
} from '../../plugin-services';
import { getWazuhCheckUpdatesServices } from '../../plugin-services';

const mockedGetSavedObject = getSavedObject as jest.Mock;
jest.mock('../saved-object/get-saved-object');
jest.mock('../saved-object/set-saved-object', () => ({
setSavedObject: jest.fn(),
}));

jest.mock('../saved-object/get-saved-object', () => ({
getSavedObject: jest.fn(),
}));

jest.mock('../../plugin-services', () => ({
getInternalSavedObjectsClient: jest.fn(),
getWazuhCheckUpdatesServices: jest.fn(),
}));

const mockedGetSavedObject = getSavedObject as jest.Mock;
const mockedSetSavedObject = setSavedObject as jest.Mock;
jest.mock('../saved-object/set-saved-object');

const mockedGetWazuhCore = getWazuhCore as jest.Mock;
const mockedGetWazuhCheckUpdatesServices =
getWazuhCheckUpdatesServices as jest.Mock;
jest.mock('../../plugin-services');

describe('updateUserPreferences function', () => {
afterEach(() => {
Expand Down
14 changes: 11 additions & 3 deletions plugins/wazuh-fleet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "5.0.0",
"revision": "00",
"pluginPlatform": {
"version": "2.16.0"
"version": "2.17.1"
},
"description": "Wazuh Fleet",
"private": true,
Expand All @@ -22,8 +22,16 @@
"md5": "^2.3.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^14.5.0",
"@types/": "testing-library/user-event",
"@types/md5": "^2.3.2"
"@types/jest": "^29.5.14",
"@types/md5": "^2.3.2",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"jest": "^29.7.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
}
}
Loading
Loading