Fix sending user_enabled instead of enabled when creating/updating integrations - #426
Draft
Desvelao wants to merge 2 commits into
Draft
Fix sending user_enabled instead of enabled when creating/updating integrations#426Desvelao wants to merge 2 commits into
Desvelao wants to merge 2 commits into
Conversation
…grations The Content Manager now derives document.enabled from user_enabled and cti_enabled itself, and rejects requests that still send enabled directly (400 Missing [user_enabled] field). Rename the field on the outgoing create/update resource payload in every space; reads keep using document.enabled unchanged. Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Desvelao
marked this pull request as ready for review
July 29, 2026 10:30
Desvelao
marked this pull request as draft
July 29, 2026 10:30
Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Content Manager is changing how an integration's enabled state is stored: an integration now carries three boolean fields (
cti_enabled,user_enabled,enabled), each written by exactly one actor. Reading keeps usingdocument.enabledunchanged, but the Content Manager now derivesenableditself and rejects create/update requests that still send it directly (400 Missing [user_enabled] field).This PR renames the field sent in the outgoing create/update payload from
enabledtouser_enabled, in every space (standard,draft,test,custom).Closes #427
Proposed Changes
IntegrationResourcePayloadtype (types/Integrations.ts): the Content Manager resource shape,IntegrationBase['document']minusenabledplususer_enabled.toIntegrationResourcePayload()(server/utils/helpers.ts): renamesenabled→user_enabledon the document before it is sent to the Content Manager.server/services/IntegrationService.ts:createIntegrationandupdateIntegrationnow build the outgoingresourcebody throughtoIntegrationResourcePayload().searchIntegrations,PoliciesService, browser code) — they keep usingdocument.enabledas returned by the Content Manager, unchanged.Results and Evidence
Not yet verified end-to-end: the Content Manager's
user_enabled/cti_enabledsupport depends on the indexer package from wazuh/wazuh-indexer-plugins#1403, which is not yet available. This PR stays in draft until that package is published and the create/update flows can be validated against a real cluster, in every space.Tests Introduced
server/utils/helpers.test.ts: unit tests fortoIntegrationResourcePayload, coveringenabled: true/falseand confirming the rest of the document is left untouched acrossstandard/draft/test/customspaces.Review Checklist
no-changelog)