-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieve lambda event object on FastAPI #64
Comments
I'm working on a PR that will include the |
@koxudaxi I've merged the changes into master. Here is an example of how you can access the event and context using FastAPI: from fastapi import FastAPI
from starlette.requests import Request
app = FastAPI()
@app.get("/")
def hello_world(request: Request):
return {"aws": request.scope["aws"]} |
Thank you very much!! |
greetings, just stumbled upon this, definitely would be helpful to have it in the main readme doc on the front page! went to access the apigateway event.requestContext.authorizor data and realized I didn't know how to get it :) Thanks for the pr! |
@erichonkanen yeah, there is definitely some work needed on the docs. There is an open issue for documentation generally #48. I’ll try to get to it at some point, but open to PRs as well. :) |
It was changed to: Still no documentation about it |
I use mangum with FastAPI.
Also, I often create an app which authenticates the request by
Cognito
I want to obtain a few
Cognito
information(eg:cognitoIdentityPoolId
) from lambdaevent
because I must use the information for business logic on API.(https://docs.aws.amazon.com/lambda/latest/dg/with-on-demand-https.html)
Unfortunately, Mangum doesn't pass the raw lambda event object to a function(controller).
Is there a way to retrieve an event object of lambda?
Or, Could you please implement it?
Btw, I don't know how to pass it to a function 😕
The text was updated successfully, but these errors were encountered: