forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serverless] Add role name validation to prevent white spaces in serv…
…erless custom roles (elastic#191894) Closes elastic#191049 ### Summary Enforces strict role name validation in serverless offering. In addition to enforcing no whitespace, we will restrict role names to only contain alphanumeric characters, dots, hyphens, and underscores. Additionally, validation will restrict the leading character to only alphanumeric characters. ### Notes - Added a new regular expression for checking the name to only have letters, numbers and trailing dots, underscores or hyphens. - Added a separate check in the role name validation to check if Kibana is running in serverless mode, and if the name matches the new serverless regular expression. - To prevent any breaking changes, this validation only takes place on Save (as it does in stateful) and not on blur (which is a separate validation to run against any existing role names) Examples - _rolename: invalid - role name: invalid - role<>name: invalid - role_name: valid - 123role_name-123: valid ### Screenshots <img width="557" alt="image" src="https://github.com/user-attachments/assets/dba96205-25e5-46e6-aa81-55b8f0952270"> --------- Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
3c4e502
commit b9c526a
Showing
10 changed files
with
119 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
2 changes: 2 additions & 0 deletions
2
...gement/roles/edit_role/privileges/es/__snapshots__/elasticsearch_privileges.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...lic/management/roles/edit_role/privileges/es/__snapshots__/index_privileges.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...ement/roles/edit_role/privileges/es/__snapshots__/remote_cluster_privileges.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
1 change: 1 addition & 0 deletions
1
...nt/roles/edit_role/privileges/kibana/__snapshots__/kibana_privileges_region.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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