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
feat: add authorizer enhanced context #776
feat: add authorizer enhanced context #776
Conversation
abcc0fd
to
5b0bea0
Compare
edit: rebase against 5.x and merge into 5.x |
thank you @frsechet ! does this apply only to |
@frsechet could you also add (a/some) test(s) similar to: https://github.com/dherault/serverless-offline/tree/master/__tests__/integration/uncategorized you can PR the |
Yes. Lambda-proxy already receives this as part of the I also took some time to add some missing properties in the event, such as the There are minor differences there between sls and sls-offline (mostly as how the I will add some tests, however I'm not confortable adding this to master as I can not get to run master on my computer, and will have no time to debug this in the coming weeks. Not even the tests are running locally :( Is that OK if I still do this PR against 5.x? |
that would be really great! otherwise stuff might be breaking down the road.
that's fine. the tests should ideally be failing anyways on out of curiosity, what's the problem you are facing with
yeah, sure, no problem. |
Hi @dnalborczyk, I can't find any tests at all that test authorizer behavior that I can expand on. Not sure at all where to begin then, as I do not have time currently to add a complete new class of tests just to add tests on a subproperty. Any pointer how I would go to just test that |
Any news on this? It would be great to have this running asap! |
hey @frsechet sorry, took me a while to get to this. I'm pulling this in for now.
It looks like the |
@frsechet @angel-carvajal planning on a |
@dnalborczyk thanks for the update! I'll keep an eye on it |
Serverless has this (not very-well documented) feature that passes lambda authorizer context data into the subsequent lambda execution event as
enhancedAuthContext
.See serverless/serverless#4374 for more info about this feature.
This is the type of event available in live environments, that serverless-offline currently does not support:
This PR adds the enhancedAuthContext property to all calls (as with serverless by default), and populates it with the context built in custom authorizers.