diff --git a/src/schemas/registry.ts b/src/schemas/registry.ts index 14eedb9..a7d749a 100644 --- a/src/schemas/registry.ts +++ b/src/schemas/registry.ts @@ -14,6 +14,8 @@ export interface FieldDef { placeholder?: string; helpText?: string; options?: { value: string; label: string }[]; // for inputType: 'select' + validate?: { regex: RegExp; message: string }; + tooltipText?: string; } export const BACKEND_REGISTRY = { @@ -28,6 +30,10 @@ export const BACKEND_REGISTRY = { required: true, placeholder: 'mystorageaccount', helpText: 'The storage account name (not the full URL)', + validate: { + regex: /^[a-z0-9]{3,24}$/, + message: 'Must be 3–24 lowercase alphanumeric characters (no hyphens or uppercase)', + }, }, { key: 'key', @@ -76,6 +82,10 @@ export const BACKEND_REGISTRY = { inputType: 'text', required: true, placeholder: 'us-east-1', + validate: { + regex: /^[a-z][a-z0-9-]+[a-z0-9]$/, + message: 'Must be a valid AWS region format (e.g. us-east-1)', + }, }, ], }, @@ -166,6 +176,10 @@ export const BACKEND_REGISTRY = { required: true, placeholder: '123456789', helpText: 'Your GCP project number (not project ID)', + validate: { + regex: /^\d+$/, + message: 'Must contain digits only', + }, }, { key: 'service_account_credentials',