github.Rd
Configure authorizedVerb
to use GitHub personal access tokens for authentication.
This is a useful default approach when no better authentication scheme is available.
setGitHubToken(
token,
cache.env,
cache.path = NULL,
github.url = "https://api.github.com",
prompt.text = NULL
)
getGitHubTokenInfo(cache.env, cache.path = NULL, prompt = interactive(), ...)
useGitHubIdentities(cache.env, cache.path = NULL, ...)
String containing a GitHub personal access token.
If missing, the user will be prompted to supply a token.
If NULL
, any existing tokens are cleared.
Environment to use to store the current GitHub token in an in-memory cache. This allows the same token to be transparently re-used in the same R session.
String containing a path to a on-disk cache.
This allows the same token to be transparently re-used across different R sessions.
If NULL
, no on-disk caching is performed.
String containing the URL to a GitHub REST API.
String containing the prompt text for an interactively supplied token.
Logical scalar indicating whether the user should be prompted to supply token details if no cached token exists.
Further arguments to pass to setGitHubToken
when prompting for a new token.
For setGitHubToken
, any non-NULL
token
(or its interactively supplied counterpart) will be cached in memory and/or on disk, depending on cache.path
.
A list is invisibly returned containing details about the token including its value, the corresponding user account and the expiry time.
If token=NULL
, any cached token is cleared from disk and memory, and NULL
is invisibly returned.
For getGitHubTokenInfo
, a list is returned containing the token details.
If prompt=FALSE
and no cached token is present, NULL
is returned.
For useGitHubIdentities
, the availability and value of the token is used to configure identityAvailable
and identityHeaders
.
A function is returned that, when executed, restores the previous values of identityAvailable
and identityHeaders
;
this is typically run in an on.exit
clause.