Skip to content

feat(rest): use vended storage credentials from LoadTable response#2651

Open
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:feat/rest-vended-credentials
Open

feat(rest): use vended storage credentials from LoadTable response#2651
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:feat/rest-vended-credentials

Conversation

@plusplusjiajia

Copy link
Copy Markdown
Member

What

load_table / create_table now request vended credentials via the
X-Iceberg-Access-Delegation: vended-credentials header and merge the returned
storage_credentials into the FileIO properties. LoadTableResult already
exposes storage_credentials (its doc even says clients should prefer it over
config), but the field was never used.

Why

REST catalogs that vend per-table credentials return them in storage_credentials. Without requesting delegation and merging them, FileIO is built without credentials and data access fails.

Changes

  • Send X-Iceberg-Access-Delegation: vended-credentials on load/create.
  • New table_file_io_config() merges config + storage_credentials
    (longest prefix wins) + catalog props.
  • update_table reloads after commit to return a credentialed FileIO
    (CommitTableResponse carries no credentials).

@plusplusjiajia plusplusjiajia force-pushed the feat/rest-vended-credentials branch from ac46430 to 894d5cf Compare June 15, 2026 12:01

@xanderbailey xanderbailey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR, I had a quick look and left some comments / questions.

.client
.request(Method::GET, context.config.table_endpoint(table_ident))
// Opt in to vended storage credentials.
.header("X-Iceberg-Access-Delegation", "vended-credentials")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Java will read these headers off the catalog config, should we do the same?

header.X-Iceberg-Access-Delegation

Link to Java

let file_io = self
.load_file_io(Some(&response.metadata_location), None)
.await?;
.load_table(commit.identifier())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A full load table seems heavy to me. Can we not wire in the pre-credentialed FileIO into this method somehow?

}

/// FileIO props: server `config`, then vended `storage_credentials` (longest prefix wins), then user props.
fn table_file_io_config(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I also notice that Java constructs clientByPrefix Link which keeps credentials separate per prefix. So we can't support multi-location tables here I think? Also it would silently fail in those cases which I don't think is ideal? WDYT?

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