Mismatch type description for Cognito CognitoEventUserPoolsPreTokenGenV2 Event

Open Beginner friendly
#1,099 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
rust
Domain
cloud

Research direction

Start in lambda-events/src/event/cognito/mod.rs at CognitoEventUserPoolsPreTokenGenV2 and its claims_to_add_or_override field, then compare the field with the AWS event schema linked in the issue. Done means the field accepts the documented JSON value types instead of only strings and the existing event behavior remains compatible.

Written by the indexing model from the issue text.

Description

There is a type mismatch for claims_to_add_or_override in CognitoEventUserPoolsPreTokenGenV2 event. claims_to_add_or_override should accept any of the json types instead of only strings.

The documentation at AWS mentions the following type description for the event as:

{
    "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
- pub claims_to_add_or_override: HashMap<String, String>
+ pub claims_to_add_or_override: HashMap<String, serde_json::Value>
Dominant language
Rust
Stars
3.6k
Forks
397
Avg merge
55m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-lambda-rust-runtime

All issues in aws/aws-lambda-rust-runtime

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.