Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
refactor(secret-sync): remove cloudflare workers plaintext and json toggle
DimitrisStaratzis9fc49fe79dba
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex b7371d31a6..22cab7efb3 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -3316,10 +3316,6 @@ export const SecretSyncs = {disableCertificateImport:"Whether Infisical should skip importing certificate objects from Azure Key Vault when syncing secrets."},- CLOUDFLARE_WORKERS: {- syncNonSecretBindings:- "Whether Infisical should also sync plaintext and JSON variable bindings in addition to secret bindings. Only applies when variableType is secret_text or omitted."- },SPACELIFT: {writeOnly:"Whether secrets should be marked as secret in Spacelift. Secret values are only available to Runs and Tasks and are not accessible in the web GUI or through the API."@@ -3509,7 +3505,7 @@ export const SecretSyncs = {CLOUDFLARE_WORKERS: {scriptId: "The ID of the Cloudflare Workers script to sync secrets to.",variableType:- "The type of variable to sync secrets as: secret_text (the default for new syncs), plain_text or json. Infisical converts a secret or variable of the same name to this type, except that with syncNonSecretBindings on, existing plaintext and JSON variables keep their type. Infisical only deletes variables of this type. Syncs created before this option existed have no type and skip keys that already exist as plaintext or JSON variables."+ "The type of variable to sync secrets as: secret_text (default), plain_text or json. Infisical converts a secret or variable of the same name to this type and only deletes variables of this type."},CLOUDFLARE_SECRETS_STORE: {storeId: "The ID of the Cloudflare Secrets Store to sync secrets to.",diff --git a/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-fns.test.ts b/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-fns.test.tsindex e0f6ff4782..c19b219be2 100644--- a/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-fns.test.ts+++ b/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-fns.test.ts@@ -95,31 +95,29 @@ describe("CloudflareWorkersSyncFns", () => {expect(patch).not.toHaveBeenCalled();});- it("converts a same-name text variable into a secret when Secret is chosen", async () => {- stubWorker([- { type: "plain_text", name: "API_URL", text: "old" },- { type: "kv_namespace", name: "CACHE" }- ]);-- await CloudflareWorkersSyncFns.syncSecrets(- syncWith(CloudflareWorkersVariableType.Secret),- payloadOf({ API_URL: "new" })- );-- expect(patch).toHaveBeenCalledTimes(1);- expect(await patchedBindings()).toEqual([- { type: "secret_text", name: "API_URL", text: "new" },- { type: "kv_namespace", name: "CACHE" }- ]);- });-- it("keeps skipping same-name text variables for syncs saved without a type", async () => {- stubWorker([{ type: "plain_text", name: "API_URL", text: "old" }]);-- await CloudflareWorkersSyncFns.syncSecrets(syncWith(), payloadOf({ API_URL: "new" }));-- expect(patch).not.toHaveBeenCalled();- });+ it.each([CloudflareWorkersVariableType.Secret, undefined])(+ "with type %s, converts a same-name text variable into a secret and leaves other text variables alone",+ async (variableType) => {+ stubWorker([+ { type: "plain_text", name: "API_URL", text: "old" },+ { type: "plain_text", name: "OTHER", text: "keep" },+ { type: "kv_namespace", name: "CACHE" }+ ]);++ await CloudflareWorkersSyncFns.syncSecrets(syncWith(variableType), payloadOf({ API_URL: "new", NEW_KEY: "v" }));++ expect(patch).toHaveBeenCalledTimes(2);+ expect(await patchedBindings()).toEqual([+ { type: "secret_text", name: "API_URL", text: "new" },+ { type: "plain_text", name: "OTHER", text: "keep" },+ { type: "kv_namespace", name: "CACHE" }+ ]);+ expect(patch.mock.calls[1][0]).toMatch(/\/secrets-bulk$/);+ expect(patch.mock.calls[1][1]).toEqual({+ secrets: { NEW_KEY: { name: "NEW_KEY", text: "v", type: "secret_text" } }+ });+ }+ );it("removes only variables of the sync's type", async () => {stubWorker([diff --git a/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-fns.ts b/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-fns.tsindex 7d71bd6d5e..14b2d86b64 100644--- a/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-fns.ts+++ b/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-fns.ts@@ -1,7 +1,6 @@import { AxiosError } from "axios";import { request } from "@app/lib/config/request";-import { BadRequestError } from "@app/lib/errors";import { chunkArray } from "@app/lib/fn";import { IntegrationUrls } from "@app/services/integration-auth/integration-list";import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors";@@ -31,27 +30,6 @@ type TCloudflareSecretMetadata = {type: string;};-const $validateJsonBindings = (- bindings: Array<{ type: string; name: string }>,- updatedBindingMap: Record<string, { value: string }>-) => {- const invalidJsonBindings: string[] = [];- for (const binding of bindings) {- if (binding.type === "json" && updatedBindingMap[binding.name] !== undefined) {- try {- JSON.parse(updatedBindingMap[binding.name].value);- } catch {- invalidJsonBindings.push(binding.name);- }- }- }- if (invalidJsonBindings.length > 0) {- throw new BadRequestError({- message: `The following bindings already exist in Cloudflare as JSON variables but the values provided are not valid JSON: ${invalidJsonBindings.join(", ")}`- });- }-};-const $getCloudflareErrors = (data: unknown): Array<{ code: number; message: string }> => {if (typeof data !== "object" || data === null) return [];const { errors } = data as TCloudflareApiResponse;@@ -150,18 +128,16 @@ const getCloudflareBindings = async (return { secrets, nonSecretBindings };};-// A text or JSON sync only owns variables of its type, so syncs of different types can share a Worker.+// A sync only owns variables of its type, so syncs of different types can share a Worker.const $getManagedBindings = (secretSync: TCloudflareWorkersSyncWithCredentials,{ secrets, nonSecretBindings }: TCloudflareBindings) => {const { variableType = CloudflareWorkersVariableType.Secret } = secretSync.destinationConfig;- if (variableType !== CloudflareWorkersVariableType.Secret) {- return nonSecretBindings.filter((binding) => binding.type === variableType);- }-- return secretSync.syncOptions.syncNonSecretBindings ? [...secrets, ...nonSecretBindings] : secrets;+ return variableType === CloudflareWorkersVariableType.Secret+ ? secrets+ : nonSecretBindings.filter((binding) => binding.type === variableType);};// Text and JSON variables are bindings in the Worker's settings, which take the full binding list. One@@ -267,43 +243,19 @@ export const CloudflareWorkersSyncFns = {return;}- const shouldSyncNonSecretBindings = Boolean(secretSync.syncOptions.syncNonSecretBindings);const cloudflareBindings = await getCloudflareBindings(secretSync);-const existingSecrets = $getManagedBindings(secretSync, cloudflareBindings);-- const nonSecretBindingKeys = new Set(cloudflareBindings.nonSecretBindings.map((b) => b.key));- const existingSecretsMap = Object.fromEntries(existingSecrets.map(({ key, type }) => [key, type]));const secretMapKeys = new Set(Object.keys(secretMap));// Cloudflare rejects a secret with the same name as a plaintext or JSON variable, so those keys can't go- // through secrets-bulk. A sync with Secret chosen explicitly turns them into secrets in the settings- // update below, in one step so a failure can't leave them missing. Syncs saved before the type could be- // chosen skip them, unless shouldSyncNonSecretBindings updates them in place.+ // through secrets-bulk. They are turned into secrets in a settings update instead, in one step so a+ // failure can't leave them missing.const bindingKeysToConvert = new Set(- variableType === CloudflareWorkersVariableType.Secret && !shouldSyncNonSecretBindings- ? Object.keys(secretMap).filter((key) => nonSecretBindingKeys.has(key))- : []+ cloudflareBindings.nonSecretBindings.map((binding) => binding.key).filter((key) => secretMapKeys.has(key)));- const syncableEntries = Object.entries(secretMap).filter(- ([key]) => shouldSyncNonSecretBindings || !nonSecretBindingKeys.has(key)- );-- const bindingEntries: Array<[string, { value: string }]> = [];- const secretEntries: Array<[string, { value: string }]> = [];-- for (const [key, val] of syncableEntries) {- const existingType = existingSecretsMap[key];- if (existingType && existingType !== CLOUDFLARE_SECRET_TYPE) {- bindingEntries.push([key, val]);- } else {- secretEntries.push([key, val]);- }- }-try {- if (bindingEntries.length > 0 || bindingKeysToConvert.size > 0) {+ if (bindingKeysToConvert.size > 0) {const { data: settingsData } = await request.get<{result: { bindings: Array<{ type: string; name: string; text?: string; json?: string }> };}>(@@ -316,24 +268,11 @@ export const CloudflareWorkersSyncFns = {});- const updatedBindingMap = Object.fromEntries(bindingEntries);-- $validateJsonBindings(settingsData.result.bindings, updatedBindingMap);-- const updatedBindings = settingsData.result.bindings.map((binding) => {- if (bindingKeysToConvert.has(binding.name)) {- return { type: CLOUDFLARE_SECRET_TYPE, name: binding.name, text: secretMap[binding.name].value };- }- if (binding.type !== CLOUDFLARE_SECRET_TYPE && updatedBindingMap[binding.name] !== undefined) {- const newValue = updatedBindingMap[binding.name].value;- if (binding.type === "json") {- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment- return { ...binding, json: JSON.parse(newValue) };- }- return { ...binding, text: newValue };- }- return binding;- });+ const updatedBindings = (settingsData.result.bindings ?? []).map((binding) =>+ bindingKeysToConvert.has(binding.name)+ ? { type: CLOUDFLARE_SECRET_TYPE, name: binding.name, text: secretMap[binding.name].value }+ : binding+ );const formData = new FormData();formData.append(@@ -362,13 +301,14 @@ export const CloudflareWorkersSyncFns = {null) as Record<string, { name: string; text: string; type: string } | null>;- for (const [key, val] of secretEntries) {- bulkSecrets[key] = { name: key, text: val.value, type: CLOUDFLARE_SECRET_TYPE };+ for (const [key, val] of Object.entries(secretMap)) {+ if (!bindingKeysToConvert.has(key)) {+ bulkSecrets[key] = { name: key, text: val.value, type: CLOUDFLARE_SECRET_TYPE };+ }}if (!secretSync.syncOptions.disableSecretDeletion) {const secretTypeToDelete = existingSecrets.filter((existingSecret) => {- if (existingSecret.type !== CLOUDFLARE_SECRET_TYPE) return false;const isManagedBySchema = matchesSchema(existingSecret.key,secretSync.environment?.slug || "",@@ -408,58 +348,6 @@ export const CloudflareWorkersSyncFns = {} catch (err) {throwOnCloudflareRequestError(err);}-- if (!secretSync.syncOptions.disableSecretDeletion) {- const bindingTypeToDelete = existingSecrets.filter((existingSecret) => {- if (existingSecret.type === CLOUDFLARE_SECRET_TYPE) return false;- const isManagedBySchema = matchesSchema(- existingSecret.key,- secretSync.environment?.slug || "",- secretSync.syncOptions.keySchema- );- return !secretMapKeys.has(existingSecret.key) && isManagedBySchema;- });-- if (bindingTypeToDelete.length > 0) {- try {- const bindingKeysToDelete = new Set(bindingTypeToDelete.map((b) => b.key));-- const { data: settingsData } = await request.get<{- result: { bindings: Array<{ type: string; name: string; text?: string; json?: string }> };- }>(- `${IntegrationUrls.CLOUDFLARE_WORKERS_API_URL}/client/v4/accounts/${accountId}/workers/scripts/${scriptId}/settings`,- {- headers: {- Authorization: `Bearer ${apiToken}`,- Accept: "application/json"- }- }- );-- const filteredBindings = settingsData.result.bindings.filter(- (binding) => !bindingKeysToDelete.has(binding.name)- );-- const formData = new FormData();- formData.append(- "settings",- new Blob([JSON.stringify({ bindings: filteredBindings })], { type: "application/json" })- );-- await request.patch(- `${IntegrationUrls.CLOUDFLARE_WORKERS_API_URL}/client/v4/accounts/${accountId}/workers/scripts/${scriptId}/settings`,- formData,- {- headers: {- Authorization: `Bearer ${apiToken}`- }- }- );- } catch (err) {- throwOnCloudflareRequestError(err);- }- }- }},getSecrets: async (secretSync: TCloudflareWorkersSyncWithCredentials): Promise<TSecretMap> => {diff --git a/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-schemas.ts b/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-schemas.tsindex f962f462b7..a20c3d153c 100644--- a/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-schemas.ts+++ b/backend/src/services/secret-sync/cloudflare-workers/cloudflare-workers-schemas.ts@@ -30,19 +30,11 @@ const CloudflareWorkersSyncDestinationConfigSchema = z.object({.describe(SecretSyncs.DESTINATION_CONFIG.CLOUDFLARE_WORKERS.variableType)});-const CloudflareWorkersSyncAdditionalOptionsSchema = z.object({- syncNonSecretBindings: z- .boolean()- .optional()- .describe(SecretSyncs.ADDITIONAL_SYNC_OPTIONS.CLOUDFLARE_WORKERS.syncNonSecretBindings)-});-const CloudflareWorkersSyncOptionsConfig: TSyncOptionsConfig = { canImportSecrets: false };export const CloudflareWorkersSyncSchema = BaseSecretSyncSchema(SecretSync.CloudflareWorkers,- CloudflareWorkersSyncOptionsConfig,- CloudflareWorkersSyncAdditionalOptionsSchema+ CloudflareWorkersSyncOptionsConfig).extend({destination: z.literal(SecretSync.CloudflareWorkers),@@ -52,11 +44,9 @@ export const CloudflareWorkersSyncSchema = BaseSecretSyncSchema(export const CreateCloudflareWorkersSyncSchema = GenericCreateSecretSyncFieldsSchema(SecretSync.CloudflareWorkers,- CloudflareWorkersSyncOptionsConfig,- CloudflareWorkersSyncAdditionalOptionsSchema+ CloudflareWorkersSyncOptionsConfig).extend({- // New syncs default to Secret. The type stays optional elsewhere because syncs created before it existed- // have none, and they keep skipping same-name plaintext and JSON variables.+ // Syncs created before the type existed have none and sync as secrets, so it stays optional elsewhere.destinationConfig: CloudflareWorkersSyncDestinationConfigSchema.extend({variableType: z.nativeEnum(CloudflareWorkersVariableType)@@ -67,8 +57,7 @@ export const CreateCloudflareWorkersSyncSchema = GenericCreateSecretSyncFieldsScexport const UpdateCloudflareWorkersSyncSchema = GenericUpdateSecretSyncFieldsSchema(SecretSync.CloudflareWorkers,- CloudflareWorkersSyncOptionsConfig,- CloudflareWorkersSyncAdditionalOptionsSchema+ CloudflareWorkersSyncOptionsConfig).extend({destinationConfig: CloudflareWorkersSyncDestinationConfigSchema.optional()});diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/CloudflareWorkersSyncOptionsFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/CloudflareWorkersSyncOptionsFields.tsxindex a9fd2a62ad..3203ed5086 100644--- a/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/CloudflareWorkersSyncOptionsFields.tsx+++ b/frontend/src/components/secret-syncs/forms/SecretSyncOptionsFields/CloudflareWorkersSyncOptionsFields.tsx@@ -1,22 +1,16 @@import { Controller, useFormContext } from "react-hook-form";-import { TriangleAlert } from "lucide-react";import {- Alert,- AlertDescription,- AlertTitle,Field,FieldContent,FieldDescription,FieldError,FieldLabel,- Label,Select,SelectContent,SelectItem,SelectTrigger,- SelectValue,- Toggle+ SelectValue} from "@app/components/v3";import { CLOUDFLARE_WORKERS_VARIABLE_TYPE_LABELS } from "@app/helpers/secretSyncs";import { SecretSync } from "@app/hooks/api/secretSyncs";@@ -25,96 +19,42 @@ import { CloudflareWorkersVariableType } from "@app/hooks/api/secretSyncs/types/import { TSecretSyncForm } from "../schemas";export const CloudflareWorkersSyncOptionsFields = () => {- const { control, watch } = useFormContext<+ const { control } = useFormContext<TSecretSyncForm & { destination: SecretSync.CloudflareWorkers }>();- const disableSecretDeletion = watch("syncOptions.disableSecretDeletion");- const syncNonSecretBindings = watch("syncOptions.syncNonSecretBindings");- const variableType = watch(- "destinationConfig.variableType",- CloudflareWorkersVariableType.Secret- );-return (- <>- <Controller- name="destinationConfig.variableType"- control={control}- render={({ field: { value, onChange }, fieldState: { error } }) => (- <Field className="mb-4">- <FieldLabel htmlFor="cloudflare-workers-variable-type">Variable type</FieldLabel>- <FieldContent>- {/* Only a type the user picks is saved, so editing an older sync keeps its behavior */}- <Select- value={value ?? CloudflareWorkersVariableType.Secret}- onValueChange={onChange}+ <Controller+ name="destinationConfig.variableType"+ control={control}+ defaultValue={CloudflareWorkersVariableType.Secret}+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="cloudflare-workers-variable-type">Variable type</FieldLabel>+ <FieldContent>+ <Select value={value} onValueChange={onChange}>+ <SelectTrigger+ id="cloudflare-workers-variable-type"+ className="w-full"+ isError={Boolean(error)}>- <SelectTrigger- id="cloudflare-workers-variable-type"- className="w-full"- isError={Boolean(error)}- >- <SelectValue />- </SelectTrigger>- <SelectContent position="popper">- {Object.entries(CLOUDFLARE_WORKERS_VARIABLE_TYPE_LABELS).map(([type, label]) => (- <SelectItem value={type} key={type}>- {label}- </SelectItem>- ))}- </SelectContent>- </Select>- <FieldDescription>- Secrets are encrypted in Cloudflare, while text and JSON variables stay readable.- </FieldDescription>- <FieldError errors={[error]} />- </FieldContent>- </Field>- )}- />- {variableType === CloudflareWorkersVariableType.Secret && (- <>- <Controller- name="syncOptions.syncNonSecretBindings"- control={control}- render={({ field: { value, onChange }, fieldState: { error } }) => (- <Field className="mb-4">- <Field orientation="horizontal">- <FieldContent>- <Label htmlFor="sync-non-secret-bindings">- Sync plaintext and JSON variables- </Label>- <FieldDescription>- Keep existing plaintext and JSON variables as their type and update their- values, instead of converting them to secrets.- </FieldDescription>- </FieldContent>- <Toggle- id="sync-non-secret-bindings"- variant="project"- checked={value}- onCheckedChange={onChange}- />- </Field>- <FieldError errors={[error]} />- </Field>- )}- />- {syncNonSecretBindings && !disableSecretDeletion && (- <Alert variant="warning" className="mb-4">- <TriangleAlert />- <AlertTitle>Plaintext and JSON variables may be deleted</AlertTitle>- <AlertDescription>- With "Prevent secret deletion" turned off and non-secret binding sync- turned on, any plaintext or JSON variables in Cloudflare Workers that are not- present in Infisical will be removed during a sync. Turn on "Prevent secret- deletion" above to keep them.- </AlertDescription>- </Alert>- )}- </>+ <SelectValue />+ </SelectTrigger>+ <SelectContent position="popper">+ {Object.entries(CLOUDFLARE_WORKERS_VARIABLE_TYPE_LABELS).map(([type, label]) => (+ <SelectItem value={type} key={type}>+ {label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ <FieldDescription>+ Secrets are encrypted in Cloudflare, while text and JSON variables stay readable.+ </FieldDescription>+ <FieldError errors={[error]} />+ </FieldContent>+ </Field>)}- </>+ />);};diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/CloudflareWorkersReviewFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/CloudflareWorkersReviewFields.tsxindex 55ba457200..7eae159d6f 100644--- a/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/CloudflareWorkersReviewFields.tsx+++ b/frontend/src/components/secret-syncs/forms/SecretSyncReviewFields/CloudflareWorkersReviewFields.tsx@@ -1,7 +1,7 @@import { useFormContext } from "react-hook-form";import { TSecretSyncForm } from "@app/components/secret-syncs/forms/schemas";-import { Badge, Detail, DetailLabel, DetailValue } from "@app/components/v3";+import { Detail, DetailLabel, DetailValue } from "@app/components/v3";import { CLOUDFLARE_WORKERS_VARIABLE_TYPE_LABELS } from "@app/helpers/secretSyncs";import { SecretSync } from "@app/hooks/api/secretSyncs";import { CloudflareWorkersVariableType } from "@app/hooks/api/secretSyncs/types/cloudflare-workers-sync";@@ -11,28 +11,14 @@ export const CloudflareWorkersSyncOptionsReviewFields = () => {TSecretSyncForm & { destination: SecretSync.CloudflareWorkers }>();- const [{ syncNonSecretBindings }, variableType = CloudflareWorkersVariableType.Secret] = watch([- "syncOptions",- "destinationConfig.variableType"- ]);+ const variableType =+ watch("destinationConfig.variableType") ?? CloudflareWorkersVariableType.Secret;return (- <>- <Detail>- <DetailLabel>Variable Type</DetailLabel>- <DetailValue>{CLOUDFLARE_WORKERS_VARIABLE_TYPE_LABELS[variableType]}</DetailValue>- </Detail>- {variableType === CloudflareWorkersVariableType.Secret && (- <Detail>- <DetailLabel>Sync Plaintext and JSON Variables</DetailLabel>- <DetailValue>- <Badge variant={syncNonSecretBindings ? "success" : "danger"}>- {syncNonSecretBindings ? "Enabled" : "Disabled"}- </Badge>- </DetailValue>- </Detail>- )}- </>+ <Detail>+ <DetailLabel>Variable Type</DetailLabel>+ <DetailValue>{CLOUDFLARE_WORKERS_VARIABLE_TYPE_LABELS[variableType]}</DetailValue>+ </Detail>);};diff --git a/frontend/src/components/secret-syncs/forms/schemas/cloudflare-workers-sync-destination-schema.ts b/frontend/src/components/secret-syncs/forms/schemas/cloudflare-workers-sync-destination-schema.tsindex ad03fb7a5b..9ddaa618e7 100644--- a/frontend/src/components/secret-syncs/forms/schemas/cloudflare-workers-sync-destination-schema.ts+++ b/frontend/src/components/secret-syncs/forms/schemas/cloudflare-workers-sync-destination-schema.ts@@ -4,11 +4,7 @@ import { BaseSecretSyncSchema } from "@app/components/secret-syncs/forms/schemasimport { SecretSync } from "@app/hooks/api/secretSyncs/enums";import { CloudflareWorkersVariableType } from "@app/hooks/api/secretSyncs/types/cloudflare-workers-sync";-export const CloudflareWorkersSyncDestinationSchema = BaseSecretSyncSchema(- z.object({- syncNonSecretBindings: z.boolean().optional().default(false)- })-).merge(+export const CloudflareWorkersSyncDestinationSchema = BaseSecretSyncSchema().merge(z.object({destination: z.literal(SecretSync.CloudflareWorkers),destinationConfig: z.object({@@ -18,7 +14,9 @@ export const CloudflareWorkersSyncDestinationSchema = BaseSecretSyncSchema(.min(1, "Script ID is required").max(64).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, "Invalid script ID format"),- variableType: z.nativeEnum(CloudflareWorkersVariableType).optional()+ variableType: z+ .nativeEnum(CloudflareWorkersVariableType)+ .default(CloudflareWorkersVariableType.Secret)})}));diff --git a/frontend/src/hooks/api/secretSyncs/types/cloudflare-workers-sync.ts b/frontend/src/hooks/api/secretSyncs/types/cloudflare-workers-sync.tsindex 0a9790e9cd..76c995791b 100644--- a/frontend/src/hooks/api/secretSyncs/types/cloudflare-workers-sync.ts+++ b/frontend/src/hooks/api/secretSyncs/types/cloudflare-workers-sync.ts@@ -1,6 +1,6 @@import { AppConnection } from "@app/hooks/api/appConnections/enums";import { SecretSync } from "@app/hooks/api/secretSyncs";-import { RootSyncOptions, TRootSecretSync } from "@app/hooks/api/secretSyncs/types/root-sync";+import { TRootSecretSync } from "@app/hooks/api/secretSyncs/types/root-sync";export enum CloudflareWorkersVariableType {Secret = "secret_text",@@ -19,7 +19,4 @@ export type TCloudflareWorkersSync = TRootSecretSync & {name: string;id: string;};- syncOptions: RootSyncOptions & {- syncNonSecretBindings?: boolean;- };};