Injection un fichier dans du json en l'encodant en base64

Injection d'un fichier (Methode 1)

1jq -Rn '.instances[0].image.b64 = inputs' < <(base64 volunteers.jpg | tr -d \\n) > input.json

cf stakoverflow

Injection d'un fichier (Methode 2)

1jq -Rs --rawfile pub id_rsa.pub '{pem: ., pub: $pub}' id_rsa

cf stakoverflow

Encodage en base 64

1jq '"Basic " + ("\(.user):\(.pass)"|@base64)' <basic.json

cf stakoverflow