feat: Support anonymous S3 access for public buckets#27758
Conversation
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
|
Awesome, I've submitted the signed CLA. |
|
|
||
| public boolean isAnonymousAccess() | ||
| { | ||
| return anonymousAccess; |
There was a problem hiding this comment.
Looking at:
- https://trino.io/docs/current/object-storage/file-system-azure.html#access-key-authentication
- https://trino.io/docs/current/object-storage/file-system-gcs.html#authentication
I see the use of an "authentication type" field to distinguish between the many potential ways to configure the authentication for s3 access.
This can be done though EVENTUALLY in a follow-up PR.
Or if we decide to add it - then we'd be working with
s3.auth-type=ANONYMOUS
There was a problem hiding this comment.
Great suggestion! I really like this direction to be honest. s3.auth-type would be more consistent with Azure/GCS and eventually, if there would be more types, they could be easily supported. I went with a boolean flag for simplicity, but see the value in the proposed idea.
However, before we implement this (now or in the follow-up PR), we need to clarify how this will interact with existing config parameters. For example, if the user doesn't specify an auth type, should we fail with an error or use the old logic (default credentials chain)?
I would be happy moving s3.auth-type to a separate PR. But let's create an issue or track it somewhere so that S3 isn't an exception when it comes to authentication configuration. In the meantime, I will see, how this can be implemented -- I'm relatively new to the codebase, but willing to learn more and contribute :D
There was a problem hiding this comment.
if the user doesn't specify an auth type, should we fail with an error or use the old logic (default credentials chain)?
When introducing the new configuration, we should deprecate the existing one. This preserves backward compatibility while providing users with a warning, giving them a transition period to adjust if necessary. For reference, see #26681 for details.
There was a problem hiding this comment.
Thanks for sharing this PR, it's helpful 👍
490a595 to
0afaf65
Compare
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
0afaf65 to
4696d3b
Compare
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
| } | ||
|
|
||
| @Config("s3.anonymous-access") | ||
| @ConfigDescription("Use anonymous credentials for accessing public S3 buckets") |
There was a problem hiding this comment.
please add config validation. when anonymous access is set, other authentication option should be left unset, as they are ignored (eg access/secret key)
see here for example validation:
There was a problem hiding this comment.
It's a good point! I've added validation to ensure that certain options are mutually exclusive.
4696d3b to
e3f9a2c
Compare
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Hmm, I've submitted signed CLA on Dec 25, 2025. Is there a way to follow-up on this? |
|
This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack. |
|
Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time. |
Description
This pull request introduces the ability to access public S3 storage anonymously.
Currently, when
fs.native-s3.enabledis set totrue, Trino utilizes an AWS credential provider chain that expects some form of credentials. If no credentials are found, the S3 client fails to initialize, preventing access to public datasets that do not require authentication.This PR adds a new configuration property,
s3.anonymous-access. When set totrue, theS3FileSystemwill use theAnonymousCredentialsProvider, allowing Trino to perform unsigned requests to public S3 buckets.Additional context and related issues
Fixes: #27512
The implementation is inspired from the comment in the original issue:
I've also done testing on my machine and it works:
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: