Skip to content
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

Added APIGatewayWebsocketRequest type #28

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

requaos
Copy link

@requaos requaos commented Nov 12, 2020

No description provided.

@requaos
Copy link
Author

requaos commented Nov 12, 2020

@akrylysov Figured we would want to support this...

requaos and others added 3 commits November 12, 2020 10:17
Added APIGatewayWebsocketRequest type
added pkg/errors to wrap the error with the payload message so it pri…
@requaos
Copy link
Author

requaos commented Nov 12, 2020

@akrylysov I am going to mark this as a draft for now. There will need to be some special opts for handling $connect and $disconnect event types for the websocket gateway proxy requests. The events come in really bare, so you basically only have event.requestContext.eventType == "CONNECT" to switch on... but we could switch on event.requestContext.routeKey == $connect depending on how we decide to handle these cases.

In my use case I need to perform a little auth validation and record an access event to the logs, so I define my $connect handler, but if you leave this undefined in your gateway, AWS will handle connect/disconnect events for you.

Since this package aims to fabricate an http request from the event details, the opt, could be more than one, will need to provide httpMethod and path for a given eventType/routeKey.

If you have any opinions or feedback, please let me know.

@requaos requaos marked this pull request as draft November 12, 2020 23:21
@requaos
Copy link
Author

requaos commented Nov 16, 2020

I took some liberties, but please let me know if you have change requests.

@requaos requaos marked this pull request as ready for review November 16, 2020 19:08
@ghost
Copy link

ghost commented Mar 4, 2021

@akrylysov could you review this PR please? It would be very helpful!
Thanks

@akrylysov
Copy link
Owner

Thanks for the PR! Do you mind adding some tests? Take a look at https://github.com/akrylysov/algnhsa/blob/master/adapter_test.go

@StarpTech StarpTech mentioned this pull request Jan 18, 2024
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.

2 participants