| 12 | const GOOGLE_RESERVED_PREFIX_RE = /^(goog|google|g00gle)/i |
| 13 | const GOOGLE_CONTAINS_RE = /(google|g00gle)/i |
| 14 | function validateGcsBucketComponents(v: string): string | null { |
| 15 | if (v.length < 3 || v.length > 222) return 'bucket must be 3-222 characters' |
| 16 | const components = v.split('.') |
| 17 | for (const c of components) { |
| 18 | if (c.length < 1 || c.length > 63) { |
| 19 | return 'each dot-separated component must be 1-63 characters' |
| 20 | } |
| 21 | if (!GCS_BUCKET_COMPONENT_RE.test(c)) { |
| 22 | return 'each component must be lowercase, start/end alphanumeric, letters/digits/_/- only' |
| 23 | } |
| 24 | } |
| 25 | return null |
| 26 | } |
| 27 | /** Azure storage account: 3-24 lowercase alnum. */ |
| 28 | const AZURE_ACCOUNT_NAME_RE = /^[a-z0-9]{3,24}$/ |
| 29 | /** Azure container: 3-63 chars, lowercase alnum + single hyphens. */ |