Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-5451 adjust regex #2824

Merged
merged 9 commits into from
Aug 13, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ public void deleteResource(@NotNull String projectId, @NotNull String resourcePa
if (log.isDebugEnabled()) {
log.debug("Removing resource from '" + resourcePath + "' in project '" + projectId + "'" + (recursive ? " recursive" : ""));
}
validateResourcePath(resourcePath);
Path targetPath = getTargetPath(projectId, resourcePath);
doFileWriteOperation(projectId, targetPath, () -> {
if (!Files.exists(targetPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface IConnectionFolderParam {
folderId: string;
}

export const CONNECTION_FOLDER_NAME_VALIDATION = /^(?!\.)[^\\/:\\"]+$/u;
export const CONNECTION_FOLDER_NAME_VALIDATION = /^(?!\.)[^\\/:\\"'<>|?*]+$/u;

export const ConnectionFolderProjectKey = resourceKeyAliasFactory('@connection-folder/project', (projectId: string) => ({ projectId }));

Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-connections/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default [
['connections_connection_edit_search_hosts', 'Host names'],
['connections_connection_address', 'Address'],
['connections_connection_folder', 'Folder'],
['connections_connection_folder_validation', "Folder's name may not contain the following symbols / : \" \\ and can't start with a dot"],
['connections_connection_folder_validation', "Folder's name may not contain the following symbols / : \" \\ ' <> | ? * and can't start with a dot"],
['connections_connection_name', 'Connection name'],
['connections_connection_access_user_or_team_name', 'User or Team name'],
['connections_connection_access_filter_placeholder', 'Search for user or team name'],
Expand Down
7 changes: 5 additions & 2 deletions webapp/packages/core-connections/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ export default [
['connections_connection_folder', 'Dossier'],
[
'connections_connection_folder_validation',
'Le nom du dossier ne peut pas contenir les symboles suivants : / : " \\ et ne peut pas commencer par un point',
'Le nom du dossier ne peut pas contenir les symboles suivants / : " \\ \' <> | ? * et ne peut pas commencer par un point',
],
['connections_connection_name', 'Nom de la connexion'],
['connections_connection_access_user_or_team_name', "Nom de l'utilisateur ou de l'équipe"],
['connections_connection_access_filter_placeholder', "Rechercher un nom d'utilisateur ou d'équipe"],
['connections_connection_access_admin_info', "Les administrateurs voient toutes les connexions à l'exception des connexions privées des autres utilisateurs."],
[
'connections_connection_access_admin_info',
"Les administrateurs voient toutes les connexions à l'exception des connexions privées des autres utilisateurs.",
],
['connections_connection_description', 'Description'],
['connections_connection_project', 'Projet'],
['connections_connection_driver', 'Pilote'],
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-connections/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default [
['connections_connection_edit_search_hosts', 'Host names'],
['connections_connection_address', 'Indirizzo'],
['connections_connection_folder', 'Folder'],
['connections_connection_folder_validation', "Folder's name may not contain the following symbols / : \" \\ and can't start with a dot"],
['connections_connection_folder_validation', "Folder's name may not contain the following symbols / : \" \\ ' <> | ? * and can't start with a dot"],
['connections_connection_name', 'Nome della connessione'],
['connections_connection_access_revoke', 'Revoca'],
['connections_connection_access_grant', 'Permetti'],
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-connections/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default [
['connections_connection_edit_search_hosts', 'Названия хостов'],
['connections_connection_address', 'Адрес'],
['connections_connection_folder', 'Папка'],
['connections_connection_folder_validation', 'Имя папки не может содержать следующие символы / : " \\ и не может начинаться с точки'],
['connections_connection_folder_validation', 'Имя папки не может содержать следующие символы / : " \\ \' <> | ? * и не может начинаться с точки'],
['connections_connection_name', 'Название подключения'],
['connections_connection_access_user_or_team_name', 'Имя пользователя или команды'],
['connections_connection_access_filter_placeholder', 'Поиск по имени пользователя или команде'],
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-connections/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
['connections_connection_edit_search_hosts', '主机名称'],
['connections_connection_address', '地址'],
['connections_connection_folder', 'Folder'],
['connections_connection_folder_validation', "Folder's name may not contain the following symbols / : \" \\ and can't start with a dot"],
['connections_connection_folder_validation', "Folder's name may not contain the following symbols / : \" \\ ' <> | ? * and can't start with a dot"],
['connections_connection_name', '连接名称'],
['connections_connection_access_admin_info', 'Administrators see all connections except private connections of other users.'],
['connections_connection_description', '描述'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export default [
['plugin_resource_manager_scripts_action_enable_label', 'Show scripts'],
['plugin_resource_manager_scripts_title', 'Scripts'],
['plugin_resource_manager_scripts_no_resources_placeholder', 'There are no scripts yet'],
['plugin_resource_manager_scripts_save_script', 'Save script'],
[
'plugin_resource_manager_scripts_script_name_invalid_characters_message',
"Script's name may not contain the following symbols / : \" \\ and can't start with a dot",
"Script's name may not contain the following symbols / : \" \\ ' <> | ? * and can't start with a dot",
],
[
'plugin_resource_manager_scripts_save_script_project_restriction_descripion',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default [
['plugin_resource_manager_scripts_save_script', 'Enregistrer le script'],
[
'plugin_resource_manager_scripts_script_name_invalid_characters_message',
'Le nom du script ne peut pas contenir les symboles suivants : / \\ \\ et ne peut pas commencer par un point',
'Le nom du script ne peut pas contenir les symboles suivants / : " \\ \' <> | ? * et ne peut pas commencer par un point',
],
[
'plugin_resource_manager_scripts_save_script_project_restriction_description',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export default [
['plugin_resource_manager_scripts_action_enable_label', 'Show scripts'],
['plugin_resource_manager_scripts_title', 'Scripts'],
['plugin_resource_manager_scripts_no_resources_placeholder', 'There are no scripts yet'],
['plugin_resource_manager_scripts_save_script', 'Save script'],
[
'plugin_resource_manager_scripts_script_name_invalid_characters_message',
"Script's name may not contain the following symbols / : \" \\ and can't start with a dot",
"Script's name may not contain the following symbols / : \" \\ ' <> | ? * and can't start with a dot",
],
[
'plugin_resource_manager_scripts_save_script_project_restriction_descripion',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export default [
['plugin_resource_manager_scripts_action_enable_label', 'Показывать скрипты'],
['plugin_resource_manager_scripts_title', 'Скрипты'],
['plugin_resource_manager_scripts_no_resources_placeholder', 'Скриптов нет'],
['plugin_resource_manager_scripts_save_script', 'Сохранить скрипт'],
[
'plugin_resource_manager_scripts_script_name_invalid_characters_message',
'Имя скрипта не может содержать следующие символы / : " \\ и не может начинаться с точки',
'Имя скрипта не может содержать следующие символы / : " \\ \' <> | ? * и не может начинаться с точки',
],
['plugin_resource_manager_scripts_save_script_project_restriction_descripion', 'Проект скрипта не может отличаться от проекта подключения'],
];
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export default [
['plugin_resource_manager_scripts_action_enable_label', 'Show scripts'],
['plugin_resource_manager_scripts_title', 'Scripts'],
['plugin_resource_manager_scripts_no_resources_placeholder', 'There are no scripts yet'],
['plugin_resource_manager_scripts_save_script', '保存脚本'],
[
'plugin_resource_manager_scripts_script_name_invalid_characters_message',
"Script's name may not contain the following symbols / : \" \\ and can't start with a dot",
"Script's name may not contain the following symbols / : \" \\ ' <> | ? * and can't start with a dot",
],
[
'plugin_resource_manager_scripts_save_script_project_restriction_descripion',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* you may not use this file except in compliance with the License.
*/

export const RESOURCE_NAME_REGEX = /^(?!\.)[^\\/:\\"]+$/u;
export const RESOURCE_NAME_REGEX = /^(?!\.)[^\\/:\\"'<>|?*]+$/u;
Loading