Small issue: CognitoEventUserPoolsMigrateUser request/response fields are not named

Open
#429 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
go
Domain
cloud

Research direction

Locate the CognitoEventUserPoolsMigrateUser definition and compare it with the other Cognito event structs shown in the issue. Verify the request and response JSON fields, then confirm that callers can access them through named Request and Response fields without breaking the existing event shape.

Written by the indexing model from the issue text.

Description

type/ux

Other Cognito event structs look like:

type CognitoEventUserPoolsPostAuthentication struct {
	CognitoEventUserPoolsHeader
	Request  CognitoEventUserPoolsPostAuthenticationRequest  `json:"request"`
	Response CognitoEventUserPoolsPostAuthenticationResponse `json:"response"`
}

But CognitoEventUserPoolsMigrateUser is defined as:

type CognitoEventUserPoolsMigrateUser struct {
	CognitoEventUserPoolsHeader
	CognitoEventUserPoolsMigrateUserRequest  `json:"request"`
	CognitoEventUserPoolsMigrateUserResponse `json:"response"`
}

So instead of event.Response.UserAttributes you have to do either event.UserAttributes or event.CognitoEventUserPoolsMigrateUserResponse.UserAttributes which both look a bit weird to me and is a bit inconsistent with the other event definitions?

Is this intentional or just a miss?

My suggestion is to change the definition to:

type CognitoEventUserPoolsMigrateUser struct {
	CognitoEventUserPoolsHeader
	Request CognitoEventUserPoolsMigrateUserRequest  `json:"request"`
	Response CognitoEventUserPoolsMigrateUserResponse `json:"response"`
}
Dominant language
Go
Stars
3.8k
Forks
578
Avg merge
16h 56m
Merged PRs (30d)
2

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

All issues in aws/aws-lambda-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.