peopledoc/vault-cli

[Vault_cli][SSH] ssh-add message

Closed this issue · 1 comments

Bonjour à tous,

lors de l'utilisation de vault_cli avec l'option ssh, le message de ssh-add s'affiche.

/usr/local/bin/vault --config-file /etc/{SERVICE}/vault_ro.yml ssh --key {PATH}:{VALUE}

Identity added: (stdin) ((stdin))

Est-il possible de rendre cette affichage optionnel afin de pouvoir le désactiver (notamment lors de l'utilisation via cron) ?

Hey :) Don't forget this is an open source repo, the whole world is watching (well maybe not the whole world but at least non-french-speaking folks)

Yep, ssh-add seems to support -q for quiet mode, suppressing message for succesful operations. If you can afford a bit of time, is there any way I can help you contributing and adding this? We can do it in pair if you want !

Note: the whole contribution will be:

One change here to add -q:

_launch_command(["ssh-add", "-"], stdin=key, environment=environment)

One line here to test:
assert ssh_public in identities.decode("utf-8")

Unit tests to fix:
launch_command.assert_called_with(["ssh-add", "-"], environment={}, stdin="foo")

and
["ssh-add", "-"],

Changelog:

That's it :) If you need me, I'll be there, and happy to help :)

And welcome to the wonderful world of open source contributions!

(note: if you don't have time to do it or prefer not to, just tell me)