Skip to content

Latest commit

 

History

History
 
 

vault-variable-test

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This example relates to the Vault Application Variable Provider Example documentation.

You are best to visit the above link for more information, but for convenience, below is the steps taken to set up the Vault side of the application:

  1. Install Vault

  2. Start Vault:

vault server -dev -dev-root-token-id root
  1. Set a token in Vault:
export VAULT_TOKEN=root
export VAULT_ADDR=http://127.0.0.1:8200
export TOKEN=eyMyJWTToken...
vault kv put secret/secret value=$TOKEN
vault kv get secret/secret
  1. Build the application:
spin build
  1. Run the application:
spin up --runtime-config-file runtime_config.toml
  1. Test the application:
$ curl localhost:3000 --data $TOKEN
{"authentication": "accepted"}