From a2ee94667bfc9f506ea4762b2244073f4e848d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ngh=C4=A9a=20Nguy=E1=BB=85n=20Ng=E1=BB=8Dc?= Date: Sat, 9 May 2026 11:35:23 +0700 Subject: [PATCH] feat(events): add LinkParameter to CognitoEventUserPoolsCustomMessageRequest The AWS Cognito Custom Message trigger documentation shows a linkParameter field in the request payload for verification link scenarios (CustomMessage_VerifyUserAttribute, CustomMessage_AdminCreateUser). This field was missing from the Go struct, forcing users to unmarshal into a custom type or use json.RawMessage to access it. Fixes #592 --- events/cognito.go | 5 ++++- events/testdata/cognito-event-userpools-custommessage.json | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/events/cognito.go b/events/cognito.go index 0b350a90..7c9d8694 100644 --- a/events/cognito.go +++ b/events/cognito.go @@ -359,7 +359,10 @@ type CognitoEventUserPoolsCustomMessageRequest struct { UserAttributes map[string]interface{} `json:"userAttributes"` CodeParameter string `json:"codeParameter"` UsernameParameter string `json:"usernameParameter"` - ClientMetadata map[string]string `json:"clientMetadata"` + // LinkParameter is the placeholder for the verification link in email messages. + // It is present when TriggerSource is CustomMessage_VerifyUserAttribute or CustomMessage_AdminCreateUser. + LinkParameter string `json:"linkParameter,omitempty"` + ClientMetadata map[string]string `json:"clientMetadata"` } // CognitoEventUserPoolsCustomMessageResponse contains the response portion of a CustomMessage event diff --git a/events/testdata/cognito-event-userpools-custommessage.json b/events/testdata/cognito-event-userpools-custommessage.json index 9c10d794..8b0c2565 100644 --- a/events/testdata/cognito-event-userpools-custommessage.json +++ b/events/testdata/cognito-event-userpools-custommessage.json @@ -15,6 +15,7 @@ }, "codeParameter": "####", "usernameParameter": "{username}", + "linkParameter": "https://example.com/verify?token=abc123", "clientMetadata": { "exampleMetadataKey": "example metadata value" }