feat(rest): access table data with the temporary credentials issued b… - #274
Draft
lucasfang wants to merge 1 commit into
Draft
feat(rest): access table data with the temporary credentials issued b…#274lucasfang wants to merge 1 commit into
lucasfang wants to merge 1 commit into
Conversation
…y the REST catalog
lucasfang
marked this pull request as draft
September 3, 2026 01:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: close #xxx
A
RestCatalogauthenticates its own requests, but the data of a table was still read and written with the storage credentials configured in the catalog options, which are scoped to the whole warehouse. This change lets the catalog server be the authority for data access as well, following theRESTTokenFileIOdesign of Java Paimon.RestApi::LoadTableTokencallsGET /v1/{prefix}/databases/{db}/tables/{table}/token. A 403 is reported to the caller as an error status carrying aRestErrorDetailinstead of being retried.RestTokenFileSystemloads the token of one table on first use, rebuilds its delegate once the token expires in less thankTokenExpirationSafeTimeMillis(1 hour, matching the Java constant), and forwards every operation to the delegate. The token overrides the catalog file system options, matchingRESTUtil.merge(catalogOptions, token.token());dlf.oss-endpointis applied on top asfs.oss.endpointwhen it is not empty.Catalog::GetTableFileSystem(identifier)returns the file system to use for a table. The default implementation returnsGetFileSystem(), soFileSystemCatalogand the other catalogs keep their current behavior.RestCatalogoverrides it and returns aRestTokenFileSystemonly whendata-token.enabledis set; it normalizes a system table or the main branch to the identifier of the table the credentials belong to, sodb.t$snapshotsanddb.t$branch_mainshare the credentials ofdb.t.GenericLruCachebounded to 1000 entries, matching themaximumSizeof the Java Caffeine cache. An evicted table is served by a new instance that loads a token of its own, so the bound trades a token request for a bounded footprint.sys.partitionslists the files of every table, so it now asks the catalog for the file system of each table instead of using the catalog-level one. A table that disappears while the query runs is skipped, like the existing handling of its location.Two new catalog options:
data-token.enabled(defaultfalse) anddlf.oss-endpoint.Callers opt in explicitly: