
improveConnect
improveConnect.RdimproveConnect establishes a connection to the improve repository using one of two authentication methods:
Authentication Methods:
Run Tokens (Production): When a step is executed from improve platform, a run token is automatically provided
OAuth (Interactive): User authentication with browser or headless mode for development/interactive use
Required Environment Variables:
For Run Token Authentication:
IMPROVER_TOKEN: the run token (mandatory)
IMPROVER_REPO_URL: repository URL (mandatory)
IMPROVER_STEP: step ID for relative path resolution (optional)
IMPROVER_WORKSPACE: workspace directory (optional, defaults to current directory)
For OAuth Authentication:
IMPROVER_REPO_URL: repository URL (mandatory)
IMPROVER_STEP: step ID for relative path resolution (mandatory)
IMPROVER_HEADLESS_OAUTH: set to any non-empty value to enable headless OAuth mode (optional)
IMPROVER_WORKSPACE: workspace directory (optional, defaults to current directory)
Optional Environment Variables (both methods):
IMPROVER_SECURITY: set to "insecure" to disable certificate verification
Connection information sources (in descending priority):
via the command line
via environment variables
via a conf.json file
Command line
Command line arguments have to be in the correct order.
run token (reqToken)
step ID (shortEntityId) for relative path resolution
the repository URL in the format https://repoaddress:repoPort/repository
run workspace path
Conf.json file
The file has to be located in the working directory and contain the following details:
reqToken: run token (if not provided, OAuth authentication will be used)
stepId: step ID for relative path resolution (mandatory for OAuth)
repoUrl: repository URL (mandatory)
runWorkspace: workspace directory
Usage
improveConnect(
logLevel = "INFO",
secure = TRUE,
offlinePossible = FALSE,
persistentCaching = FALSE
)Arguments
- logLevel
Log verbosity level. Possible values: DEBUG, INFO, WARN, ERROR. Default is "INFO". Can be overridden by environment variable IMPROVE_LOG_LEVEL.
- secure
If TRUE (default), SSL certificates are validated. If FALSE, certificate validation is disabled - this allows connections with expired or self-signed certificates but is NOT recommended for production use. Can be overridden by setting environment variable IMPROVER_SECURITY="insecure".
- offlinePossible
If TRUE, the setup continues even if no connection is possible. Default is FALSE.
- persistentCaching
If TRUE, caches are persisted to and reloaded from
.improver.cachefile. Default is FALSE.
Value
Invisibly returns NULL. Called for its side effects:
Establishes authenticated connection to the improve repository
Sets internal configuration
Initializes logging with specified verbosity level
Optionally loads persistent cache from
.improver.cache
After successful connection, use pwd to verify the current
working step and whoami to confirm the authenticated user.
See also
improveConnected to check if connected,
improveDisconnect to close connection,
setEditable to enable write operations,
whoami to get current user,
pwd to get current step
Examples
if (FALSE) { # \dontrun{
# Basic connection using environment variables
# (Set IMPROVER_REPO_URL and IMPROVER_STEP in .Renviron)
improveConnect()
# Verify connection
whoami()
pwd()
# Connection with debug logging for troubleshooting
improveConnect(logLevel = "DEBUG")
# Development connection with self-signed certificates
improveConnect(secure = FALSE)
# Enable write operations after connecting
improveConnect()
setEditable(TRUE)
} # }