Serverless-offline: Is this support websocket authorizer method?

Created on 4 Apr 2020  路  6Comments  路  Source: dherault/serverless-offline

I read through the code and found that the auth support available in HTTP and coudn't find in websocket. Is this feature available?

Below is my config from serverless.yaml

functions:
connect:
handler: aws_ws_connect_handler.handler
events:
- websocket:
route: $connect
authorizer:
name: customAuthoriser
identitySource:
- 'route.request.querystring.authorization'
customAuthoriser:
handler: aws_ws_auth_handler.handler

Most helpful comment

@ebarault I have a working implementation of WS authorizer support in this branch: https://github.com/jackcohen5/serverless-offline/tree/webocket_authorizers

PR was closed as I was intending to write some tests around the changes, but I haven't gotten a chance to yet

All 6 comments

Found that Authorizers not currently supported - Serverless Documentation.

https://serverless.com/plugins/serverless-offline/
"Authorizers and wss:// are currently not supported."

Is this feature planned in future releases?

hi,
We are also interested in an update on this. We are implementing an authorizer for websocket api-gateway and have no way to test it locally.

This PR was once started https://github.com/dherault/serverless-offline/pull/915, but was then closed.
@jackcohen5, could you tell why this PR was closed?

Eric

cc: @SuperHamouch11

@ebarault I have a working implementation of WS authorizer support in this branch: https://github.com/jackcohen5/serverless-offline/tree/webocket_authorizers

PR was closed as I was intending to write some tests around the changes, but I haven't gotten a chance to yet

thank you @jackcohen5
cc: @SuperHamouch11

I think I will test my websocket authorizer locally against a dummy HTTP endpoint for now

I wrote yesterday a modified version of 6.8.0 to work with an Authorizer out-the-box in the same project. I call authorizer once in $connect route, cache it to use in $default route and works like charm. The biggest problem was to coordinate all route calls in order to respect $connect route first, what was resolved using chained Promises. Would you like to check it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ozbillwang picture ozbillwang  路  4Comments

yareyaredesuyo picture yareyaredesuyo  路  4Comments

Ali-Dalal picture Ali-Dalal  路  4Comments

conradoramalho picture conradoramalho  路  3Comments

adambiggs picture adambiggs  路  4Comments