Variable export does not handle newlines when passed in from kv store.
This is shown when attempting to grab a pem certificate from kv store when the kv contains newline characters:
/scripts-2258-127217/step_script: line 159: export: `KEY-----': not a valid identifier
/scripts-2258-127217/step_script: line 159: export: `9rm46[redacted]I22LQ3T': not a valid identifier
/scripts-2258-127217/step_script: line 159: export: `p/W7s[redacted]eyxKvbj': not a valid identifier
/scripts-2258-127217/step_script: line 159: export: `6uHak[redacted]GY5S9j': not a valid identifier
/scripts-2258-127217/step_script: line 159: export: `YoZAJ[redacted]L0khZ6': not a valid identifier
...
/scripts-2258-127217/step_script: line 159: export: `-----END': not a valid identifier
/scripts-2258-127217/step_script: line 159: export: `KEY-----': not a valid identifier
This could be solved with wrapping the variable in quotes like in this commit; however, that would also introduce the possibility of truncating any secret that contains " ' " unless we create another function that does single quote escaping before piping to printf.
Variable export does not handle newlines when passed in from kv store.
This is shown when attempting to grab a pem certificate from kv store when the kv contains newline characters:
This could be solved with wrapping the variable in quotes like in this commit; however, that would also introduce the possibility of truncating any secret that contains " ' " unless we create another function that does single quote escaping before piping to printf.