Support pluggable bearer token provider with expiry-based refresh for REST catalog (workload identity token exchange)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- aws, java, kubernetes, spark
調査の方向性
Start by reading the REST catalog authentication code and the related file-based BearerAuthManager issue #18754. The request proposes a provider interface and specifies refresh timing, retries, 401 handling, and sharing across catalog sessions and tables; locate the existing authentication entry points and tests before assessing the design. Done means provider configuration works and tests cover refresh timing, retry after failure, and concurrent access.
索引モデルが issue の本文から書いたものです。
説明
Feature Request / Improvement
Problem
We run Spark jobs on Kubernetes (EKS) that authenticate to an Iceberg REST catalog (Databricks Unity Catalog's Iceberg REST endpoint) using workload identity. Each job has a short-lived subject token, the pod's projected service account token, which is exchanged at the catalog's OIDC endpoint (RFC 8693) for a short-lived access token. We want this without distributing a client secret to the job, and with token lifetimes kept short for security reasons.
Existing options don't fit this pattern:
tokenis a static value. Long-running jobs fail once it expires.rest.auth.type=oauth2withcredentialrequires a client ID and secret, which we're trying to avoid.BearerAuthManager(#18754) reads the token from a file on a fixed reload interval. Iceberg doesn't check token expiry, so refresh timing depends on an external producer writing the file ahead of expiry. Iceberg never calls that producer, and a stale file causes requests to fail.
Requested capability
Let users configure a token provider class that Iceberg calls to obtain a bearer token. Iceberg should own the refresh schedule: refresh a configurable margin before expiresAt, retry on failure while keeping the current token, invalidate and fetch again on a 401, and share one token across sessions and tables in a catalog.
Proposed interface
public interface BearerTokenProvider extends AutoCloseable {
/** Returns a valid access token and its expiry. Called on startup, before expiry, and after a 401. */
BearerToken fetchToken() throws IOException;
}
public record BearerToken(String value, Instant expiresAt) {}
Configuration (names are a suggestion):
rest.auth.type=bearer
rest.auth.bearer.token-provider=com.example.TokenExchangeProvider
rest.auth.bearer.token-provider.<key>=<value> # passed to the provider
Acceptance criteria
- Refresh happens before
expiresAtminus a configurable margin, not on a fixed interval. - If a refresh fails, the current token stays in use and a retry is scheduled.
- A 401 triggers one immediate re-fetch.
- One token is shared by all sessions and tables in a catalog.
- Provider configuration is passed through, and Iceberg needs no secrets in its own config.
- Tests cover refresh timing, retry on failure, and concurrent access.
Use cases
- Kubernetes projected service account token exchanged with the catalog's identity provider
- Cloud workload identity (AWS, GCP, Azure) exchanged for a catalog access token
- Platform-issued federation tokens for any REST catalog that supports token exchange
Related: #18754 (file-based BearerAuthManager), #13550 (original bearer-from-file request)
Environment: Iceberg 1.9+, Spark (version), Scala (version), Kubernetes (EKS)
Contribution: I can contribute a patch if the design is acceptable.
Query engine
Spark
Willingness to contribute
- I can contribute this improvement/feature independently
- I would be willing to contribute this improvement/feature with guidance from the Iceberg community
- I cannot contribute this improvement/feature at this time
- 主要言語
- Java
- スター
- 9.4k
- フォーク
- 3.7k
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 169
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/iceberg のほかの issue
-
Spark: Test INSERT targets with computed IDENTIFIER expressions対応中かも @shivadarshan-devadiga が 8 日前に担当しました。 オープンimprovement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scan対応中かも @Ankitkj1999 が 10 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Flink: JdbcLockFactory concurrent lock-table creation can fail with "table already exists" and restart the job対応中かも @adiranjan25 が 17 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/iceberg#18797 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Core: TableMetadata.Builder allows adding encryption keys to v1/v2 tables対応中かも @yusufyildiz34 が 29 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/iceberg#18632 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToList対応中かも @mohamed-elbrik が 34 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
hermes-queue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
chrisalunlloyd2-sudo/mindpalace#430 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
unitycatalog/unitycatalog#2363 ·
メンテナーはふだん 1 日以内に返信
-
area: editor P3 type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
halisonworks/mod-codeling#290 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
area/dependencies area/dependencies/js backport/26.6 backport/26.8 kind/cve severity/medium source/scan-dependencies status/triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 2 日以内に返信