Skip to content

[Server] Validate Iceberg table location before vending credentials - #1749

Merged
yili-db merged 2 commits into
unitycatalog:mainfrom
timothyw553:fix/validate-iceberg-metadata-location
Aug 7, 2026
Merged

yili-db merged 2 commits into
unitycatalog:mainfrom
timothyw553:fix/validate-iceberg-metadata-location

Conversation

@timothyw553

@timothyw553 timothyw553 commented Aug 3, 2026 •

Copy link
Copy Markdown
Collaborator

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

The server stores a location for each table. An Iceberg metadata file also contains a table location. These two locations should describe the same table before the server creates temporary storage credentials.

Before this change, loadTable trusted the location inside the metadata file. For example, the registered table could point to /tables/orders while the metadata file pointed to /tables/other. The server could then create credentials for /tables/other.

This change compares the two normalized locations and rejects the request when they do not match. When they do match, credentials are created only for the registered table location.

The existing Iceberg table test now covers the mismatch case and checks that the request is rejected.

Tests: sbt -batch "server/testOnly io.unitycatalog.server.service.IcebergRestCatalogTest"

@yili-db yili-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please rebase

@timothyw553
timothyw553 force-pushed the fix/validate-iceberg-metadata-location branch from af57ad8 to 317501e Compare August 7, 2026 00:19
@timothyw553
timothyw553 requested a review from yili-db August 7, 2026 00:21

private static final String TEST_BASE_PREFIX = "/v1/catalogs/" + TestUtils.CATALOG_NAME;
private static final String TEST_BASE_NON_PREFIX = "/v1";
private static final String ICEBERG_TABLE_LOCATION = "/tmp/uniform_iceberg_table";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does it actually write anything out here? Prefer to use a @TempDir Path icebergTableLocation; instead.

@yili-db yili-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mostly good. Just a nit

@timothyw553
timothyw553 force-pushed the fix/validate-iceberg-metadata-location branch from ba30458 to 317501e Compare August 7, 2026 07:19
@timothyw553
timothyw553 requested a review from yili-db August 7, 2026 07:38
@yili-db
yili-db merged commit 9627f06 into unitycatalog:main Aug 7, 2026
16 checks passed
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