The craneR package allows to you both upload and download artifacts from a Crane repository.
Crane is a repository webserver with advanced authentication and authorization (using OpenID Connect) for hosting data science artifacts, documentation, …
The first step is to tell craneR about your Crane repository and identity provider.
You can do so with the register function. You will only need to this once per repository.
You will need the following:
client_id: an OAuth2 client id.device_code_url: this is the starting point for the OAuth2 device code flow by which
craneR will obtain tokens to authenticate against the Crane repository.token_url: this is the endpoint where craneR will obtain the token at the end of the OAuth2 flowscope: a set of OAuth2 scopes.The particulars will depend on the identity provider, the next sections will show examples for a few identity providers
CraneR has been tested with.
Repository configuration is kept in a configuration file. The default location for this file is based on the
XDG specification (see ?default_config_file). You can change this by setting the R option crane.repo.config
or the environment variable CRANE_REPO_CONFIG.
You will need:
client_idtenant_id: https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-idcraneR::register(
repo,
client_id = "<client id>",
device_code_url = "https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/devicecode",
token_url = "https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token",
scope = "<client_id>/.default"
)