swift-server / swift-aws-lambda-runtime

Swift implementation of AWS Lambda Runtime
Apache License 2.0
1.13k stars 102 forks source link

APIGateway.V2.Request Authorizer jwt visibility #166

Closed MoridinBG closed 3 years ago

MoridinBG commented 4 years ago

Currently the JWT struct on the Context's Authorizer is public, but the jwt instance is not. Is this a design decision? Is there a better approach? Currently I am getting the token from the request authorization header and decoding manually to get claims.

I have several lambdas on an HTTP APIGateway API.

SwiftAWSLambdaRuntime version/commit hash

0.2.0

Swift & OS version (output of swift --version && uname -a)

Swift 5.2.4@MacOS 10.5/Swift 5.2.5@Amazonlinux2

fabianfett commented 4 years ago

Thanks @MoridinBG, if you mean this line:

https://github.com/swift-server/swift-aws-lambda-runtime/blob/f175b5452f8313791fded51c2ea9edf3740ea9f4/Sources/AWSLambdaEvents/APIGateway%2BV2.swift#L40

This has been a terrible oversight from my side. Would you be willing to provide a PR?

MoridinBG commented 4 years ago

Gladly