|
@@ -169,6 +169,24 @@ def create_task():
|
|
|
details={"missing_fields": missing_metadata}
|
|
details={"missing_fields": missing_metadata}
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+ # Validate clientName and projectName don't contain invalid filename characters
|
|
|
|
|
+ import re
|
|
|
|
|
+ invalid_chars_pattern = r'[<>\/\\|*:?"]'
|
|
|
|
|
+ client_name = project_metadata.get('clientName', '')
|
|
|
|
|
+ project_name = project_metadata.get('projectName', '')
|
|
|
|
|
+
|
|
|
|
|
+ if re.search(invalid_chars_pattern, client_name):
|
|
|
|
|
+ raise ValidationError(
|
|
|
|
|
+ message="Client name contains invalid characters",
|
|
|
|
|
+ details={"field": "clientName", "reason": "Cannot contain < > / \\ | * : ? \""}
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ if re.search(invalid_chars_pattern, project_name):
|
|
|
|
|
+ raise ValidationError(
|
|
|
|
|
+ message="Project name contains invalid characters",
|
|
|
|
|
+ details={"field": "projectName", "reason": "Cannot contain < > / \\ | * : ? \""}
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
# Validate credential access for regular users
|
|
# Validate credential access for regular users
|
|
|
for cred_id in credential_ids:
|
|
for cred_id in credential_ids:
|
|
|
if not check_credential_access(current_user, cred_id):
|
|
if not check_credential_access(current_user, cred_id):
|