knitr::opts_chunk$set(tidy = FALSE, comment = "#>")

passport - Manage access credentials with R

Build Status

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.

Table of contents

Installation

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")

How to use

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


msaltieri/passport documentation built on May 5, 2019, 3:49 p.m.