ghost icon indicating copy to clipboard operation
ghost copied to clipboard

Generate a jinja2 template automatically from the values of a retrieved key

Open nir0s opened this issue 9 years ago • 1 comments
trafficstars

Assume a template boto.ini:

[Credentials]
aws_access_key_id = {{ access }}
aws_secret_access_key = {{ secret }}

and a key:

Description:   None
Uid:           08ee6102-5668-440f-b583-97a1c7a17e5a
Created_At:    2016-09-15 15:10:01
Metadata:      None
Modified_At:   2016-09-15 15:10:01
Value:         access=my_access;secret=my_secret;
Name:          aws

It would be nice to generate a file automatically using the values of that key like so:

ghost get aws --generate boto.ini

and get

[Credentials]
aws_access_key_id = my_access
aws_secret_access_key = my_secret

This will allow a user to never keep files with credentials within them, but rather templates of files only. Of course, you can always provide the file's data as the value to encrypt, but if the file is big or if it frequently changes, it's less comfortable.

nir0s avatar Oct 25 '16 07:10 nir0s

https://github.com/nir0s/ghost/tree/generate-jinja-template-from-values is a POC

nir0s avatar Oct 25 '16 16:10 nir0s