Add documentation

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-08-25 17:53:44 +02:00
parent 5f39869bb9
commit a546f0f0af
Signed by: luzifer
GPG Key ID: D91C3E91E4CAD6F5

View File

@ -1,6 +1,32 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
###
# How to use
###
#
# Create a key in Vault `secret/git-credential/<hostname>` so i.e.
# `secret/git-credential/git.luzifer.io` and fill it with key-value
# pairs according to the git-credential spec [1]
#
# So for example this could be the content:
# {
# "protocol": "https", # Force to use HTTPS
# "username": "luzifer", # The username required for the host
# "password": "..." # Password for the given user
# }
#
# The `${key}=${value}` pairs are dumped as they are without further
# processing. Therefore you can override all parameters the
# git-credential spec allows you to set. I recommend to enforce the
# `protocol` field to `https` as this helper is not checking the
# protocol passed but only looks for the `host` value to fetch the
# correct key from Vault.
#
# [1] https://git-scm.com/docs/git-credential
#
###
source "${HOME}/bin/script_framework.sh" source "${HOME}/bin/script_framework.sh"
function handle_get() { function handle_get() {