A collection of copy-pastable code example snippets demonstrating the various ways to use the Vault client libraries for various languages to authenticate and retrieve secrets.
- Go
- Uses official library HashiCorp Vault
- Provided examples:
- Quick Start with Token Auth
- Auth Methods (AppRole, AWS, Azure, GCP, Kubernetes)
- Token Renewal
- Ruby
- Uses official library vault-ruby
- Provided examples:
- Quick Start with Token Auth
- C#
- Uses community-maintained library VaultSharp
- Provided examples:
- Quick Start with Token Auth
- Auth Methods (AppRole, AWS, Azure, GCP, Kubernetes)
- Python
- Uses community-maintained library HVAC
- Provided examples:
- Quick Start with Token Auth
- Java (Spring)
- Uses community-maintained library spring-vault
- Provided examples:
- Quick Start with Token Auth
Find the relevant directory for the concept you're interested in learning about, then find the file for your language of choice. You can use the example code as a reference or paste it into your application and tweak as needed. Each concept's directory also contains a readme explaining some of the specific terminology and operational setup.
This repo is not intended to be "run" as a standalone application.
For an out-of-the-box runnable sample app, please see our Hello-Vault repos.
Hello-Vault:
If you would like to submit a code example to this repo, please create a file containing one function (or a grouping of several related functions) in the appropriate directory.