Skip to content

pak supports HTTP basic authentication when interacting with CRAN-like repositories. To use authentication, include a username in the repo URL:

https://<username>@<repo-host>/<repo-path>

Usage

repo_auth(
  r_version = getRversion(),
  bioc = NULL,
  cran_mirror = NULL,
  check_credentials = TRUE
)

Arguments

r_version

R version to use to determine the correct Bioconductor version, if bioc = TRUE.

bioc

Whether to automatically add the Bioconductor repositories to the result.

cran_mirror

CRAN mirror to use. Leave it at NULL to use the mirror in getOption("repos") or an automatically selected one.

check_credentials

Whether to check that credentials are available for authenticated repositories.

Value

Data frame with columns:

  • all columns from the output of repo_get(),

  • auth_domains: authentication domains. pak tries to find the credentials for these domains, until the search is successful or all domains fail.

  • auth_domain: if the credential lookup is successful, then this is the authentication domain that was used to get the credentials.

  • auth_source: where the credentials were found. E.g. keyring:<backend> means it was in the default macos keyring.

  • auth_error: for failed credential searches this is the description of why the search failed. E.g. maybe the keyring package is not installed, or pak found no credentials for any of the authentication domains.

Details

pak will look up password for this url and username from the the user's .netrc file and from the system credential store using the keyring package. pak currently supports the following keyring backends:

  • Windows credential store,

  • macOS Keychain,

  • Linux Secret Service via libsecret, if built with libsecret support,

  • environment variables.

For the URL above it tries the following keyring keys, in this order:

https://<username>@repo-host/<repo-path>
https://repo-host/<repo-path>
https://<username>@repo-host
https://repo-host

To add an authenticated repository use repo_add() with the username argument. Alternatively, you can set the repos option directly using base::options() and including the username in the repository URL.

repo_auth() lists authentication information for all configured repositories.