-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add a authorizer function for the API Gateway (Websocket) endpoint #1
Comments
Hey @boyney123 I'd love to take a shot at adding this! I'm thinking a simple implementation would include an SSM parameter containing a token - so the authorizer function would look for a parameter with a certain key and then compare the value with the auth header. WDYT? |
Hey @lukehedger
Yeah, the first time I looked at this kinda stuff, but makes sense to me I think! Maybe somehow pass the token value into the construct? Any thoughts on how people could set the token value?
Not sure if thats the best way or not? |
Just had a look at this @boyney123 and it seems that authorizers work slightly differently for WebSocket APIs. There is also currently no L2 support in CDK, although there do seem to be a couple of workarounds - see aws/aws-cdk#13869. |
Meanwhile cdk has authorizer support so i created a PR to add this functionality. |
By default the websocket is open for anyone to connect too.
Think it would be better practice if there was a basic lambda that maybe could verify a token of some sort? Like the example seen here https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
Maybe the websocket could send a authorization header, then we could allow the connection if it matches....
The text was updated successfully, but these errors were encountered: