add support for Cognito Inbound federation Lambda trigger by maximrub · Pull Request #619 · aws/aws-lambda-go · GitHub
Skip to content

add support for Cognito Inbound federation Lambda trigger#619

Merged
maxday merged 1 commit into
aws:mainfrom
maximrub:inbound-federation
Mar 2, 2026
Merged

add support for Cognito Inbound federation Lambda trigger#619
maxday merged 1 commit into
aws:mainfrom
maximrub:inbound-federation

Conversation

@maximrub

Copy link
Copy Markdown
Contributor

Description of changes:
Add support for the new https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-inbound-federation.html for Amazon Cognito User Pools. This trigger is invoked when a user signs in through a third-party identity provider, allowing a Lambda to inspect and transform federated user attributes before they are mapped to the user pool.

New types:

  • CognitoFederationProviderType — string enum with constants for all supported provider types (OIDC, SAML, Facebook, Google, SignInWithApple, LoginWithAmazon)
  • CognitoEventUserPoolsInboundFederation — top-level event struct
  • CognitoEventUserPoolsInboundFederationRequest — with ProviderName, ProviderType, and Attributes
  • CognitoEventUserPoolsInboundFederationAttributes — with TokenResponse, IDToken, UserInfo (OIDC/social) and SAMLResponse (SAML), all map[string]string
  • CognitoEventUserPoolsInboundFederationResponse — with UserAttributesToMap as map[string]string

All attribute maps use map[string]string per confirmation from the Cognito team that these fields contain string-only types today, and any future non-string types would be released as a new generation trigger (V2).

Tests:

  • OIDC round-trip marshaling test with test fixture
  • SAML round-trip marshaling test with test fixture
  • Malformed JSON test

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Signed-off-by: Maxim Rubchinsky <maxim@rubchinsky.com>
@codecov-commenter

Copy link
Copy Markdown

@maxday

maxday commented Mar 2, 2026

Copy link
Copy Markdown
Member

Thanks @maximrub
The PR looks good to me, the test failure seems unrelated to your changes. Let me have a look and try to fix them before merging this.

@maxday

maxday commented Mar 2, 2026

Copy link
Copy Markdown
Member

@maxday maxday self-requested a review March 2, 2026 16:12

@anzheyazzz anzheyazzz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@maxday maxday merged commit 9c32960 into aws:main Mar 2, 2026
43 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants