Closed ParkChangSun closed 5 months ago
I'm developing a lambda application with websocket api. I saw a difference between REST api and WebSocket api in event context struct, and both can use Lambda REQUEST authorizer function
APIGatewayCustomAuthorizerResponse.Context and APIGatewayProxyRequestContext.Authorizer are both map[string]interface{} type, but APIGatewayWebsocketProxyRequestContext.Authorizer is interface{} type.
map[string]interface{}
interface{}
Can it be changed to map[string]interface{}? So that I can do:
userId := req.RequestContext.Authorizer["UserId"].(string)
instead of:
userId := req.RequestContext.Authorizer.(map[string]interface{})["UserId"].(string)
Or is there any reason that it is interface{}?
I'm developing a lambda application with websocket api. I saw a difference between REST api and WebSocket api in event context struct, and both can use Lambda REQUEST authorizer function
APIGatewayCustomAuthorizerResponse.Context and APIGatewayProxyRequestContext.Authorizer are both
map[string]interface{}
type, but APIGatewayWebsocketProxyRequestContext.Authorizer isinterface{}
type.Can it be changed to
map[string]interface{}
? So that I can do:instead of:
Or is there any reason that it is
interface{}
?