-
Notifications
You must be signed in to change notification settings - Fork 27
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
Cognito Triggers - PreSignUp, PostConfirmation, PostAuthentication, CustomMessage #57
Conversation
- PostConfirmation - PostAuthentication - CustomMessage
@swift-server-bot test this please |
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.
Thank you for having written this. It looks good to me and it looks like it can be merged. I would add a one line comment to make the large TriggerSource enum easier to read and understand, nut beside this, I don't have other comments
Thank you @jsonfry
It's a truly open question - I have not made my mind yet. @adam-fowler what do you think ? |
|
|
@swift-server-bot test this please |
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.
LGTM
Just saw your mention on the other issue @sebsto. Since this has been merged, I'll keep this short. IMHO, this approach is more verbose than necessary. Additionally, according to AWS documentation, Input event edited in place: Input event returned as is: AWS Samples: I can see the proposed solution as a more Swift-like approach compared to in-place editing. However, considering that it introduces a pattern completely different from the examples in the AWS documentation, I suggest we provide documentation with a few examples of our own. |
Added Cognito events for PostConfirmation, PostAuthentication, CustomMessage and handled the other PreSignUp trigger sources:
PreSignUp_ExternalProvider
andPreSignUp_AdminCreateUser
Motivation:
Continuing the work done #27, I've added support for some more Cognito trigger events.
Modifications:
I'm not sure of the original author's intentions for how to handle triggers that are of the same "shape". E.g. there are three different trigger sources that follow the "PreSignUp" shape (
PreSignUp_SignUp
,PreSignUp_ExternalProvider
andPreSignUp_AdminCreateUser
). The original author had named a single enum case.preSignUpSignUp
, but the other two trigger sources would have been exactly the same.I have therefore changed the name to
preSignUp
and implemented three new ones (PostConfirmation, PostAuthentication, CustomMessage) in that same way, and treating theparams.triggerSource
as the way you tell which exact preSignUp/CustomMessage etc you're dealing with.Happy for feedback on this.
I've also made the fields on the common parameters public so they can be read.
Result:
When a Cognito User Pool has the PreSignUp, PostConfirmation, PostAuthentication, and/or CustomMessage triggers setup, they can now be fully handled.