Allow supplying a KmsClient instance/supplier instead of only a reflectively-instantiated class name
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
まず KeyToolkit.getKmsClient(...) と、既存の CryptoFactory、DecryptionPropertiesFactory、EncryptionPropertiesFactory のリフレクション経路を読みます。maintainer と推奨する API およびストレージメカニズムを確認してから、引数なしコンストラクターを持たない、提供された KmsClient のテストカバレッジを追加し、リフレクションによる構築と initialize(...) の動作を維持します。
索引モデルが issue の本文から書いたものです。
説明
Describe the enhancement requested
The key-tools KMS integration (org.apache.parquet.crypto.keytools) instantiates the KmsClient purely by reflection from a class name: KeyToolkit.getKmsClient(...) reads parquet.encryption.kms.client.class and calls newInstance(), requiring a public no-arg constructor, with credentials expected to arrive later via KmsClient.initialize(conf, kmsInstanceID, kmsInstanceURL, accessToken). The same reflective no-arg pattern applies to CryptoFactory / DecryptionPropertiesFactory / EncryptionPropertiesFactory via parquet.crypto.factory.class.
This works well when a KMS client is stateless and can bootstrap all of its credentials from the Configuration plus the access-token string. It does not work for clients that must be constructed with their dependencies and can't be reduced to a class name + string token, e.g.:
- clients holding a live, credential-bearing SDK handle (federated / workload-identity credentials that aren't representable as a token string);
- clients created and wired by a dependency-injection container;
- in-memory / fake KMS clients used in tests, which carry per-test state and have no meaningful no-arg form.
For these, users must build a static side-channel: register the real instance in a static map keyed by a UUID written into the Configuration, point parquet.encryption.kms.client.class at a thin reflective shim that looks the instance back up in initialize(), and override parquet.encryption.kms.instance.id per instance to avoid colliding on KeyToolkit's per-(kmsInstanceID, accessToken) client cache. That's global mutable state with its own lifecycle/leak management and a one-Configuration-per-client invariant — boilerplate every such user reinvents.
Proposal. Add an opt-in, fully backward-compatible way to supply a pre-built KmsClient (or a Supplier<KmsClient> / small factory) programmatically, which KeyToolkit.getKmsClient(...) prefers over class-name reflection when present. Reflection stays the default, so existing configs are untouched. Rough shape (names TBD):
// today (still works):
conf.set("parquet.encryption.kms.client.class", "com.example.MyKmsClient");
// proposed addition:
KeyToolkit.setKmsClientFactory(conf, () -> myPreBuiltKmsClient); // or a KmsClientFactory
initialize(...) would still be invoked on the supplied instance, so credential/token plumbing is unchanged.
Scope / non-goals. No new dependencies and no vendor-specific code — this is only about how a KmsClient is provided, not which one. PropertiesDrivenCryptoFactory, the KeyMaterial format, caching, per-column keys, and key-rotation tooling are all unchanged; this only lifts the requirement that the client be reflectively no-arg constructible.
Question for maintainers. Would a change along these lines be welcome? And do you prefer (a) a Supplier<KmsClient> set on the Configuration / read-write options, or (b) a settable KmsClientFactory on KeyToolkit? Happy to implement it and open a PR (with tests using a non-no-arg client) once there's agreement on direction.
Component(s)
Core
- 主要言語
- Java
- スター
- 3.1k
- フォーク
- 1.6k
- 平均マージ
- 4日 5時間
- マージ済み PR(30日)
- 30
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/parquet-java のほかの issue
-
Row-group copying collides for distinct column paths with the same dot string対応中かも @costas-db が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
apache/parquet-java#3829 ·
メンテナーはふだん 2 日以内に返信
-
Binary statistics truncation test ignores its configured truncation length対応中かも @dhruv-15-03 が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
apache/parquet-java#3820 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/parquet-java#3767 ·
メンテナーはふだん 2 日以内に返信
-
Remove duplicate LICENSE and NOTICE files from benchmark JARs対応中かも @efegokdemir が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/parquet-java#3695 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Close input readers when ParquetRewriter setup fails対応中かも @anxkhn が 82 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/parquet-java#3667 ·
メンテナーはふだん 2 日以内に返信
apache/parquet-java の issue をすべて見る
似ている issue
-
Clarify Javadoc for Logger methods taking Object... arguments with regards to Throwable detectionオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
[Bug] The shared instance selector's placeholder and no-match text ignore the display language対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
apache/rocketmq-dashboard#5561 ·
メンテナーはふだん 3 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
HMCL-dev/HMCL#6934 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
test(setup): GitHub configuration tests fail when the temp path is long enough for YAML folding対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug good first issue help wanted priority medium size S
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
martin-francois/symphony-trello#776 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信