REDCapExporter_keyring: Set up and use of a Keyring for REDCap API Tokens

Description Usage Arguments Value See Also Examples

Description

Tools for checking for, and setting up, a file based keyring for storing REDCap API tokens.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
REDCapExporter_keyring_check(keyring = "REDCapExporter", password = NULL)

REDCapExporter_add_api_token(
  project,
  keyring = "REDCapExporter",
  user = NULL,
  password = NULL,
  overwrite = FALSE
)

REDCapExporter_get_api_token(
  project,
  keyring = "REDCapExporter",
  user = NULL,
  password = NULL
)

Arguments

keyring

a character vector identifying the name of the keyring, defaults to "REDCapExporter"

password

This is the password for the keyring. The default is an empty password.

project

the name of the REDCap project the API token is identified by.

user

user name to associate the token with. Defaults to Sys.info()[["user"]].

overwrite

logical, if TRUE overwrite the existing token.

Value

REDCapExporter_keyring_check returns TRUE, invisibly, as does REDCapExporter_add_api_token. REDCapExporter_get_api_token returns the token invisibly as not to print the value to the console by default. Still, be careful with your token.

See Also

vignette(topic = "api", package = "REDCapExporter")

Examples

1
2
3
4
5
6
## Not run: 
REDCapExporter_keyring_check()
REDCapExporter_add_api_token("Project1")
Sys.setenv(REDCap_API_TOKEN = REDCapExporter_get_api_token("Project1"))

## End(Not run)

REDCapExporter documentation built on Feb. 2, 2021, 5:15 p.m.