Skip to content

Initial cognito trigger support #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

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

mattmassicotte
Copy link
Contributor

Support for one Cognito Lambda Trigger (PreSignUp_SignUp), with infrastructure to support all 20 others.

Motivation:

I've been playing around with implementing WebAuthn (passkeys) using only Swift. It turned out to be complex, because Cognito doesn't support it yet, and requires the use of 3/4 lambda triggers.

Modifications:

Added a basic Cognito trigger enum that should be able to model all 21 lambda trigger types. Made some tests for the single trigger I've currently actually used.

Result:

Cognito triggers are a little funny in that they all have a common shape, but differ in some ways depending on the type. And, because there are so many (21 as of right now), I didn't want to create a bunch of duplicate structs. So, I opted for a enum that stores the trigger-specific data.

I think this change is potentially useful, even though it is far from a complete implementation. I figured I'd propose it in PR form just to see what you all think. Happy to entertain suggestions!

@swift-server-bot
Copy link

Can one of the admins verify this patch?

2 similar comments
@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@tomerd
Copy link
Contributor

tomerd commented Jan 6, 2023

thanks @mattmassicotte

@tomerd
Copy link
Contributor

tomerd commented Jan 6, 2023

@swift-server-bot test this please

@tomerd
Copy link
Contributor

tomerd commented Jan 6, 2023

I don't have much experience with Cognito Lambda Trigger events but code looks fine

@mattmassicotte
Copy link
Contributor Author

When I first noticed the failure, it looked like some formatting problems. I'll try to get swift-format working so I can fix this all up. Sorry for keeping it pending for so long.

@mattmassicotte
Copy link
Contributor Author

Ok, changes pushed. Just waiting for CI to confirm that I fixed everything up.

@mattmassicotte
Copy link
Contributor Author

@tomerd is it normal for these checks to take so long?

@tomerd
Copy link
Contributor

tomerd commented Jan 27, 2023

@swift-server-bot test this please

@tomerd
Copy link
Contributor

tomerd commented Jan 27, 2023

@mattmassicotte only maintainers can trigger them for security reasons

@tomerd tomerd merged commit a374581 into swift-server:main Jan 27, 2023
@mattmassicotte mattmassicotte deleted the feature/cognito branch January 27, 2023 20:04
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.

3 participants