keyring (version 1.1.0)

backend_env: Store secrets in environment variables

Description

This is a simple keyring backend, that stores/uses secrets in environment variables of the R session.

Usage

backend_env

Arguments

Format

An object of class R6ClassGenerator of length 24.

Details

It does not support multiple keyrings. It also does not support listing all keys, since there is no way to distinguish keys from regular environment variables.

It does support service names and usernames: they will be separated with a : character in the name of the environment variable. (Note that such an environment variable typically cannot be set or queried from a shell, but it can be set and queried from R or other programming languages.)

See backend for the documentation of the class's methods.

See Also

Other keyring backends: backend_file, backend_macos, backend_secret_service, backend_wincred

Examples

Run this code
# NOT RUN {
env <- backend_env$new()
env$set("r-keyring-test", username = "donaldduck")
env$get("r-keyring-test", username = "donaldduck")
Sys.getenv("r-keyring-test:donaldduck")

# This is an error
env$list()

# Clean up
env$delete("r-keyring-test", username = "donaldduck")
# }

Run the code above in your browser using DataLab