MCPcopy Index your code
hub / github.com/simstudioai/sim / validateGcsBucketComponents

Function validateGcsBucketComponents

apps/sim/lib/api/contracts/data-drains.ts:14–26  ·  view source on GitHub ↗
(v: string)

Source from the content-addressed store, hash-verified

12const GOOGLE_RESERVED_PREFIX_RE = /^(goog|google|g00gle)/i
13const GOOGLE_CONTAINS_RE = /(google|g00gle)/i
14function 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. */
28const AZURE_ACCOUNT_NAME_RE = /^[a-z0-9]{3,24}$/
29/** Azure container: 3-63 chars, lowercase alnum + single hyphens. */

Callers 1

data-drains.tsFile · 0.70

Calls 1

testMethod · 0.80

Tested by

no test coverage detected