winebarrel / gcredstash

gcredstash manages credentials using AWS Key Management Service (KMS) and DynamoDB.
Apache License 2.0
71 stars 24 forks source link

Render templates with text/template, not html/template. #3

Closed mgreensmith closed 7 years ago

mgreensmith commented 7 years ago

The existing template implementation uses html/template, which automatically escapes the rendered output to be HTML-safe.

This causes problems when templating non-trivial data such as e.g. RSA keys. The rendered output is unusable for anything except in-browser display, unless you further process it to unescape the HTML entities.

Since this CLI tool doesn't have an HTML interface, I'm not sure why we would want escaped output by default.

This PR changes the template command to use text/template to avoid mutating the output.

pmoust commented 7 years ago

👍 Got bitten by this.

winebarrel commented 7 years ago

Thanks! 👍