-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Allow using GCS without providing credentials #25811
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
base: master
Are you sure you want to change the base?
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 |
I will take a look at the CLA once I get positive indication this change would be accepted. |
lib/trino-filesystem-gcs/src/main/java/io/trino/filesystem/gcs/GcsStorageFactory.java
Outdated
Show resolved
Hide resolved
5393800
to
2cb84cf
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 |
lib/trino-filesystem-gcs/src/test/java/io/trino/filesystem/gcs/TestGcsStorageFactory.java
Outdated
Show resolved
Hide resolved
lib/trino-filesystem-gcs/src/test/java/io/trino/filesystem/gcs/TestGcsStorageFactory.java
Outdated
Show resolved
Hide resolved
lib/trino-filesystem-gcs/src/test/java/io/trino/filesystem/gcs/TestGcsStorageFactory.java
Outdated
Show resolved
Hide resolved
When GCS credentials are otherwise unconfigured, do not re-throw an exception thrown by `GoogleCredentials.getApplicationDefault()`, which indicates that credentials are not available in the environment. This is consistent with the GCP SDK, and allows for anonymous access to GCS (or a GCS emulator).
2cb84cf
to
58698d5
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 |
CLA submitted. |
@cla-bot check |
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 |
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the default mode for these Credentials ? The default behaviour is to use the ApplicationDefaultCredentials right
@@ -99,7 +99,8 @@ public Storage create(ConnectorIdentity identity) | |||
return GoogleCredentials.getApplicationDefault(); | |||
} | |||
catch (IOException e) { | |||
throw new UncheckedIOException(e); | |||
// This is consistent with the GCP SDK when no credentials are available in the environment | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should we use NoCredentials
?
The default behavior of the library as linked to above/in the original issue is to call Passing My preference is what I had originally—if no credentials options are set, simply fall back to the default behavior of the library by not calling |
Description
If a JSON key or key file path are not provided, and using access tokens is not enabled, do not attempt to get the Application Default Credentials, instead allowing the GCS client library to use its own default behavior.
This will allow using Trino with custom GCS-compatible endpoints without auth, such as during development and testing.
Additional context and related issues
Fixes #25810
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: