[8.x] Not allow # in index template name (#195776) (#196485)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Not allow # in index template name
(#195776)](https://github.com/elastic/kibana/pull/195776)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Sonia Sanz
Vivas","email":"sonia.sanzvivas@elastic.co"},"sourceCommit":{"committedDate":"2024-10-16T07:16:36Z","message":"Not
allow # in index template name (#195776)\n\nCloses
[#81870](https://github.com/elastic/kibana/issues/81870)\r\n\r\n##
Summary\r\n\r\nWhen creating a new Template, it did not prevent entering
a #, but when\r\nsaving the template the user received an error. The
hash has been added\r\nto the list of invalid characters for the
name.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/2b59d245-c96f-4215-ad89-a3201bef5e94","sha":"4339f8465720c507351a2e65a6fe881a10dcd938","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Index
Management","Team:Kibana
Management","release_note:skip","v9.0.0","backport:prev-minor","v8.16.0"],"title":"Not
allow # in index template
name","number":195776,"url":"https://github.com/elastic/kibana/pull/195776","mergeCommit":{"message":"Not
allow # in index template name (#195776)\n\nCloses
[#81870](https://github.com/elastic/kibana/issues/81870)\r\n\r\n##
Summary\r\n\r\nWhen creating a new Template, it did not prevent entering
a #, but when\r\nsaving the template the user received an error. The
hash has been added\r\nto the list of invalid characters for the
name.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/2b59d245-c96f-4215-ad89-a3201bef5e94","sha":"4339f8465720c507351a2e65a6fe881a10dcd938"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195776","number":195776,"mergeCommit":{"message":"Not
allow # in index template name (#195776)\n\nCloses
[#81870](https://github.com/elastic/kibana/issues/81870)\r\n\r\n##
Summary\r\n\r\nWhen creating a new Template, it did not prevent entering
a #, but when\r\nsaving the template the user received an error. The
hash has been added\r\nto the list of invalid characters for the
name.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/2b59d245-c96f-4215-ad89-a3201bef5e94","sha":"4339f8465720c507351a2e65a6fe881a10dcd938"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
This commit is contained in:
Kibana Machine 2024-10-16 22:47:07 +11:00 committed by GitHub
parent 5c6d9038d8
commit e061949488
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,4 +7,4 @@
export const INVALID_INDEX_PATTERN_CHARS = ['\\', '/', '?', '"', '<', '>', '|'];
export const INVALID_TEMPLATE_NAME_CHARS = ['"', '*', '\\', ',', '?'];
export const INVALID_TEMPLATE_NAME_CHARS = ['"', '*', '\\', ',', '?', '#'];