aws / aws/aws-encryption-sdk-javascript
Compile error in modules/example-node/src/kms_filtered_discovery.ts
- 主要言語
- TypeScript
- スター
- 260
- フォーク
- 68
- 平均マージ
- 22時間 19分
- マージ済み PR(30日)
- 2
説明
### Problem:
Attempting to compile the example code in "modules/example-node/src/kms_filtered_discovery.ts" results in a Typescript compile error:
```
Type 'KmsClientSupplier' is not assignable to type 'KmsClientSupplier'.
Type 'KMS' is not assignable to type 'AwsEsdkKMSInterface'.
The types returned by 'decrypt(...)' are incompatible between these types.
Type 'Promise' is not assignable to type 'Promise | AwsSdkV2Response'.
Type 'Promise' is not assignable to type 'Promise'.
Type 'DecryptCommandOutput' is not assignable to type 'DecryptResponse' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'KeyId' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
```
The problem goes away if you comment out line 38:
```
const keyring = new KmsKeyringNode({
// clientProvider,
discovery,
discoveryFilter,
})
```
But this is not a real solution, because what I actually want is to limit the AWS regions, which is achieved using the following on line 29:
```
const clientProvider = limitRegions(['ap-southeast-2'], getKmsClient)
```
コントリビューションガイド
調査の方向性
modules/example-node/src/kms_filtered_discovery.ts から始め、特に29行目の clientProvider 宣言と38行目の KmsKeyringNode の構築を確認します。TypeScript のコンパイルエラーを再現してから、関連する KMS クライアントと keyring の型を調べます。ap-southeast-2 リージョンの制限を維持したまま例がコンパイルできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- aws, node.js, typescript
- 領域
- backend, cloud, security
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100