-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- as part of addressing six_file_upload, reworked s3 connection acquisition for paws and s3fs - rework tests to work with new s3 connection - rename random_str to random_db_id_str
- Loading branch information
Showing
35 changed files
with
359 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
LOCALSTACK_ENDPOINT <- "http://localhost.localstack.cloud:4566" # nolint | ||
|
||
#' Get the `paws` S3 client | ||
#' @return a list with methods for interfacing with IAM; | ||
#' see <https://www.paws-r-sdk.com/docs/s3/> | ||
#' @keywords internal | ||
con_s3 <- function() { | ||
set_s3_interface(Sys.getenv("AWS_PROFILE", "aws")) | ||
} | ||
|
||
#' s3fs connection | ||
#' @examplesIf interactive() | ||
#' con <- con_s3fs() | ||
#' file_copy <- con_s3fs()$file_copy | ||
con_s3fs <- function() { | ||
profile <- Sys.getenv("AWS_PROFILE") | ||
if (profile == "minio") { | ||
s3fs::s3_file_system( | ||
aws_access_key_id = Sys.getenv("MINIO_USER"), | ||
aws_secret_access_key = Sys.getenv("MINIO_PWD"), | ||
endpoint = Sys.getenv("MINIO_ENDPOINT"), | ||
refresh = TRUE | ||
) | ||
} else if (profile == "localstack") { | ||
s3fs::s3_file_system( | ||
aws_access_key_id = "NOTAREALKEY", | ||
aws_secret_access_key = "AREALLYFAKETOKEN", | ||
endpoint = LOCALSTACK_ENDPOINT, | ||
refresh = TRUE | ||
) | ||
} else { | ||
s3fs::s3_file_system( | ||
aws_access_key_id = Sys.getenv("AWS_ACCESS_KEY_ID"), | ||
aws_secret_access_key = Sys.getenv("AWS_SECRET_ACCESS_KEY"), | ||
region_name = Sys.getenv("AWS_REGION"), | ||
refresh = TRUE | ||
) | ||
} | ||
} |
Oops, something went wrong.