Skip to content

fix(lance-io): request vended credentials explicitly in namespace provider - #7978

Open
rpgreen wants to merge 1 commit into
lance-format:mainfrom
rpgreen:rpgreen/vend-credentials-explicit
Open

fix(lance-io): request vended credentials explicitly in namespace provider#7978
rpgreen wants to merge 1 commit into
lance-format:mainfrom
rpgreen:rpgreen/vend-credentials-explicit

Conversation

@rpgreen

@rpgreen rpgreen commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

LanceNamespaceStorageOptionsProvider::fetch_storage_options now sends vend_credentials: Some(true) in its describe_table request.

Why

This provider is invoked specifically to obtain credentials for opening a namespace-backed dataset, yet it left vend_credentials unset. Per the lance-namespace spec, an unset flag lets the server decide whether to vend, and some server implementations only vend credentials when explicitly asked.

When such a server returns no credentials, build_aws_credential (lance-io/src/object_store/providers/aws.rs) falls through its resolution chain to the AWS SDK DefaultCredentialsChain. In an environment without ambient AWS credentials this fails (e.g. Failed to get AWS credentials: ... FailedToLoadToken), even though the namespace could have vended scoped credentials.

Explicitly requesting vending makes the client's intent unambiguous and avoids the silent fall-through to the default chain.

Impact

Low risk. The provider is only used when opening namespace-backed datasets that need credentials. Servers that already vend on an unset flag are unaffected (they vend either way); servers that gate on the flag now correctly vend.

🤖 Generated with Claude Code

…vider

`LanceNamespaceStorageOptionsProvider` fetches storage options precisely
because it needs credentials to open a namespace-backed dataset, yet it left
`vend_credentials` unset. Per the lance-namespace spec, an unset flag lets the
server decide whether to vend, and some implementations only vend when asked.

When such a server returns no credentials, `build_aws_credential` falls through
to the AWS SDK `DefaultCredentialsChain`, which fails in environments without
ambient credentials -- even though the namespace could have vended scoped ones.

Set `vend_credentials: Some(true)` so the provider always opts in explicitly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added A-encoding Encoding, IO, file reader/writer bug Something isn't working labels Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The namespace storage options provider now explicitly requests credential vending when issuing a table description request.

Changes

Namespace storage credentials

Layer / File(s) Summary
Enable credential vending
rust/lance-io/src/object_store/storage_options.rs
fetch_storage_options sets vend_credentials to Some(true) in DescribeTableRequest and documents the explicit request.Estimated code review effort: 1 (Trivial)

Suggested reviewers: jackye1995, xuanwo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: explicitly requesting vended credentials in the namespace provider.
Description check ✅ Passed The description directly explains the code change, rationale, and impact of requesting vended credentials.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rust/lance-io/src/object_store/storage_options.rs`:
- Around line 141-142: Add a mock-client regression test covering the
storage-options path that builds DescribeTableRequest, capture the outgoing
request, and assert its vend_credentials field is Some(true). Keep the test
focused on explicit credential vending and ensure it guards against fallback to
ambient AWS credentials.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: cb567c80-b29a-45d0-91ab-f2c008e475f6

📥 Commits

Reviewing files that changed from the base of the PR and between 9a0f64f and e1bc326.

📒 Files selected for processing (1)
  • rust/lance-io/src/object_store/storage_options.rs

Comment on lines +141 to +142
// Some server implementations may not return credentials unless explicitly requested
vend_credentials: Some(true),

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Add a regression test for explicit credential vending.

Capture the outgoing DescribeTableRequest in a mock-client test and assert vend_credentials == Some(true). This prevents a future change from silently reintroducing ambient AWS credential fallback.

As per coding guidelines: “Every bugfix and feature must have corresponding tests.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rust/lance-io/src/object_store/storage_options.rs` around lines 141 - 142,
Add a mock-client regression test covering the storage-options path that builds
DescribeTableRequest, capture the outgoing request, and assert its
vend_credentials field is Some(true). Keep the test focused on explicit
credential vending and ensure it guards against fallback to ambient AWS
credentials.

Source: Coding guidelines

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rpgreen rpgreen closed this Jul 24, 2026
@rpgreen rpgreen reopened this Jul 27, 2026

@westonpace westonpace left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In what cases is the field ever set to false? Just when it is used for the initial load?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-encoding Encoding, IO, file reader/writer bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants