huan233usc opened a new pull request, #2661:
URL: https://github.com/apache/iceberg-rust/pull/2661
## Which issue does this PR close?
Prerequisite for #1690 (client support for server-side REST scan planning).
## What changes are included in this PR?
First-class support for the `storage-credentials` a REST catalog can vend, so
table reads use catalog-provided, per-location credentials instead of relying
only on static FileIO properties.
## Design
```
GET/POST → REST response carries `storage-credentials`
[{ prefix: "s3://bucket/db/tbl", config: { <creds...> } }, ...]
│
RestCatalog parses them ─► FileIOBuilder::with_storage_credentials(..)
│
StorageConfig { props, credentials: Vec<StorageCredential> }
│ resolve_credential(location): longest-prefix
match
▼
OpenDalResolvingStorageFactory picks the matching credential per object
path
at read time → builds the Operator with those creds
```
### Components
- **`StorageConfig`** now holds per-prefix `StorageCredential`s and exposes
`resolve_credential(location)` (longest-prefix match) and
`resolved_props(location)`.
- **`FileIOBuilder::with_storage_credentials`** attaches vended credentials
to a
`FileIO`.
- **`OpenDalResolvingStorageFactory`** selects the right credential for each
object path when constructing the backend, so a single `FileIO` can span
multiple credential prefixes.
- **REST catalog** parses `storage-credentials` from `LoadTableResult` and
wires
them into the table's `FileIO`.
### Why this is a prerequisite for scan planning
Server-side scan planning returns data files whose access is authorized by
credentials the server vends (in the load-table response and/or the scan-plan
response). The scan-planning client reads those files through a `FileIO`
built
with `with_storage_credentials` + the resolving factory introduced here, so
this
credential plumbing lands first as a standalone, independently-reviewable
change.
## Are these changes tested?
Yes — unit tests for `StorageConfig` credential resolution (longest-prefix),
the resolving storage factory, and a REST-catalog test asserting `load_table`
attaches vended `storage-credentials` to the table `FileIO`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]