HCP Vault Secrets is a centralized SaaS secrets lifecycle management solution. This repository showcases the various ways you can store and fetch secrets securely with your application.
We will use Stripe Checkout's sample application to showcase it!
Stripe Checkout is the fastest way to get started with payments. Included are some basic build and run scripts you can use to start up the application.
-
Set the stripe.Key in server.go to your test Stripe Secret Key.
-
Run the server
go run server.go
-
Sign up for HCP at cloud.hashicorp.com
-
Create an app "payments-api" in HCP Vault Secrets
-
Create a secret "STRIPE_SECRET_TEST_KEY" with the test Stripe Secret Key.
-
Ensure stripe.Key is set to an environment variable name "STRIPE_SECRET_TEST_KEY" in server.go
-
Download and install vlt CLI
-
Run the below commands to login to HCP and set the context to your app in HCP Vault Secrets
vlt login && vlt config
- Use the below command to run the Go app with fetching secrets from HCP Vault Secrets
vlt run -c "go run server.go"