diff --git a/packages/actor-core/src/common/utils.ts b/packages/actor-core/src/common/utils.ts index 65103947a..40bb69603 100644 --- a/packages/actor-core/src/common/utils.ts +++ b/packages/actor-core/src/common/utils.ts @@ -3,7 +3,12 @@ import type { ContentfulStatusCode } from "hono/utils/http-status"; import * as errors from "@/actor/errors"; import type { Logger } from "./log"; -export const ActorKeySchema = z.array(z.string()); +// Maximum size of a key component in bytes +// Set to 128 bytes to allow for separators and escape characters in the full key +// Cloudflare's maximum key size is 512 bytes, so we need to be significantly smaller +export const MAX_KEY_SIZE = 128; + +export const ActorKeySchema = z.array(z.string().max(MAX_KEY_SIZE)); export type ActorKey = z.infer;