aws / aws/aws-lambda-rust-runtime
Mismatch type description for Cognito CognitoEventUserPoolsPreTokenGenV2 Event
- Lingua principale
- Rust
- Stelle
- 3.6k
- Fork
- 396
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia in lambda-events/src/event/cognito/mod.rs, su CognitoEventUserPoolsPreTokenGenV2 e sul relativo campo claims_to_add_or_override, quindi confronta il campo con lo schema dell’evento AWS collegato nell’issue. Il lavoro è completato quando il campo accetta i tipi di valori JSON documentati invece di accettare solo stringhe e il comportamento esistente dell’evento rimane compatibile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- cloud
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 62/100