Skip to content

Commit

Permalink
If any S3 cred is passed, use it instead. (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelbranco80 authored Aug 9, 2024
1 parent e306269 commit 3c5c420
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ public Object executeGeneric(VirtualFrame frame) {
// The docs say:
// "If the S3 bucket is not registered in the credentials storage, then the region, accessKey
// and secretKey must be provided as arguments."
// However, if the access key/secret key are passed, they should be used.
RawContext context = RawContext.get(this);
S3Path location;

if (context.existsLocationConfig(bucket) && context.getLocationConfig(bucket).hasS3()) {
if (this.accessKey == null
&& this.secretKey == null
&& context.existsLocationConfig(bucket)
&& context.getLocationConfig(bucket).hasS3()) {
LocationConfig l = context.getLocationConfig(bucket);
S3Config s3Config = l.getS3();
Option<String> maybeAccessKey =
Expand Down

0 comments on commit 3c5c420

Please sign in to comment.