From e19603c7f01903e5ad14db134af2385587900c44 Mon Sep 17 00:00:00 2001 From: martinforejt Date: Tue, 8 Jul 2025 10:11:20 +0200 Subject: [PATCH] fix(input_secret): For string secret revert to old form until SDK is updated --- packages/input_secrets/src/input_secrets.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/input_secrets/src/input_secrets.ts b/packages/input_secrets/src/input_secrets.ts index 063a94995..b471c0cac 100644 --- a/packages/input_secrets/src/input_secrets.ts +++ b/packages/input_secrets/src/input_secrets.ts @@ -46,6 +46,13 @@ export function encryptInputSecretValue( ow(publicKey, ow.object.instanceOf(KeyObject)); ow(schema, ow.optional.object); + // TODO to make string encryption compatible with current SDK, we need to use the old form. + // Remove this once SDK is updated to use the new form + if (typeof value === 'string') { + const { encryptedValue, encryptedPassword } = publicEncrypt({ value, publicKey }); + return `${ENCRYPTED_STRING_VALUE_PREFIX}:${encryptedPassword}:${encryptedValue}`; + } + const schemaHash = schema ? getFieldSchemaHash(schema) : null; // We are encrypting the value as a JSON string, so we need to stringify it first.