aws / aws/aws-encryption-sdk-javascript

Compile error in modules/example-node/src/kms_filtered_discovery.ts

Abierto
#1,520 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
260
Forks
68
Merge medio
22 h 19 min
PR fusionados (30 d)
2

Descripción

### 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)
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con modules/example-node/src/kms_filtered_discovery.ts, especialmente con la declaración de clientProvider en la línea 29 y la construcción de KmsKeyringNode en la línea 38. Reproduce el error de compilación de TypeScript y luego inspecciona los tipos de cliente KMS y de keyring involucrados; se considera terminado cuando el ejemplo compila manteniendo la restricción de la región ap-southeast-2.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
aws, node.js, typescript
Área
backend, cloud, security
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.