-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for custom Lambda function email senders in Auth construct #2087
base: main
Are you sure you want to change the base?
Conversation
const authWithTriggerFactory = defineAuth({ | ||
loginWith: { email: true }, | ||
//if senders aren't passed its essentially lambdaTriggers={} | ||
triggers: { preSignUp: funcStub }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good, but it should also include email senders function here. this is so we can test there are no conflicts between the two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ie, make sure the trigger exists for presignup, and also the custom sender function
props.senders?.email && | ||
props.senders.email instanceof lambda.Function && | ||
this.customEmailSenderKmsKey | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if all of this code is necessary if we use .addTrigger on this.userPool, for example:
this.userPool.addTrigger(UserPoolOperation.of('customEmailSender'), props.senders.email)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can check to see if the template generates/includes the necessary IAM policies and KMS key resource.
Its essentially what we do today for the other triggers
packages/backend-ai/API.md
Outdated
// (No @packageDocumentation comment for this package) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not sure why this file is here, perhaps you have to pull from main again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, this file shouldn't be here.
and it seems it has whitespace changes.
for the purpose of this pr just remove this from diff please.
to prevent this from happening you can try the following:
- What @awsluja said above - merge latest main
- Clean - rebuild
- Check these settings https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings (the diff seems to be whitespace changes).
}, | ||
}, | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also verify that the KMS key resource exists ?
* detect transform errors with multiple errors * new method of getting multiple transform errors
* Add minify option to defineFunction * Add unit tests and e2e tests when set minify option to false * Add changeset * Update API.md * add bundling options * Update .changeset/pink-rockets-dance.md * use optional chaining * include funcNoMinify into function.ts --------- Co-authored-by: Kamil Sobol <[email protected]>
* Fix cdk tests when new dependencies are shipped to npm. * try this * try this * try this * try this
…lify-backend into feature/custom-email-function
Problem
This PR addresses the need for more flexible email sender configuration in the Auth construct, specifically allowing the use of custom Lambda functions for email sending capabilities.
Changes
Validation
A new test case was added to verify the behavior when a function is provided as an email sender. This test ensures that the custom email sender is properly set up when a Lambda function is provided.
Checklist