https://github.com/vimc/vaultr
:lock: API client for Hashicorp's vault (https://www.vaultproject.io/)
https://github.com/vimc/vaultr
Last synced: 4 months ago
JSON representation
:lock: API client for Hashicorp's vault (https://www.vaultproject.io/)
- Host: GitHub
- URL: https://github.com/vimc/vaultr
- Owner: vimc
- License: other
- Created: 2017-08-21T09:21:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-09T13:26:32.000Z (over 1 year ago)
- Last Synced: 2024-11-28T15:41:10.488Z (5 months ago)
- Language: R
- Homepage: https://vimc.github.io/vaultr
- Size: 1.22 MB
- Stars: 24
- Watchers: 3
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - vimc/vaultr - :lock: API client for Hashicorp's vault (https://www.vaultproject.io/) (R)
README
# vaultr
[](https://www.repostatus.org/#active)
[](https://github.com/vimc/vaultr/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/github/vimc/vaultr?branch=master)
[](https://www.codefactor.io/repository/github/vimc/vaultr)
[](https://cran.r-project.org/package=vaultr)Interact with [HashiCorp's vault](https://www.vaultproject.io/), to securely use secrets from R. This package wraps the [vault http API](https://www.vaultproject.io/api/index.html) to allow secrets to be accessed from R. Secrets might be passwords, tokens, certificates or any other sensitive data.
* Authenticate with several different providers (token, username and password, GitHub, LDAP, and "approle")
* Read and write secrets into vault using its key-value stores (version 1 or 2), cubbyhole and in-transit "encryption-as-a-service"
* Inspect and work with vault tokens
* Read, write and update vault policies
* Allows a degree of access to operator maintenance
* Work with vault's audit devices## Usage
```{r, include = FALSE}
srv <- vaultr::vault_test_server()
srv$export()
local({
cl <- srv$client()
cl$write("/secret/database/admin", list(value = "s3cret"))
cl$write("/secret/database/readonly", list(value = "passw0rd"))
})
knitr::opts_chunk$set(error = FALSE)
```Create a vault client with the `vault_client` function:
```{r}
vault <- vaultr::vault_client(login = TRUE)
```Interact with vault using this object:
```{r}
vault$list("secret/database")
```and read secrets with
```{r}
vault$read("secret/database/admin")
``````{r}
vault$read("secret/database/readonly", field = "value")
```or set secrets with
```r
vault$write("secret/webserver", list(password = "horsestaple"))
vault$read("secret/webserver")
```or delete secrets with
```r
vault$delete("/secret/database/readonly")
```## Installation
Install `vaultr` from CRAN with
```r
install.packages("vaultr")
```To install our internally released version (which might be ahead of CRAN) via our r-universe, use
```r
install.packages(
"vaultr",
repos = c("https://vimc.r-universe.dev", "https://cloud.r-project.org"))
```or install the bleeding edge with
```r
remotes::install_gitub("vimc/vaultr", upgrade = FALSE)
```## License
MIT © Imperial College of Science, Technology and Medicine