From c8be1e26d0ab24f9efd0e7efef4d76957fb9bea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20C=C3=B4t=C3=A9?= Date: Fri, 25 Oct 2024 15:54:59 -0400 Subject: [PATCH] Mark connector param validation failures as user errors (#197812) Resolves https://github.com/elastic/response-ops-team/issues/255 In this PR, I'm changing the type of error thrown when connector parameter validation fails so it indicates it's a user type of error. This will allow us to exclude these errors from our serverless monitoring given the users define the parameters the connectors receive when they run. Mainly via alerting rule mustache templates, which are easy to render empty strings and such. --- .../actions/server/lib/action_executor.test.ts | 2 +- .../actions/server/lib/action_executor.ts | 11 +++++++++++ .../tests/actions/connector_types/bedrock.ts | 4 ++-- .../actions/connector_types/cases_webhook.ts | 10 +++++----- .../tests/actions/connector_types/d3security.ts | 4 ++-- .../tests/actions/connector_types/gemini.ts | 4 ++-- .../group2/tests/actions/connector_types/jira.ts | 16 ++++++++-------- .../tests/actions/connector_types/openai.ts | 4 ++-- .../actions/connector_types/servicenow_itom.ts | 6 +++--- .../actions/connector_types/servicenow_itsm.ts | 12 ++++++------ .../actions/connector_types/servicenow_sir.ts | 12 ++++++------ .../tests/actions/connector_types/swimlane.ts | 8 ++++---- .../tests/actions/connector_types/thehive.ts | 4 ++-- .../tests/actions/sub_action_framework/index.ts | 2 +- 14 files changed, 55 insertions(+), 44 deletions(-) diff --git a/x-pack/plugins/actions/server/lib/action_executor.test.ts b/x-pack/plugins/actions/server/lib/action_executor.test.ts index 6e4ec1b69c876..76354dc882dd9 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.test.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.test.ts @@ -851,7 +851,7 @@ describe('Action Executor', () => { status: 'error', retry: false, message: `error validating action params: [param1]: expected value of type [string] but got [undefined]`, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts index a636f4b41566c..b0f9db0ef700c 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.ts @@ -685,6 +685,17 @@ function validateAction( try { validatedParams = validateParams(actionType, params, validatorServices); + } catch (err) { + throw new ActionExecutionError(err.message, ActionExecutionErrorReason.Validation, { + actionId, + status: 'error', + message: err.message, + retry: !!taskInfo, + errorSource: TaskErrorSource.USER, + }); + } + + try { validatedConfig = validateConfig(actionType, config, validatorServices); validatedSecrets = validateSecrets(actionType, secrets, validatorServices); if (actionType.validate?.connector) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/bedrock.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/bedrock.ts index 3bc7b665e2c2e..ca8ae72ee06ce 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/bedrock.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/bedrock.ts @@ -267,7 +267,7 @@ export default function bedrockTest({ getService }: FtrProviderContext) { message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); @@ -620,7 +620,7 @@ export default function bedrockTest({ getService }: FtrProviderContext) { expect(body).to.eql({ status: 'error', connector_id: bedrockActionId, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts index fcf0f2d84e755..72f726d18b0e1 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases_webhook.ts @@ -272,7 +272,7 @@ export default function casesWebhookTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: [subAction]: expected value to equal [pushToService]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -291,7 +291,7 @@ export default function casesWebhookTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: [subActionParams.incident.title]: expected value of type [string] but got [undefined]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -318,7 +318,7 @@ export default function casesWebhookTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: [subActionParams.incident.title]: expected value of type [string] but got [undefined]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -347,7 +347,7 @@ export default function casesWebhookTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: [subActionParams.comments]: types that failed validation:\n- [subActionParams.comments.0.0.commentId]: expected value of type [string] but got [undefined]\n- [subActionParams.comments.1]: expected value to equal [null]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -375,7 +375,7 @@ export default function casesWebhookTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: [subActionParams.comments]: types that failed validation:\n- [subActionParams.comments.0.0.comment]: expected value of type [string] but got [undefined]\n- [subActionParams.comments.1]: expected value to equal [null]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/d3security.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/d3security.ts index 72cea764d0165..17785ec704a55 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/d3security.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/d3security.ts @@ -183,7 +183,7 @@ export default function d3SecurityTest({ getService }: FtrProviderContext) { message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); @@ -311,7 +311,7 @@ export default function d3SecurityTest({ getService }: FtrProviderContext) { message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gemini.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gemini.ts index 8d235c15dc21c..469929591e448 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gemini.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/gemini.ts @@ -243,7 +243,7 @@ export default function geminiTest({ getService }: FtrProviderContext) { message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); @@ -378,7 +378,7 @@ export default function geminiTest({ getService }: FtrProviderContext) { message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts index d41f8f1fcad71..92c7f5aae4609 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/jira.ts @@ -262,7 +262,7 @@ export default function jiraTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subAction]: expected value to equal [pushToService]\n- [4.subAction]: expected value to equal [issueTypes]\n- [5.subAction]: expected value to equal [fieldsByIssueType]\n- [6.subAction]: expected value to equal [issues]\n- [7.subAction]: expected value to equal [issue]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -281,7 +281,7 @@ export default function jiraTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.incident.summary]: expected value of type [string] but got [undefined]\n- [4.subAction]: expected value to equal [issueTypes]\n- [5.subAction]: expected value to equal [fieldsByIssueType]\n- [6.subAction]: expected value to equal [issues]\n- [7.subAction]: expected value to equal [issue]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -308,7 +308,7 @@ export default function jiraTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.incident.summary]: expected value of type [string] but got [undefined]\n- [4.subAction]: expected value to equal [issueTypes]\n- [5.subAction]: expected value to equal [fieldsByIssueType]\n- [6.subAction]: expected value to equal [issues]\n- [7.subAction]: expected value to equal [issue]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -337,7 +337,7 @@ export default function jiraTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.comments]: types that failed validation:\n - [subActionParams.comments.0.0.commentId]: expected value of type [string] but got [undefined]\n - [subActionParams.comments.1]: expected value to equal [null]\n- [4.subAction]: expected value to equal [issueTypes]\n- [5.subAction]: expected value to equal [fieldsByIssueType]\n- [6.subAction]: expected value to equal [issues]\n- [7.subAction]: expected value to equal [issue]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -365,7 +365,7 @@ export default function jiraTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.comments]: types that failed validation:\n - [subActionParams.comments.0.0.comment]: expected value of type [string] but got [undefined]\n - [subActionParams.comments.1]: expected value to equal [null]\n- [4.subAction]: expected value to equal [issueTypes]\n- [5.subAction]: expected value to equal [fieldsByIssueType]\n- [6.subAction]: expected value to equal [issues]\n- [7.subAction]: expected value to equal [issue]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -394,7 +394,7 @@ export default function jiraTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.incident.labels]: types that failed validation:\n - [subActionParams.incident.labels.0.0]: The label label with spaces cannot contain spaces\n - [subActionParams.incident.labels.1]: expected value to equal [null]\n- [4.subAction]: expected value to equal [issueTypes]\n- [5.subAction]: expected value to equal [fieldsByIssueType]\n- [6.subAction]: expected value to equal [issues]\n- [7.subAction]: expected value to equal [issue]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -430,7 +430,7 @@ export default function jiraTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.incident.otherFields]: types that failed validation:\n - [subActionParams.incident.otherFields.0]: A maximum of 20 fields in otherFields can be defined at a time.\n - [subActionParams.incident.otherFields.1]: expected value to equal [null]\n- [4.subAction]: expected value to equal [issueTypes]\n- [5.subAction]: expected value to equal [fieldsByIssueType]\n- [6.subAction]: expected value to equal [issues]\n- [7.subAction]: expected value to equal [issue]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); @@ -461,7 +461,7 @@ export default function jiraTest({ getService }: FtrProviderContext) { retry: false, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.incident.otherFields]: types that failed validation:\n - [subActionParams.incident.otherFields.0.key("summary")]: The following properties cannot be defined inside otherFields: summary.\n - [subActionParams.incident.otherFields.1]: expected value to equal [null]\n- [4.subAction]: expected value to equal [issueTypes]\n- [5.subAction]: expected value to equal [fieldsByIssueType]\n- [6.subAction]: expected value to equal [issues]\n- [7.subAction]: expected value to equal [issue]', - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/openai.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/openai.ts index 8a47b6a882456..a7774618bcc5a 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/openai.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/openai.ts @@ -251,7 +251,7 @@ export default function genAiTest({ getService }: FtrProviderContext) { message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); @@ -483,7 +483,7 @@ export default function genAiTest({ getService }: FtrProviderContext) { message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts index c189580951495..09f6f14d4616b 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itom.ts @@ -440,7 +440,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [addEvent]\n- [1.subAction]: expected value to equal [getChoices]', }); @@ -459,7 +459,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [addEvent]\n- [1.subAction]: expected value to equal [getChoices]', }); @@ -482,7 +482,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [addEvent]\n- [1.subActionParams.fields]: expected value of type [array] but got [undefined]', }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts index 1f4f01db068d9..02e94e7548534 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_itsm.ts @@ -476,7 +476,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subAction]: expected value to equal [pushToService]\n- [4.subAction]: expected value to equal [getChoices]\n- [5.subAction]: expected value to equal [closeIncident]', }); @@ -495,7 +495,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.incident.short_description]: expected value of type [string] but got [undefined]\n- [4.subAction]: expected value to equal [getChoices]\n- [5.subAction]: expected value to equal [closeIncident]', }); @@ -519,7 +519,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.incident.short_description]: expected value of type [string] but got [undefined]\n- [4.subAction]: expected value to equal [getChoices]\n- [5.subAction]: expected value to equal [closeIncident]', }); @@ -547,7 +547,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.comments]: types that failed validation:\n - [subActionParams.comments.0.0.commentId]: expected value of type [string] but got [undefined]\n - [subActionParams.comments.1]: expected value to equal [null]\n- [4.subAction]: expected value to equal [getChoices]\n- [5.subAction]: expected value to equal [closeIncident]', }); @@ -575,7 +575,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.comments]: types that failed validation:\n - [subActionParams.comments.0.0.comment]: expected value of type [string] but got [undefined]\n - [subActionParams.comments.1]: expected value to equal [null]\n- [4.subAction]: expected value to equal [getChoices]\n- [5.subAction]: expected value to equal [closeIncident]', }); @@ -673,7 +673,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subAction]: expected value to equal [pushToService]\n- [4.subActionParams.fields]: expected value of type [array] but got [undefined]\n- [5.subAction]: expected value to equal [closeIncident]', }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts index 527ea53bbd1d5..713721063b40f 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/servicenow_sir.ts @@ -489,7 +489,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subAction]: expected value to equal [pushToService]\n- [4.subAction]: expected value to equal [getChoices]', }); @@ -508,7 +508,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.incident.short_description]: expected value of type [string] but got [undefined]\n- [4.subAction]: expected value to equal [getChoices]', }); @@ -532,7 +532,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.incident.short_description]: expected value of type [string] but got [undefined]\n- [4.subAction]: expected value to equal [getChoices]', }); @@ -560,7 +560,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.comments]: types that failed validation:\n - [subActionParams.comments.0.0.commentId]: expected value of type [string] but got [undefined]\n - [subActionParams.comments.1]: expected value to equal [null]\n- [4.subAction]: expected value to equal [getChoices]', }); @@ -588,7 +588,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subActionParams.comments]: types that failed validation:\n - [subActionParams.comments.0.0.comment]: expected value of type [string] but got [undefined]\n - [subActionParams.comments.1]: expected value to equal [null]\n- [4.subAction]: expected value to equal [getChoices]', }); @@ -686,7 +686,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: types that failed validation:\n- [0.subAction]: expected value to equal [getFields]\n- [1.subAction]: expected value to equal [getIncident]\n- [2.subAction]: expected value to equal [handshake]\n- [3.subAction]: expected value to equal [pushToService]\n- [4.subActionParams.fields]: expected value of type [array] but got [undefined]', }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts index 93c2e4bc973af..cd09cd453d3a5 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/swimlane.ts @@ -351,7 +351,7 @@ export default function swimlaneTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: [subAction]: expected value to equal [pushToService]', }); @@ -377,7 +377,7 @@ export default function swimlaneTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: [subActionParams]: expected a plain object value, but found [null] instead.', }); @@ -402,7 +402,7 @@ export default function swimlaneTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: [subActionParams.comments]: types that failed validation:\n- [subActionParams.comments.0.0.commentId]: expected value of type [string] but got [undefined]\n- [subActionParams.comments.1]: expected value to equal [null]', }); @@ -427,7 +427,7 @@ export default function swimlaneTest({ getService }: FtrProviderContext) { connector_id: simulatedActionId, status: 'error', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, message: 'error validating action params: [subActionParams.comments]: types that failed validation:\n- [subActionParams.comments.0.0.comment]: expected value of type [string] but got [undefined]\n- [subActionParams.comments.1]: expected value to equal [null]', }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/thehive.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/thehive.ts index e1bf048606bc1..a6bd8531327fc 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/thehive.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/thehive.ts @@ -201,7 +201,7 @@ export default function theHiveTest({ getService }: FtrProviderContext) { message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); @@ -320,7 +320,7 @@ export default function theHiveTest({ getService }: FtrProviderContext) { message: 'error validating action params: [subAction]: expected value of type [string] but got [undefined]', retry: false, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); }); }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/sub_action_framework/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/sub_action_framework/index.ts index b504f8204c4aa..6f5e51845f667 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/sub_action_framework/index.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/sub_action_framework/index.ts @@ -218,7 +218,7 @@ export default function createActionTests({ getService }: FtrProviderContext) { status: 'error', retry: false, connector_id: res.body.id, - errorSource: TaskErrorSource.FRAMEWORK, + errorSource: TaskErrorSource.USER, }); } });