Skip to content

reading kv secrets the proper way #187

Description

@kbuchsicf

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions