This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch
3677-name-validation-too-restrictive-after-change
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to
refs/heads/3677-name-validation-too-restrictive-after-change by this push:
new d49d3913dd fix(#3677): enhance input validation for pipeline and
adapter names
d49d3913dd is described below
commit d49d3913dd9e285fb543d793f83f3029bd343308
Author: Philipp Zehnder <[email protected]>
AuthorDate: Tue Jun 17 11:15:14 2025 +0200
fix(#3677): enhance input validation for pipeline and adapter names
---
.../start-adapter-configuration.component.html | 14 ++++++++++++--
ui/src/app/core-ui/static-properties/input.validator.ts | 9 ++++++++-
.../save-pipeline-settings.component.html | 9 +++++++++
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git
a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
index a80c40f3aa..51eb898ec5 100644
---
a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
+++
b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
@@ -40,8 +40,18 @@
.hasError('invalidName')
"
>
- Name can only contain letters, numbers, dashes (-), and
- underscores (_).
+ Name can only contain letters, numbers, special
+ characters (including umlauts), punctuation, symbols,
+ and spaces.
+ </mat-error>
+ <mat-error
+ *ngIf="
+ startAdapterForm
+ .get('adapterName')
+ .hasError('leadingOrTrailingWhitespace')
+ "
+ >
+ Name cannot start or end with a space.
</mat-error>
<mat-error
*ngIf="
diff --git a/ui/src/app/core-ui/static-properties/input.validator.ts
b/ui/src/app/core-ui/static-properties/input.validator.ts
index 91e30b8744..c15770c28e 100644
--- a/ui/src/app/core-ui/static-properties/input.validator.ts
+++ b/ui/src/app/core-ui/static-properties/input.validator.ts
@@ -79,7 +79,14 @@ export function ValidateName(): ValidatorFn {
return { whiteSpaceOnly: { value } };
}
- const regex = /^[a-zA-Z0-9 _-]+$/;
+ // value starts or ends with whitespace
+ if (/^\s|\s$/.test(value)) {
+ return { leadingOrTrailingWhitespace: { value } };
+ }
+
+ // Matches strings containing only Unicode letters, numbers,
+ // punctuation, symbols, and whitespace (including spaces)
+ const regex = /^[\p{L}\p{N}\p{P}\p{S}\s]+$/u;
const valid = regex.test(trimmed);
return valid ? null : { invalidName: { value } };
diff --git
a/ui/src/app/editor/dialog/save-pipeline/save-pipeline-settings/save-pipeline-settings.component.html
b/ui/src/app/editor/dialog/save-pipeline/save-pipeline-settings/save-pipeline-settings.component.html
index c0aab9497d..320ff93ad3 100644
---
a/ui/src/app/editor/dialog/save-pipeline/save-pipeline-settings/save-pipeline-settings.component.html
+++
b/ui/src/app/editor/dialog/save-pipeline/save-pipeline-settings/save-pipeline-settings.component.html
@@ -40,6 +40,15 @@
>
Pipeline name is required.
</mat-error>
+ <mat-error
+ *ngIf="
+ submitPipelineForm
+ .get('pipelineName')
+ .hasError('leadingOrTrailingWhitespace')
+ "
+ >
+ Pipeline name cannot start or end with a space.
+ </mat-error>
<mat-error
*ngIf="
submitPipelineForm