Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameters for S3 credentials #124

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Conversation

snbianco
Copy link
Collaborator

Added parameters to asdf_cut that allow the user to provide an S3 access key (key), secret access key (secret), or security token (token). These should only have an impact for private S3 buckets (is_anon = False), so I left in the logic to determine if a bucket is public or private.

@snbianco snbianco requested a review from havok2063 July 30, 2024 01:37
@snbianco snbianco marked this pull request as ready for review July 30, 2024 01:44
@@ -38,7 +45,7 @@ def _get_cloud_http(s3_uri: Union[str, S3Path], verbose: bool = False) -> str:
print(f'Attempting to access private S3 bucket: {s3_path.bucket}')

# create file system and get URL of file
fs = s3fs.S3FileSystem(anon=is_anon)
fs = s3fs.S3FileSystem(anon=is_anon, key=key, secret=secret, token=token)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want a check here to make sure one of the access inputs is set when is_anon is False?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For certain cases, a credential may not be needed. For instance, RSP doesn't need to pass credentials because the environment has direct access to the private S3 bucket.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes sense, thanks!

@snbianco snbianco merged commit 1d3120e into main Jul 31, 2024
8 checks passed
@snbianco snbianco deleted the ASB-28123-cloud-credentials branch July 31, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants