MCPcopy Create free account
hub / github.com/dataform-co/dataform / validateIcebergConfigBucketName

Function validateIcebergConfigBucketName

cli/util.ts:156–171  ·  view source on GitHub ↗
(bucketName: string)

Source from the content-addressed store, hash-verified

154 * - Cannot contain "google" or close misspellings such as "g00gle".
155 */
156export function validateIcebergConfigBucketName(bucketName: string): void {
157 if (bucketName.length < 3 || bucketName.length > 63) {
158 throw new Error("Bucket name must be between 3 and 63 characters long.");
159 }
160 if (!/^[a-z0-9][a-z0-9-._]{1,220}[a-z0-9]$/.test(bucketName) || bucketName.includes("..")) {
161 throw new Error(
162 "Invalid bucket name. Must start and end with a letter or number, contain only lowercase letters, numbers, hyphens (-), underscores (_), and periods (.)."
163 );
164 }
165 if (bucketName.startsWith("goog") || bucketName.includes("--")) {
166 throw new Error("Bucket name cannot start with 'goog' or contain '--'.");
167 }
168 if(bucketName.includes("google") || bucketName.includes("g00gle")) {
169 throw new Error("Bucket name cannot contain 'google' or close misspellings such as 'g00gle'.");
170 }
171}
172
173/**
174 * Validates a string to ensure it is a valid table folder root for an Iceberg

Callers 2

util_test.tsFile · 0.90
promptForIcebergConfigFunction · 0.85

Calls 1

testMethod · 0.80

Tested by

no test coverage detected