Skip to content

Add max character validation to the email connector params and config#246453

Merged
ersin-erdal merged 10 commits intoelastic:mainfrom
ersin-erdal:Email-connector-params-validation
Dec 30, 2025
Merged

Add max character validation to the email connector params and config#246453
ersin-erdal merged 10 commits intoelastic:mainfrom
ersin-erdal:Email-connector-params-validation

Conversation

@ersin-erdal
Copy link
Contributor

@ersin-erdal ersin-erdal commented Dec 15, 2025

This PR adds length validation to the email params to prevent crushing errors.

@ersin-erdal ersin-erdal added release_note:fix Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// backport:all-open Backport to all branches that could still receive a release labels Dec 15, 2025
@ersin-erdal ersin-erdal marked this pull request as ready for review December 16, 2025 17:34
@ersin-erdal ersin-erdal requested a review from a team as a code owner December 16, 2025 17:34
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)


function validateParams(paramsObject: unknown, validatorServices: ValidatorServices) {
const { configurationUtilities } = validatorServices;
const emailValidator = z.array(z.string().max(512)).max(100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we reuse emailSchema from kbn-connector-schemas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't use them intentionally since they are versioned schema.
We can use it from the latest version but a new version would affect here too.
Should we?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ok to use the latest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ersin-erdal ersin-erdal merged commit 0621884 into elastic:main Dec 30, 2025
13 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/20595332475

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 30, 2025
…elastic#246453)

This PR adds length validation to the email params to prevent crushing
errors.

---------

Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
(cherry picked from commit 0621884)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts
9.1 Backport failed because of merge conflicts
9.2 Backport failed because of merge conflicts
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 246453

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 30, 2025
…config (#246453) (#247600)

# Backport

This will backport the following commits from `main` to `9.3`:
- [Add max character validation to the email connector params and config
(#246453)](#246453)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Ersin
Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-12-30T11:18:55Z","message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","backport:all-open","v9.4.0"],"title":"Add
max character validation to the email connector params and
config","number":246453,"url":"https://github.com/elastic/kibana/pull/246453","mergeCommit":{"message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/246453","number":246453,"mergeCommit":{"message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982"}}]}]
BACKPORT-->

Co-authored-by: Ersin Erdal <92688503+ersin-erdal@users.noreply.github.com>
Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
ersin-erdal added a commit to ersin-erdal/kibana that referenced this pull request Dec 30, 2025
…elastic#246453)

This PR adds length validation to the email params to prevent crushing
errors.

---------

Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
(cherry picked from commit 0621884)

# Conflicts:
#	src/platform/packages/shared/kbn-connector-schemas/email/schemas/v1.ts
#	x-pack/platform/plugins/shared/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap
ersin-erdal added a commit to ersin-erdal/kibana that referenced this pull request Dec 30, 2025
…elastic#246453)

This PR adds length validation to the email params to prevent crushing
errors.

---------

Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
(cherry picked from commit 0621884)

# Conflicts:
#	src/platform/packages/shared/kbn-connector-schemas/email/schemas/v1.ts
#	x-pack/platform/plugins/shared/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap
@ersin-erdal
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.2
9.1
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

ersin-erdal added a commit to ersin-erdal/kibana that referenced this pull request Dec 30, 2025
…elastic#246453)

This PR adds length validation to the email params to prevent crushing
errors.

---------

Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
(cherry picked from commit 0621884)

# Conflicts:
#	src/platform/packages/shared/kbn-connector-schemas/email/schemas/v1.ts
#	x-pack/platform/plugins/shared/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap
ersin-erdal added a commit that referenced this pull request Dec 31, 2025
… config (#246453) (#247642)

# Backport

This will backport the following commits from `main` to `8.19`:
- [Add max character validation to the email connector params and config
(#246453)](#246453)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Ersin
Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-12-30T11:18:55Z","message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","backport:all-open","v9.3.0","v9.4.0"],"title":"Add
max character validation to the email connector params and
config","number":246453,"url":"https://github.com/elastic/kibana/pull/246453","mergeCommit":{"message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/247600","number":247600,"state":"MERGED","mergeCommit":{"sha":"c5d5d8697c5d6d5ddd214c2deab73d7f7404659e","message":"[9.3]
Add max character validation to the email connector params and config
(#246453) (#247600)\n\n# Backport\n\nThis will backport the following
commits from `main` to `9.3`:\n- [Add max character validation to the
email connector params and
config\n(#246453)](https://github.com/elastic/kibana/pull/246453)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Ersin Erdal
<92688503+ersin-erdal@users.noreply.github.com>\nCo-authored-by: Jeramy
Soucy
<jeramy.soucy@elastic.co>"}},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/246453","number":246453,"mergeCommit":{"message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982"}}]}]
BACKPORT-->
ersin-erdal added a commit that referenced this pull request Dec 31, 2025
…config (#246453) (#247640)

# Backport

This will backport the following commits from `main` to `9.1`:
- [Add max character validation to the email connector params and config
(#246453)](#246453)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Ersin
Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-12-30T11:18:55Z","message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","backport:all-open","v9.3.0","v9.4.0"],"title":"Add
max character validation to the email connector params and
config","number":246453,"url":"https://github.com/elastic/kibana/pull/246453","mergeCommit":{"message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/247600","number":247600,"state":"MERGED","mergeCommit":{"sha":"c5d5d8697c5d6d5ddd214c2deab73d7f7404659e","message":"[9.3]
Add max character validation to the email connector params and config
(#246453) (#247600)\n\n# Backport\n\nThis will backport the following
commits from `main` to `9.3`:\n- [Add max character validation to the
email connector params and
config\n(#246453)](https://github.com/elastic/kibana/pull/246453)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Ersin Erdal
<92688503+ersin-erdal@users.noreply.github.com>\nCo-authored-by: Jeramy
Soucy
<jeramy.soucy@elastic.co>"}},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/246453","number":246453,"mergeCommit":{"message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982"}}]}]
BACKPORT-->
ersin-erdal added a commit that referenced this pull request Dec 31, 2025
…config (#246453) (#247637)

# Backport

This will backport the following commits from `main` to `9.2`:
- [Add max character validation to the email connector params and config
(#246453)](#246453)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Ersin
Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-12-30T11:18:55Z","message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","backport:all-open","v9.3.0","v9.4.0"],"title":"Add
max character validation to the email connector params and
config","number":246453,"url":"https://github.com/elastic/kibana/pull/246453","mergeCommit":{"message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/247600","number":247600,"state":"MERGED","mergeCommit":{"sha":"c5d5d8697c5d6d5ddd214c2deab73d7f7404659e","message":"[9.3]
Add max character validation to the email connector params and config
(#246453) (#247600)\n\n# Backport\n\nThis will backport the following
commits from `main` to `9.3`:\n- [Add max character validation to the
email connector params and
config\n(#246453)](https://github.com/elastic/kibana/pull/246453)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Ersin Erdal
<92688503+ersin-erdal@users.noreply.github.com>\nCo-authored-by: Jeramy
Soucy
<jeramy.soucy@elastic.co>"}},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/246453","number":246453,"mergeCommit":{"message":"Add
max character validation to the email connector params and config
(#246453)\n\nThis PR adds length validation to the email params to
prevent crushing\nerrors.\n\n---------\n\nCo-authored-by: Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"06218847e4528caf724a541d9443c02339001982"}}]}]
BACKPORT-->
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Jan 6, 2026
…elastic#246453)

This PR adds length validation to the email params to prevent crushing
errors.

---------

Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
walterra pushed a commit to walterra/kibana that referenced this pull request Jan 7, 2026
…elastic#246453)

This PR adds length validation to the email params to prevent crushing
errors.

---------

Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
dej611 pushed a commit to dej611/kibana that referenced this pull request Jan 8, 2026
…elastic#246453)

This PR adds length validation to the email params to prevent crushing
errors.

---------

Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release release_note:fix Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.10 v9.1.10 v9.2.4 v9.3.0 v9.4.0

5 participants