aws / aws/aws-encryption-sdk-javascript
Compile error in modules/example-node/src/kms_filtered_discovery.ts
- Lingua principale
- TypeScript
- Stelle
- 260
- Fork
- 68
- Merge medio
- 22h 19m
- PR unite (30g)
- 2
Descrizione
### 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)
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da modules/example-node/src/kms_filtered_discovery.ts, in particolare dalla dichiarazione di clientProvider alla riga 29 e dalla costruzione di KmsKeyringNode alla riga 38. Riproduci l’errore di compilazione di TypeScript, quindi esamina i tipi del client KMS e del keyring coinvolti; il lavoro è completato quando l’esempio compila mantenendo la restrizione alla regione ap-southeast-2.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, node.js, typescript
- Ambito
- backend, cloud, security
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100