You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
APIGatewayProxyRequestEvent does not have authorizer #33
The APIGatewayProxyRequestEventrequestContext object does not have the authorizer object. With the new addition of the authorizer context, I am unsure how to structure a new Authorizer object.
It is entirely possible to have an authorizer json blob like:
{
"principalId": "123", // Required by authorizer
"roles": "role1,role2", // Additional arbitrary parameter from authorizer context
"likes_pie": true // Additional arbitrary parameter from authorizer context
}
The principalId is always part of the authorizer blob, and thus should be a String field on a new Authorizer object. However, the additional arbitrary parameters provided by the authorizer context should be a map. This won't (de)serialize 1:1 between JSON and Java however.
@onema, in the meantime, you can do what I do and redefine the file in your project. If you use the exact same package, it should override the version in the library.
@avanathan I'm no longer using lambdas with Java, so I believe I'd be a poor champion for the PR. If you wish, feel free to copy my changes and make your own PR.
You may have the modify the map to use Object though. It does seem that you can get non-string values in some cases; though I have never encountered any.
@oharaandrew314 Thanks. I did open a PR - #77, but kept it Map<String, String>. Mainly because there are other collections using String key-value. Also, as per my understanding the other non-String objects get converted to Strings before they are added to this map. Hope this rationale makes sense.
Activity
onema commentedon Jan 15, 2018
I second this, any news on this?
oharaandrew314 commentedon Jan 16, 2018
Yes, I made a PR in #39
oharaandrew314 commentedon Jan 17, 2018
@onema, in the meantime, you can do what I do and redefine the file in your project. If you use the exact same package, it should override the version in the library.
mfulgo commentedon Jun 14, 2018
It would be nice if the authorizer was exposed. Since the values can be anything, perhaps setting them to
Objects would be the right thing to do.It seems the go library uses this approach: https://github.com/aws/aws-lambda-go/blob/v1.2.0/events/apigw.go#L36
avanathan commentedon Feb 18, 2019
@oharaandrew314 Could you pls. reopen PR #39 ? Everyone making changes in their code repo for a generic change is not a scalable solution. Thanks!
oharaandrew314 commentedon Feb 18, 2019
@avanathan I'm no longer using lambdas with Java, so I believe I'd be a poor champion for the PR. If you wish, feel free to copy my changes and make your own PR.
You may have the modify the map to use Object though. It does seem that you can get non-string values in some cases; though I have never encountered any.
avanathan commentedon Feb 18, 2019
@oharaandrew314 Thanks. I did open a PR - #77, but kept it
Map<String, String>. Mainly because there are other collections usingStringkey-value. Also, as per my understanding the other non-String objects get converted to Strings before they are added to this map. Hope this rationale makes sense.carlzogh commentedon Apr 28, 2020
This was released as part of version
2.2.6- thanks for your PR @avanathan!