aws / aws/aws-lambda-rust-runtime

Mismatch type description for Cognito CognitoEventUserPoolsPreTokenGenV2 Event

未关闭 适合新手
#1,099 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
3.6k
派生
396
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

调研方向

从 lambda-events/src/event/cognito/mod.rs 中的 CognitoEventUserPoolsPreTokenGenV2 及其 claims_to_add_or_override 字段开始,然后将该字段与 issue 中链接的 AWS 事件 schema 进行比较。完成的标准是:该字段接受文档所述的 JSON 值类型,而不只是字符串,并且现有的事件行为保持兼容。

由索引模型根据 Issue 内容生成。

评估

技术栈
rust
领域
cloud
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
62/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。