box / box/box-java-sdk

Make IPrivateKeyDecryptor Instantiation Configurable in JWTEncryptionPreferences to avoid compilation-time errors

オープン
#1,310 コメント 1 件 リアクション 0 件 担当者 5 名 @mwwoda が担当を希望しています GitHub で見る
enhancement
主要言語
Java
スター
170
フォーク
189
平均マージ
20時間 26分
マージ済み PR(30日)
22

説明

### Is your feature request related to a problem? Please describe.
The class `JWTEncryptionPreferences` has a private `IPrivateKeyDecryptor` field (`privateKeyDecryptor`) that is instantiated immediately with `BCPrivateKeyDecryptor()`. Although it is possible to override the `IPrivateKeyDecryptor` later via a call to `boxConfig.setPrivateKeyDecryptor`, by the time this becomes possible, `BCPrivateKeyDecryptor()` has already been instantiated. `BCPrivateKeyDecryptor` imports `BouncyCastleProvider`, which we exclude from dependencies to ensure that only FIPS-compliant BouncyCastle libraries are present, resulting in a failure.

### Describe the solution you'd like
It would be helpful if the instantiation of `JWTEncryptionPreferences` became more configurable. For example, moving this instantiation to a default constructor while allowing an alternative constructor, or utilizing interfaces to make it easier to override the functionality altogether.

### Describe alternatives you've considered
1. Allowing `BouncyCastleProvider` in just for the sake of not receiving compilation-time errors.
2. Implementing a fake `BouncyCastleProvider` to "trick" the compiler.
3. Using reflection.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。