Skip to content
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

specify * #1

Open
jonathanalberghini opened this issue Jan 26, 2019 · 5 comments
Open

specify * #1

jonathanalberghini opened this issue Jan 26, 2019 · 5 comments

Comments

@jonathanalberghini
Copy link

This code is wrong if you have caching on and resource is the method and you have more than one method it will fail.

@ozbillwang
Copy link
Contributor

ozbillwang commented Jan 27, 2019

There is not one project in this repo, could you point out which one you are talking about, and which line of codes?

say something but with no details in github world is not the right way. Use the codes to speak, thanks.

@jonathanalberghini
Copy link
Author

jonathanalberghini commented Jan 28, 2019

Sorry I should of put in more detail and your code is not really wrong. Everywhere I found uses the same code. And none of them talk about how to use the authorizer cache.
I have been experimenting with api gateway cache and authorizer cache and ran into a few weird results.

So if you use the same authorizer on more than one function in a project and have caching setup, the first call to function one will call the authorizer and will get permission to that specific lambda function with the code you have. If you call function 2 before the cache expires it will use the cached policy and the 2nd call will fail as the policy only allows function one permission resource. Tomorrow I will add the other issues I found.
I ended up doing the resource as all functions in the project / stage. I am using request-type authorizer.
I wasn't blaming anyone just thought since you have this repo you could let people know my findings so they did not have to suffer through what I had too. The authorizer cache has some weird affects on api gateway function cache I will detail those tomorrow.

@ozbillwang
Copy link
Contributor

If function "one" and "two" need different permissions, you need work with two functions.

Any thing to stop you doing that?

@ozbillwang
Copy link
Contributor

Or you can disable cache, if it is really matter.

@jonathanalberghini
Copy link
Author

jonathanalberghini commented Jan 28, 2019

It is just something that is not documented anywhere. And for my case the authorizer function is in a different project. There are 3 projects and over 100 functions that use the same authorizser. And cache really helps our response as the authorizer does a good amount of work to calculate the feed the user can access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants