-
Notifications
You must be signed in to change notification settings - Fork 76
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
Changes from 107 commits
743354e
ab7f76f
7c55adc
36727ba
aa2f7d9
0302517
0adf873
a5b5d3c
753701a
955cecc
2a2b188
fc0be7e
6c916e0
cab3f1a
954e1c0
d9212d8
c09e1ee
05e1fd5
7714224
91faece
5977d8f
4c6616b
cb908ed
dbbb9b8
2f7e6e8
f981039
e5ada8b
2cc04a9
1794ad0
e6c6730
4471aec
2b17234
61e10d8
fdbc617
5806d7f
e1ca822
f012a51
cb8f50d
6e7ab39
8fdd181
2187829
c86be92
c5f6ad4
f8f1c6a
b8bb5a2
8e3f47d
b291851
206ec4e
ad776e7
eb24c3e
3283dfd
eac8809
d9d7cae
872f88b
afe3d89
c829edf
fbfc8fe
a4d17e8
699986b
b22de18
f43703d
d1ff4aa
3262d3f
15b2fbf
5e02689
606570a
1cce05c
7a5629b
16e07ed
029b4d0
57daf18
04bca21
7d48cbe
7847881
43b7da0
e0532f3
7c007da
9178e8b
570de9e
8a272d1
c558111
37b6d5d
324afb6
10444c7
0c04155
36160e5
fff5cde
22b8840
a1b4056
1b1a263
7e688f6
4772b2e
1d64301
49b46d6
7119b35
0480694
793927a
7665597
487f586
2267f2a
38c05f5
be0d21e
50f7e94
984bd69
70ae8a1
fe1aaf1
e06162b
b8d54a6
3b03d3c
3df2842
4f21f21
c7e53cc
e7d335c
30ffca8
7411f34
1c6bef9
65cbf67
3e898fc
445e0a3
e4f879b
a26da97
3e49d70
f5da56c
223181c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@aws-amplify/auth-construct': minor | ||
'@aws-amplify/backend-auth': minor | ||
--- | ||
|
||
Added custom user KMS key for customEmailSender |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@aws-amplify/auth-construct': minor | ||
'@aws-amplify/backend-auth': minor | ||
--- | ||
|
||
feat: Add support for custom Lambda function email senders in Auth construct |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,5 +193,7 @@ | |
"xlarge", | ||
"yaml", | ||
"yargs", | ||
"zoneinfo" | ||
"zoneinfo", | ||
"SKey", | ||
"decrypt" | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ type ConversationHandlerFunctionProps = { | |
modelId: string; | ||
region?: string; | ||
}>; | ||
memoryMB?: number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you might need to merge latest main. this change shouldn't be on the diff. |
||
outputStorageStrategy?: BackendOutputStorageStrategy<AIConversationOutput>; | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import { AuthResources } from '@aws-amplify/plugin-types'; | |
import { aws_cognito } from 'aws-cdk-lib'; | ||
import { BackendOutputStorageStrategy } from '@aws-amplify/plugin-types'; | ||
import { Construct } from 'constructs'; | ||
import { IFunction } from 'aws-cdk-lib/aws-lambda'; | ||
import { NumberAttributeConstraints } from 'aws-cdk-lib/aws-cognito'; | ||
import { ResourceProvider } from '@aws-amplify/plugin-types'; | ||
import { SecretValue } from 'aws-cdk-lib'; | ||
|
@@ -47,7 +48,8 @@ export type AuthProps = { | |
externalProviders?: ExternalProviderOptions; | ||
}; | ||
senders?: { | ||
email: Pick<UserPoolSESOptions, 'fromEmail' | 'fromName' | 'replyTo'>; | ||
email: Pick<UserPoolSESOptions, 'fromEmail' | 'fromName' | 'replyTo'> | IFunction; | ||
kmsKeyArn?: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is If not then we should introduce type for custom sender. Or perhaps have The bottom line is that we should find typing that doesn't let you specify @josefaidt wdyt ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a good point, i think this would be enough: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. feedback makes sense. I like this take
this is also simple, and easier to understand that you only have two valid configuration options (ses or a sender function with/without a custom kms key)
|
||
}; | ||
userAttributes?: UserAttributes; | ||
multifactor?: MFA; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
```ts | ||
|
||
import { AmazonProviderProps } from '@aws-amplify/auth-construct'; | ||
import { AmplifyFunction } from '@aws-amplify/plugin-types'; | ||
import { AppleProviderProps } from '@aws-amplify/auth-construct'; | ||
import { AuthProps } from '@aws-amplify/auth-construct'; | ||
import { AuthResources } from '@aws-amplify/plugin-types'; | ||
|
@@ -22,6 +23,7 @@ import { ResourceAccessAcceptorFactory } from '@aws-amplify/plugin-types'; | |
import { ResourceProvider } from '@aws-amplify/plugin-types'; | ||
import { StackProvider } from '@aws-amplify/plugin-types'; | ||
import { TriggerEvent } from '@aws-amplify/auth-construct'; | ||
import { UserPoolSESOptions } from 'aws-cdk-lib/aws-cognito'; | ||
|
||
// @public | ||
export type ActionIam = 'addUserToGroup' | 'createGroup' | 'createUser' | 'deleteGroup' | 'deleteUser' | 'deleteUserAttributes' | 'disableUser' | 'enableUser' | 'forgetDevice' | 'getDevice' | 'getGroup' | 'getUser' | 'listUsers' | 'listUsersInGroup' | 'listGroups' | 'listDevices' | 'listGroupsForUser' | 'removeUserFromGroup' | 'resetUserPassword' | 'setUserMfaPreference' | 'setUserPassword' | 'setUserSettings' | 'updateDeviceStatus' | 'updateGroup' | 'updateUserAttributes'; | ||
|
@@ -36,10 +38,14 @@ export type AmazonProviderFactoryProps = Omit<AmazonProviderProps, 'clientId' | | |
}; | ||
|
||
// @public (undocumented) | ||
export type AmplifyAuthProps = Expand<Omit<AuthProps, 'outputStorageStrategy' | 'loginWith'> & { | ||
export type AmplifyAuthProps = Expand<Omit<AuthProps, 'outputStorageStrategy' | 'loginWith' | 'senders'> & { | ||
loginWith: Expand<AuthLoginWithFactoryProps>; | ||
triggers?: Partial<Record<TriggerEvent, ConstructFactory<ResourceProvider<FunctionResources>>>>; | ||
access?: AuthAccessGenerator; | ||
senders?: { | ||
email: Pick<UserPoolSESOptions, 'fromEmail' | 'fromName' | 'replyTo'> | ConstructFactory<AmplifyFunction>; | ||
kmsKeyArn?: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar feedback here. We should find better typing. |
||
}; | ||
}>; | ||
|
||
// @public | ||
|
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.
please insert those in alphabetical order.