fugue / credstash

A little utility for managing credentials in the cloud
Apache License 2.0
2.06k stars 215 forks source link

deleteSecrets add option to silence printing #304

Closed lowcloudnine closed 2 years ago

lowcloudnine commented 3 years ago

I'm writing a small command line utility to replace all the credstash keys from an edited file. I was wrapping adding keys and deleting keys in the console library "rich" and its progress bars. I have issues getting the credstash.deleteSecrets to work correctly with rich's progress bar and even putting the call inside a context manager to silence the printing is problematic. The fix is non-breaking and fixes the problem with using credstash in external scripts.

Adding keys (credstash.putSecret) plays nicely with an external library like rich and its associated progress bars, deleting keys (credstash.deleteSecrets) did not because of the print statement in the function. Added parameter "show_output" with a default of true and then wrapped the print in an if clause.