Skip to content

Mismatch type description for Cognito CognitoEventUserPoolsPreTokenGenV2 Event #1099

@AbhigyaKrishna

Description

@AbhigyaKrishna

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions