datastorr_auth: datastorr/GitHub authentication

Description Usage Arguments Details

View source: R/github_auth.R

Description

Authentication for accessing GitHub. This will first look for a GitHub personal token (stored in the GITHUB_TOKEN or GITHUB_PAT environment variables, and then try authenticating with OAuth.

Usage

1
2
3
4
datastorr_auth(required = FALSE, key = NULL, secret = NULL,
  cache = TRUE, token_only = FALSE)

setup_github_token(path = "~/.Renviron")

Arguments

required

Is authentication required? Reading from public repositories does not require authentication so there's no point worrying if we can't get it. datastorr will set this when appropriate internally.

key, secret

The application key and secret. If NULL, uses datastorr's key. But if you have your own application feel free to replace these with your own.

cache

Logical, indicating whether we should cache the token. If TRUE, the token will be cached at datastorr_auth(), so that it is accessible to all datastorr usages. Note that this is affected by the datastorr.path global option. Alternatively, set FALSE to do no caching and be prompted each session or a string to choose your own filename. Or set the GITHUB_TOKEN or GITHUB_PAT environment variables to use a token rather than OAuth.

token_only

return the token only

path

Path to environment file; the default is the user environment variable file which is usually a good choice.

Details

Run this datastorr_auth function to force setting up authentication with OAuth. Alternatively, run setup_github_token to set up a personal access token. Either can be revoked at any time https://github.com/settings/tokens to revke a personal access token and https://github.com/settings/applications to revoke the OAuth token.


richfitz/dataverse documentation built on July 9, 2021, 12:08 p.m.