aws / aws/aws-lambda-rust-runtime
Mismatch type description for Cognito CognitoEventUserPoolsPreTokenGenV2 Event
- Langage dominant
- Rust
- Étoiles
- 3.6k
- Forks
- 396
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
```
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez dans lambda-events/src/event/cognito/mod.rs, au niveau de CognitoEventUserPoolsPreTokenGenV2 et de son champ claims_to_add_or_override, puis comparez ce champ avec le schéma d’événement AWS lié dans l’issue. La tâche est terminée lorsque le champ accepte les types de valeurs JSON documentés au lieu d’accepter uniquement des chaînes de caractères et que le comportement existant de l’événement reste compatible.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust
- Domaine
- cloud
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 62/100