Share this page

# Working with HashiCorp Vault

You can add API functions to your scripts to retrieve HashiCorp Vault secrets during replay and scenario runs.

In this topic:

## VuGen's HashiCorp APIs

HashiCorp Vault stores confidential data, such as passwords, certificates, or keys, in the form of secrets. VuGen includes API functions you can add to Vuser scripts to enable access to the Vault secrets, when running your scripts. You can insert these APIs manually into scripts written in C, C#, Java, and JavaScript.

The API functions retrieve secrets from HashiCorp Vault either by a token-base request or by authenticating via JWT, AppRole, or UserPass. A helper function is also available to extract a specific secret value from the Vault response. To use these APIs, ensure the machine running the script can reach the HashiCorp Vault server, for example, by successfully running a simple curl request.

For details, see HashiCorp Vault API Functions in the Function Reference and the hashicorp.com website.

Back to top

## Retrieve HashiCorp Vault secrets

You use the HashiCorp Vault API functions to retrieve key vault secrets through a Vuser script.

To retrieve HashiCorp key vault secrets:

1. Insert one of the following functions into your script:

   1. lr_hashicorp_vault_get_secret_with_token

   2. lr_hashicorp_vault_get_secret_with_jwt_auth

   3. lr_hashicorp_vault_get_secret_with_approle_auth

   4. lr_hashicorp_vault_get_secret_with_userpass_auth

2. Use the editor's auto-completion feature to see the required arguments for each function.

3. To extract the secret from the full response received above, insert the lr_hashicorp_vault_save_secret_from_json function.

Back to top

See also:

- Enhance scripts
- Function Reference
- Steps Toolbox pane

https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 26.1 All View Local Help Center View Online Help Center Version: