I have secrets in Vault which I populated with the CLI: vault kv put -tls-skip-verify "secret/directory/$client" token="$clientToken"
When using vault-ruby to read these secrets back from Vault, I end up having to parse the Table format response:
kvarr = Vault.logical.read('secret/directory/sampleclient').data[:token].split("\n") clienttoken = kvarr.select { |line| /^token */.match(line) }[0].split(/ */)[1]
Is there a cleaner way to do this, or is this suggesting the need for the addition of a new API in vault-ruby, like: Vault.logical.kvget('secret/directory/sampleclient', 'token')
I have secrets in Vault which I populated with the CLI:
vault kv put -tls-skip-verify "secret/directory/$client" token="$clientToken"When using vault-ruby to read these secrets back from Vault, I end up having to parse the Table format response:
kvarr = Vault.logical.read('secret/directory/sampleclient').data[:token].split("\n") clienttoken = kvarr.select { |line| /^token */.match(line) }[0].split(/ */)[1]Is there a cleaner way to do this, or is this suggesting the need for the addition of a new API in vault-ruby, like:
Vault.logical.kvget('secret/directory/sampleclient', 'token')