aws / aws/aws-lambda-rust-runtime
Mismatch type description for Cognito CognitoEventUserPoolsPreTokenGenV2 Event
- Lenguaje dominante
- Rust
- Estrellas
- 3.6k
- Forks
- 396
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
There is a type mismatch for [`claims_to_add_or_override`](https://github.com/aws/aws-lambda-rust-runtime/blob/61855c2eabfc725f93cad6deabb7d6fa203e35a9/lambda-events/src/event/cognito/mod.rs#L572) in [CognitoEventUserPoolsPreTokenGenV2](https://github.com/aws/aws-lambda-rust-runtime/blob/61855c2eabfc725f93cad6deabb7d6fa203e35a9/lambda-events/src/event/cognito/mod.rs#L473) event. `claims_to_add_or_override` should accept any of the json types instead of only strings.
The [documentation at AWS](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html#cognito-user-pools-lambda-trigger-syntax-pre-token-generation) mentions the following type description for the event as:
```json
{
"request": {
"userAttributes": {
"string": "string"
},
"scopes": ["string", "string"],
"groupConfiguration": {
"groupsToOverride": ["string", "string"],
"iamRolesToOverride": ["string", "string"],
"preferredRole": "string"
},
"clientMetadata": {
"string": "string"
}
},
"response": {
"claimsAndScopeOverrideDetails": {
"idTokenGeneration": {
"claimsToAddOrOverride": {
"string": [accepted datatype]
},
"claimsToSuppress": ["string", "string"]
},
"accessTokenGeneration": {
"claimsToAddOrOverride": {
"string": [accepted datatype]
},
"claimsToSuppress": ["string", "string"],
"scopesToAdd": ["string", "string"],
"scopesToSuppress": ["string", "string"]
},
"groupOverrideDetails": {
"groupsToOverride": ["string", "string"],
"iamRolesToOverride": ["string", "string"],
"preferredRole": "string"
}
}
}
}
```
##### Accepted datatypes:
* String
* Number
* Boolean
* Array of strings, numbers, booleans, or a combination of any of these
* JSON
#### Proposed Solution
```diff
- pub claims_to_add_or_override: HashMap
+ pub claims_to_add_or_override: HashMap
```
Guía de contribución
Línea de trabajo
Comienza en lambda-events/src/event/cognito/mod.rs, en CognitoEventUserPoolsPreTokenGenV2 y su campo claims_to_add_or_override; después compara el campo con el esquema del evento de AWS enlazado en el issue. La tarea estará terminada cuando el campo acepte los tipos de valores JSON documentados en lugar de aceptar únicamente strings y el comportamiento existente del evento siga siendo compatible.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust
- Área
- cloud
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 62/100