When calling it on actual strings, the string gets quoted and special characters like newlines are escaped. It was trimming the quotes but not fixing escaped characters. This was messing up passing mTLS PEM-format certificates, which contain newlines.
Change the logic if called on a types.List that has actual types.String values so we keep the exact string value. Ideally this function is somehow typed so it can only ever be called on types.List that have strings but that seems like a bigger project.
When calling it on actual strings, the string gets quoted and special characters like newlines are escaped. It was trimming the quotes but not fixing escaped characters. This was messing up passing mTLS PEM-format certificates, which contain newlines.
Change the logic if called on a types.List that has actual types.String values so we keep the exact string value. Ideally this function is somehow typed so it can only ever be called on types.List that have strings but that seems like a bigger project.