knitr::opts_chunk$set(tidy = FALSE, comment = "#>")
Copyright 2017 Michele Stefano Altieri. Licensed under the MIT license.
passport
lets you manage username and password for databases or web services
in order to provide full access to external resources without exposing
credential within the code.
passport
is not yet available through CRAN, but you can install the latest development version from GitHub:
install.packages("devtools") devtools::install_github("msaltieri/passport")
You can handle a simple password repository by running
library(passport) my_vault <- new_vault(tempfile()) my_vault
Then you can add your first test credentials by running
proxy1_set <- list(service = "postgres", host = "my_istance.dbserver.com", port = "5432", username = "admin", password = "12345") vault_add(my_vault, proxy1_set) my_vault
Then maybe you can even add a second set of credentials
proxy2_set <- list(service = "data_provider", host = "ftp://download.data_provider.com", port = "22", username = "alice", password = "67890") vault_add(my_vault, proxy2_set) my_vault
It's now easy to retrieve data from the vault by service name
vault_get(my_vault, "postgres")
Or maybe showing all the credential stored in the vault with just one command
vault_getall(my_vault)
If you need to delete a specific set of credentials, just run
vault_rm(my_vault, "postgres") my_vault
You can erase completely the vault and all the data stored inside by running
vault_delete(my_vault)
my_vault
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.