Closed fh-mthomson closed 7 months ago
Except that's not quite right either because running Sys.setenv()
in the console will mean that your secret is now in the .Rhistory
file 😞
Oof, right. I've updated the example to defer to an already-Renviron
-defined variable, but probably a broader symptom of environment variables not being overly secure (vs e.g. a Keychain / Hashicorp Vault approach to secrets).
@fh-mthomson do you use hashicorp vault? I've been trying to find someone who uses it to help me learn if there's something we should do to make it easier to use from R.
I do! As a starting point, check out https://github.com/vimc/vaultr (h/t @richfitz for the great work!)
General feedback:
vault_client()
-> login -> fetch secret from a given pathThanks for the tag Michael.
I've been trying to find someone who uses it to help me learn if there's something we should do to make it easier to use from R.
We've used vault from both R and python for the last ~7 years or so. If you want a chat/email/etc about what has worked well or not, feel free to drop me a line (rich.fitzjohn@gmail.com)
Thanks @richfitz & @fh-mthomson!
Pulls out helpful example from https://github.com/rstudio/rsconnect/issues/859#issuecomment-1600949465
This workflow and messaging was very clear and easy!
Additionally, it'd be helpful to mention
rsconnect
as an option to set env vars prior to deployment in the Posit Connect User Guide, which currently only references the Connect API.