Skip to content

Commit

Permalink
feat: add authorizer scope (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoc-lima authored Jul 17, 2024
1 parent 23c6f0f commit 48601af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion faster_sam/lambda_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ async def event_builder(self) -> Dict[str, Any]:

now = datetime.now(timezone.utc)
body = await self.request.body()
authorizer = self.request.scope.get("authorization_context") or self.request.scope.get(
"authorizer"
)
event = {
"body": body.decode(),
"path": self.request.url.path,
Expand All @@ -386,7 +389,7 @@ async def event_builder(self) -> Dict[str, Any]:
"path": self.request.url.path,
"httpMethod": self.request.method,
"protocol": f"HTTP/{self.request.scope['http_version']}",
"authorizer": self.request.scope.get("authorization_context"),
"authorizer": authorizer,
},
}

Expand Down

0 comments on commit 48601af

Please sign in to comment.