| Type: | Package |
| Title: | Save and Retrieve Name-Value Pairs to and from a File |
| Version: | 1.0.1 |
| Maintainer: | Koen Greuell <vlic@lifewatch.eu> |
| Description: | Facilitates secret management by storing credentials in a dedicated file, keeping them out of your code base. The secrets are stored without encryption. This package is compatible with secrets stored by the 'SecretsProvider' 'Python' package https://pypi.org/project/SecretsProvider/. |
| License: | Apache License (== 2.0) |
| Imports: | getPass |
| Suggests: | testthat (≥ 3.0.0) |
| RoxygenNote: | 7.3.2 |
| Config/testthat/edition: | 3 |
| URL: | https://CRAN.R-project.org/package=SecretsProvider |
| BugReports: | https://github.com/NaaVRE/SecretsProviderR/issues |
| NeedsCompilation: | no |
| Packaged: | 2025-08-19 11:48:30 UTC; koen-greuell |
| Author: | Koen Greuell [aut, cre] |
| Repository: | CRAN |
| Date/Publication: | 2025-08-19 12:20:12 UTC |
Save and Retrieve Name-Value Pairs to and from a File
Description
Facilitates secret management by storing credentials in a dedicated file, keeping them out of your code base. The secrets are stored without encryption. This package is compatible with secrets stored by the 'SecretsProvider' 'Python' package <https://pypi.org/project/SecretsProvider/>.
Details
Arguments:
secret_file_path Path to the file where secrets are stored. Defaults to ".env".
input_func Function to get input from the user. Defaults to getPass::getPass
Methods:
set_secret(secret_name): Retrieves Saves a secret If there is already a secret with the name given. Entering a new value will overwrite the existing secret.
get_secret(secret_name): Retrieves secret If this secret does not exist, it prompts the user to enter a secret and stores that.
remove_secret(secret_name): Remove a secret
Author(s)
Koen Greuell
Maintainer: Koen Greuell
Examples
# Create a SecretsProvider object
secretsProvider <- SecretsProvider(secret_file_path = tempfile(),
input_func = function(prompt) { "mock_input"})
# Set a secret
secretsProvider$set_secret("Data_source_API_key")
# Get a secret
api_key <- secretsProvider$get_secret("Data_source_API_key")
# Remove a secret
secretsProvider$remove_secret("Data_source_API_key")