sungwy opened a new pull request, #19165:
URL: https://github.com/apache/iceberg/pull/19165
### What the spec allows today
The loadTable and loadView descriptions say the config may carry credentials
for subsequent requests: the `token` key as a bearer token, or an RFC 8693
token type as the key, for example
`urn:ietf:params:oauth:token-type:jwt=<JWT-token>`. LoadTableResult and
LoadViewResult list `token` under General Configurations.
In the Java client, RESTSessionCatalog passes the response config to
AuthManager.tableSession. The legacy OAuth2Manager uses `token` as the bearer
token for the table's requests, and exchanges a token-type key with the
caller's session as the actor. The OAuth2 auth manager v2, under review in
#18756, does not support vended tokens.
### Why deprecate
1. **The catalog API should not be a channel for issuing tokens.** The
`/v1/oauth/tokens` endpoint was deprecated in 1.6.0 after the discussion
"Addressing security questions in the Iceberg REST specification" (#10537). A
central concern was that the endpoint pushed catalog operators into the
authorization service business. Table and view config is a second token channel
on the same API.
2. **Three session sources with no defined precedence.** RESTSessionCatalog
builds the session for each request through three AuthManager methods:
`catalogSession`, `contextualSession` and `tableSession`. Neither the spec nor
the API defines how a table credential ranks against the engine's context
credentials or the catalog's own, so each AuthManager decides. This couples the
server to the client's AuthManager implementation: whether a table token takes
effect depends on which AuthManager the client runs. Choosing the credential
for each request should be up to the client's AuthManager and the engine's
session context, not something a load response redirects per table.
Without table credentials, whatever selects a request's credentials, the
engine or the AuthManager, chooses only between the catalog session and the
context credentials. That choice is already involved for multi-user engines:
https://s.apache.org/user-auth-session-in-file-io
### Current use
- Servers, read from source: Polaris (`0c06f6c`), Lakekeeper (`b31a7df`),
Gravitino (`79eea04`), Unity Catalog OSS (`300fde9`) and Nessie (`23837a6`)
return none of these keys. Gravitino's federation mode strips them from remote
responses.
- Java: the legacy OAuth2Manager honors `token` and the token-type keys. v2
does not.
- PyIceberg: `commit_table` sends a table `token` as the Authorization
header. The auth manager's header replaces it whenever the manager supplies one.
- iceberg-rust: its AuthManager has no table-session method, so every table
request uses the caller's session. The config is merged into FileIO properties
only, where no storage implementation reads `token`.
- iceberg-go: does not use them for catalog table requests.
### Change
- loadTable and loadView descriptions: the paragraph describing credentials
in the config is removed.
- LoadTableResult and LoadViewResult: `token` is marked **DEPRECATED** under
General Configurations.
The config map stays a free-form string map, so no server or client becomes
non-conformant. Follow-up PRs deprecate the support in the legacy Java
OAuth2Manager and PyIceberg.
### Test plan
Ran `make lint` and `make generate` in `open-api/`. The regenerated
`rest-catalog-open-api.py` changes only the two `token` docstring lines.
### AI Disclosure
Model: Claude Opus 5.5.
Platform/Tool: Claude Code.
Human Oversight: Sung Yun.
Prompt Summary: the spec edits and description were drafted with Claude
Code; the proposal and scope are the author's.
--
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]