Skip to content

Commit

Permalink
new SetCreds!!
Browse files Browse the repository at this point in the history
  • Loading branch information
vortexing committed Apr 16, 2020
1 parent 989a133 commit 971169c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/setCreds.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ setCreds <- function(path, tokenSet="file") {
Sys.setenv(S3SA=Sys.getenv("PAGASECRET2"))
}
Sys.setenv(REDURI="https://cdsweb07.fhcrc.org/redcap/api/")
if ("" %in% Sys.getenv(c("AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"))) {
# if the person is still using the old set of creds, repurpose them
Sys.setenv(AWS_ACCESS_KEY_ID = Sys.getenv("S3A"),
AWS_SECRET_ACCESS_KEY = Sys.getenv("S3SA"),
AWS_DEFAULT_REGION = "us-west-2")
if ("" %in% Sys.getenv(c("REDURI", "TGR", "S3A", "S3SA", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_DEFAULT_REGION"))) {
AWS_SECRET_ACCESS_KEY = Sys.getenv("S3SA")}
Sys.setenv(AWS_DEFAULT_REGION = "us-west-2")
if ("" %in% Sys.getenv(c("REDURI", "TGR", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_DEFAULT_REGION"))) {
stop("You have missing environment variables. Please set env vars.")} else message("Credentials set successfully.")
}

0 comments on commit 971169c

Please sign in to comment.