-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Support vended s3 credentials in the Iceberg REST catalog #20186
Conversation
Pushed another commit to fix NPE and remove redundant annotation. Feel free to drop or edit the commit. |
@danielcweeks can you please take a look? |
@@ -81,13 +83,18 @@ public synchronized TrinoCatalog create(ConnectorIdentity identity) | |||
warehouse.ifPresent(location -> properties.put(CatalogProperties.WAREHOUSE_LOCATION, location)); | |||
properties.put("trino-version", trinoVersion); | |||
properties.putAll(securityProperties.get()); | |||
|
|||
if (vendedCredentialsEnabled) { | |||
properties.put("header.x-tabular-s3-access", "vended_credentials"); |
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.
We should probably standardize this to something like header.x-iceberg-s3-access
so we don't reference Tabular specifically. We can add this to the REST Spec as a signal that the client is requesting credentials.
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.
@danielcweeks was this ever standardized?
@alexjo2144 minor comments, but I was able to get this running with our smoke tests, and everything passed. |
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.
Looks good at a high level. This is the design we discussed. I haven’t had time to do a full review yet.
lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3Context.java
Outdated
Show resolved
Hide resolved
lib/trino-filesystem/src/main/java/io/trino/filesystem/s3/S3FileSystemConstants.java
Outdated
Show resolved
Hide resolved
public TrinoFileSystem create(ConnectorIdentity identity, Map<String, String> fileIoProperties) | ||
{ | ||
if ("true".equals(fileIoProperties.get(REMOTE_SIGNING_ENABLED))) { | ||
throw new TrinoException(NOT_SUPPORTED, "Remote signing is not supported"); |
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.
When would this error occur? If this is a bug/problem with the REST catalog service, we should add a new Iceberg specific error code. It's not something unsupported in Trino.
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.
On second thought, I think we should take this check out alltogether. If the rest catalog server requests remote signing ignore it and use any credentials the user may have provided in the Trino config file.
.../src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogFileSystemFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogFileSystemFactory.java
Outdated
Show resolved
Hide resolved
...ino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogModule.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergWritableTableHandle.java
Outdated
Show resolved
Hide resolved
5c0362a
to
a7ee284
Compare
a7ee284
to
3f1302c
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSourceProvider.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogFileSystemFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogFileSystemFactory.java
Show resolved
Hide resolved
@@ -81,13 +83,18 @@ public synchronized TrinoCatalog create(ConnectorIdentity identity) | |||
warehouse.ifPresent(location -> properties.put(CatalogProperties.WAREHOUSE_LOCATION, location)); | |||
properties.put("trino-version", trinoVersion); | |||
properties.putAll(securityProperties.get()); | |||
|
|||
if (vendedCredentialsEnabled) { | |||
properties.put("header.x-tabular-s3-access", "vended_credentials"); |
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.
@danielcweeks was this ever standardized?
...eberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoIcebergRestCatalogFactory.java
Show resolved
Hide resolved
...va/io/trino/plugin/iceberg/catalog/rest/TestIcebergVendingRestCatalogConnectorSmokeTest.java
Show resolved
Hide resolved
...containers/src/main/java/io/trino/testing/containers/IcebergRestCatalogBackendContainer.java
Outdated
Show resolved
Hide resolved
84c5612
to
497f7c1
Compare
Thanks for the review @electrum, addressed those couple comments and resoled conflicts. |
It looks like we'll need to add |
497f7c1
to
4c44ca6
Compare
I did wind up having to put those back in. They're used directly in the test as well, to set up the temporary session auth. |
Does this need a release note? cc @alexjo2144 @electrum |
Description
Additional context and related issues
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.
( ) Release notes are required, with the following suggested text: