You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have discovered need to use bash script as Vault Token Helper and I have never needed VAULT_ADDR environment variable before this because I have been able to use -address with single Vault instance and single .vault-token file.
It would be better to export -address value to VAULT_ADDR environment variable automatically when using customized vault token helper script because then I could keep my workflow as it is.
I have to issue multiple Signed SSH Certificates from multiple Vault instances and before that I have used only one Vault instance but I want to separate these projects to separate entities with their own Vault instance.
Describe the solution you'd like
Expose address argument similar to method (get, store, erase) when calling token helper script or add VAULT_ADDR environment variable when calling Vault Token Helper script, if user has specified -address value.
Describe alternatives you've considered
I will edit my bash script for Signed SSH Certificates to use export VAULT_ADDR for different organizations Vault instances. [ x ]
#!/bin/bash
stderr() { echo -n "$@" 1>&2; }
if [ ! "$BASH_VERSION" ]; then
exit 1
fi
if [[ -z "$VAULT_ADDR" || ! -n "$VAULT_ADDR" ]]; then
exit 1
fi
FILE="$HOME/.vault-token"
ACTION=$1
case $ACTION in
get)
if [[ -f "$FILE" ]]; then
VAULT_TOKEN=$(cat .vault-token | jq -r ".[\"$VAULT_ADDR\"]")
if [[ -n "$VAULT_TOKEN" ]]; then
echo -n "$VAULT_TOKEN"
fi
fi
exit 0
;;
store)
if [[ ! -f "$FILE" ]]; then
echo "{}" > $FILE
fi
VAULT_TOKEN=$(cat)
jq ".[\"$VAULT_ADDR\"] = \"$VAULT_TOKEN\"" "$FILE" > "$FILE.tmp"
mv "$FILE.tmp" "$FILE"
;;
erase)
jq "del(.[\"$VAULT_ADDR\"])" "$FILE" > "$FILE.tmp"
mv "$FILE.tmp" "$FILE"
;;
*)
exit
esac
The text was updated successfully, but these errors were encountered:
cwchristerw
changed the title
Add VAULT_ADDR environment variable to Vault Token Helper when using HTTP Option -address.
Export VAULT_ADDR environment variable to Vault Token Helper script when using HTTP Option -address.
Aug 9, 2023
cwchristerw
changed the title
Export VAULT_ADDR environment variable to Vault Token Helper script when using HTTP Option -address.
Expose address to Vault Token Helper script when using HTTP Option -address.
Aug 26, 2023
cwchristerw
changed the title
Expose address to Vault Token Helper script when using HTTP Option -address.
Expose address to Vault Token Helper script when using HTTP Option -address in CLI
Aug 26, 2023
I have decided to create custom CLI tool instead of using Vault CLI due to this issue. In my CLI tool (bash script) I'm using curl command to communicate with Vault API.
Is your feature request related to a problem? Please describe.
I have discovered need to use bash script as Vault Token Helper and I have never needed VAULT_ADDR environment variable before this because I have been able to use -address with single Vault instance and single .vault-token file.
It would be better to export -address value to VAULT_ADDR environment variable automatically when using customized vault token helper script because then I could keep my workflow as it is.
I have to issue multiple Signed SSH Certificates from multiple Vault instances and before that I have used only one Vault instance but I want to separate these projects to separate entities with their own Vault instance.
Describe the solution you'd like
Expose address argument similar to method (get, store, erase) when calling token helper script or add VAULT_ADDR environment variable when calling Vault Token Helper script, if user has specified -address value.
Describe alternatives you've considered
Explain any additional use-cases
Additional context
Related File:
https://github.com/hashicorp/vault/blob/main/command/token/helper_external.go
Commands
vault login -address=https://vault.example.com
vault login -address=https://vault.example.org
VS
export VAULT_ADDR=https://vault.example.com
vault login
export VAULT_ADDR=https://vault.example.org
vault login
Vault Token Helper
The text was updated successfully, but these errors were encountered: