Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

UN-3318 [FIX] Allow apostrophes in Platform API Key name and description (#1994)

Chandrasekharan M1a67ad4971f6
diff --git a/backend/platform_api/serializers.py b/backend/platform_api/serializers.py
index 132e4feaa..7962e7572 100644
--- a/backend/platform_api/serializers.py
+++ b/backend/platform_api/serializers.py
@@ -7,11 +7,12 @@ from backend.serializers import AuditSerializer
from platform_api.models import PlatformApiKey
# Alphanumeric, spaces, hyphens, underscores, periods, commas, colons,
-# parentheses, forward slashes. No HTML tags or angle brackets.
-SAFE_TEXT_PATTERN = re.compile(r"^[a-zA-Z0-9 \-_.,:()/]+$")
+# apostrophes, parentheses, forward slashes. No HTML tags or angle brackets.
+SAFE_TEXT_PATTERN = re.compile(r"^[a-zA-Z0-9 \-_.,:'()/]+$")
SAFE_TEXT_ERROR = (
"Only alphanumeric characters, spaces, hyphens, underscores, "
- "periods, commas, colons, parentheses, and forward slashes are allowed."
+ "periods, commas, colons, apostrophes, parentheses, and forward slashes "
+ "are allowed."
)
diff --git a/frontend/src/components/settings/platform-api-keys/PlatformApiKeys.jsx b/frontend/src/components/settings/platform-api-keys/PlatformApiKeys.jsx
index b3a481153..d578d12f6 100644
--- a/frontend/src/components/settings/platform-api-keys/PlatformApiKeys.jsx
+++ b/frontend/src/components/settings/platform-api-keys/PlatformApiKeys.jsx
@@ -32,9 +32,9 @@ import { SettingsLayout } from "../settings-layout/SettingsLayout.jsx";
import "../platform/PlatformSettings.css";
import "./PlatformApiKeys.css";
-const SAFE_TEXT_REGEX = /^[a-zA-Z0-9 \-_.,:()/]+$/;
+const SAFE_TEXT_REGEX = /^[a-zA-Z0-9 \-_.,:'()/]+$/;
const SAFE_TEXT_MESSAGE =
- "Only alphanumeric characters, spaces, hyphens, underscores, periods, commas, colons, parentheses, and forward slashes are allowed.";
+ "Only alphanumeric characters, spaces, hyphens, underscores, periods, commas, colons, apostrophes, parentheses, and forward slashes are allowed.";
const PERMISSION_OPTIONS = [
{ value: "read_write", label: "Read/Write", color: "blue" },