demo-magic icon indicating copy to clipboard operation
demo-magic copied to clipboard

Hide secrets

Open aodj-kara opened this issue 1 year ago • 1 comments

Hello, and thank you for demo-magic. I've been using it to showcase demos of some APi interactions that I can script with curl. Is there anyway you know of that I could employ to avoid displaying secrets like passwords or tokens?

As a limited example I'm doing things like this:

TOKEN="Bearer 908y712ugehjkljds"

comment "# Get the frobulator"
pe "curl --silent 'https://127.0.0.1:5000/frobulator' -H 'Authorization: $TOKEN' | jq"

... which results in a very long output as the command interpolates the full bearer token of 1500+ characters

aodj-kara avatar Jun 07 '24 10:06 aodj-kara

You can us the p function to print out a version of your curl cmd without the passwords or with them masked. Then just run the curl command in the script.

Make sense?

On Fri, Jun 7, 2024 at 6:24 AM aodj-kara @.***> wrote:

Hello, and thank you for demo-magic. I've been using it to showcase demos of some APi interactions that I can script with curl. Is there anyway you know of that I could employ to avoid displaying secrets like passwords or tokens?

— Reply to this email directly, view it on GitHub https://github.com/paxtonhare/demo-magic/issues/29, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEZ43RJDKYAO5S5IQWZ7FTZGGC4HAVCNFSM6AAAAABI6MQUXCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM2DAMJQHEZTAMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

paxtonhare avatar Jun 07 '24 13:06 paxtonhare