Skip to content

Latest commit

 

History

History
33 lines (19 loc) · 833 Bytes

README.md

File metadata and controls

33 lines (19 loc) · 833 Bytes

Vault client

Author: Ismael Fernandez

The purpose of this extension is to easily fetch secrets from a Vault instance

You will be able to reach vault and get your secrets using a token

Requirements

  • Vault cli

Functions

vault_set_env_vars(vault_addr: str, vault_token: str)

Set up the VAULT_ADDRand the VAULT_TOKEN as envvars.

vault_read_secret(path: str, field: str) return str

Return the value of your secret.

Under the hood, it is doing te command vault read -field=$fiel $path"

Example Usage

load('ext://vault_cli', 'vault_read_secret', 'vault_set_env_vars')
vault_set_env_vars('https://localhost:8200','mytoken')
my_foo = vault_read_secret('path/myfoo', 'value')
my_bar = vault_read_secret('path/mybar', 'foobar')