Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/input_secrets/src/input_secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ export function encryptInputSecretValue<T extends string | object>(
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.
Expand Down