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

Add initialization service #7145

Merged
merged 34 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7f186d6
feat(initialization): add initialization service
Desvelao Nov 8, 2024
710774b
fix: call method of saved object service
Desvelao Nov 8, 2024
5f94e00
chore: remove console.log
Desvelao Nov 8, 2024
f76784a
feat(initialization): add API endpoints to manage the initialization …
Desvelao Nov 11, 2024
11e40e9
feat(initialization): enhance documentation
Desvelao Nov 11, 2024
c5aaf7c
feat(initialization): add tests
Desvelao Nov 12, 2024
4c0a863
feat(initialization): enhance task related to check connection and co…
Desvelao Nov 12, 2024
d5b0b9f
fix(initialization): minor fixes in tasks
Desvelao Nov 12, 2024
1b052be
feat(initialization): add default fields for vulnerability-states ind…
Desvelao Nov 12, 2024
2777291
Merge branch 'master' of https://github.com/wazuh/wazuh-kibana-app in…
Desvelao Nov 12, 2024
168c4d7
Merge branch 'master' into enhancement/7133-add-initialization-service
asteriscos Nov 21, 2024
fb4eb7f
fix: import statement related to specific function instead of all module
Desvelao Nov 22, 2024
5920547
Apply suggestions from code review
Desvelao Nov 22, 2024
a68e03d
fix: rename setting
Desvelao Nov 22, 2024
409115f
fix(initialization): apply review suggestions related to creation of …
Desvelao Nov 25, 2024
d123f31
fix(initialization): move InitializationTask class to another file
Desvelao Nov 25, 2024
5e03e8b
fix(initialization): add types
Desvelao Nov 26, 2024
d194092
fix(initialization): typo
Desvelao Nov 26, 2024
fdc987c
fix(initialization): move temporal registration to core plugin
Desvelao Nov 26, 2024
e3b1cc4
fix(initialization): add missing default index pattern fields for alerts
Desvelao Nov 26, 2024
90c99aa
fix(initialization): enhance types and rename error variable
Desvelao Nov 26, 2024
83ea856
fix(initialization): variable name in test
Desvelao Nov 26, 2024
92f6d0c
fix(initialization): enhance types and rename error variable
Desvelao Nov 26, 2024
fa3b79a
fix(initialization): enhance types
Desvelao Nov 26, 2024
b27efff
Merge branch 'master' of https://github.com/wazuh/wazuh-kibana-app in…
Desvelao Nov 26, 2024
0fbe92a
fix(prettier): initalization task
Desvelao Nov 26, 2024
bff0b53
chore(changelog): add entry
Desvelao Nov 27, 2024
c01b2aa
Update plugins/wazuh-core/common/services/initialization/constants.ts
Desvelao Nov 28, 2024
1df7f7a
Update plugins/wazuh-core/common/services/initialization/types.ts
Desvelao Nov 28, 2024
b993f59
fix(initialization): adapt initialization task to new constants
Desvelao Nov 29, 2024
2f3af97
Merge branch 'master' of https://github.com/wazuh/wazuh-kibana-app in…
Desvelao Nov 29, 2024
57e345e
fix(initlization): lint
Desvelao Dec 2, 2024
97961ca
fix(initlization): lint
Desvelao Dec 2, 2024
c27446a
fix(test): service name
Desvelao Dec 2, 2024
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to the Wazuh app project will be documented in this file.

- Support for Wazuh 5.0.0
- Added creation of report definition when creating dashboard by reference and the button to reset the report [#7091](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7091)
- Added an initilization service to core plugin to run the initilization tasks related to user scope [#7145](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7145)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function checkExistenceIndices(indexPatternId: string) {

async function createIndexPattern(indexPattern, fields: any) {
try {
await SavedObject.createSavedObjectIndexPattern(
await SavedObject.createSavedObject(
'index-pattern',
indexPattern,
{
Expand Down
16 changes: 16 additions & 0 deletions plugins/wazuh-core/common/services/initialization/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const INITIALIZATION_TASK = {
RUN_STATUS: {
NOT_STARTED: 'not_started',
RUNNING: 'running',
FINISHED: 'finished',
},
RUN_RESULT: {
NULL: null,
SUCCESS: 'success',
FAIL: 'fail',
},
CONTEXT: {
INTERNAL: 'internal',
USER: 'user',
},
} as const;
13 changes: 13 additions & 0 deletions plugins/wazuh-core/common/services/initialization/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { INITIALIZATION_TASK } from './constants';

type RunStatusEnum = (typeof INITIALIZATION_TASK)['RUN_STATUS'];

export type InitializationTaskRunStatus = RunStatusEnum[keyof RunStatusEnum];

type RunResultEnum = (typeof INITIALIZATION_TASK)['RUN_RESULT'];

export type InitializationTaskRunResult = RunResultEnum[keyof RunResultEnum];

type ContextEnum = (typeof INITIALIZATION_TASK)['CONTEXT'];

export type InitializationTaskContext = ContextEnum[keyof ContextEnum];
2 changes: 1 addition & 1 deletion plugins/wazuh-core/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export function plugin(initializerContext: PluginInitializerContext) {
return new WazuhCorePlugin(initializerContext);
}

export type { WazuhCorePluginSetup, WazuhCorePluginStart } from './types';
export * from './types';
export type { IConfigurationEnhanced } from './services/enhance-configuration';
Loading
Loading