File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
packages/input_secrets/src Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ export function encryptInputSecretValue<T extends string | object>(
46
46
ow ( publicKey , ow . object . instanceOf ( KeyObject ) ) ;
47
47
ow ( schema , ow . optional . object ) ;
48
48
49
+ // TODO to make string encryption compatible with current SDK, we need to use the old form.
50
+ // Remove this once SDK is updated to use the new form
51
+ if ( typeof value === 'string' ) {
52
+ const { encryptedValue, encryptedPassword } = publicEncrypt ( { value, publicKey } ) ;
53
+ return `${ ENCRYPTED_STRING_VALUE_PREFIX } :${ encryptedPassword } :${ encryptedValue } ` ;
54
+ }
55
+
49
56
const schemaHash = schema ? getFieldSchemaHash ( schema ) : null ;
50
57
51
58
// We are encrypting the value as a JSON string, so we need to stringify it first.
You can’t perform that action at this time.
0 commit comments