-
Notifications
You must be signed in to change notification settings - Fork 170
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
don't call post action for oauth routes #343
Conversation
because there is just one instance of apicast module it can be used as global state but still thrown out when new instance is created in tests
for example oauth has own routes that can handle the request so there is no need to call post_action for them it should be called only when the access phase is evaluated
1fe2a98
to
872b598
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comment too much on the validity of the code, but I can see that we're no longer calling the proxy when requesting tokens both from RH SSO and APIcast OAuth
local p = ngx.ctx.proxy or post_action_proxy[request_id] | ||
|
||
post_action_proxy[request_id] = nil | ||
|
||
if p then | ||
p:post_action() | ||
return p:post_action() | ||
else | ||
ngx.log(ngx.INFO, 'could not find proxy for request id: ', request_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This info message looks a bit alarming, like if it was supposed to find proxy, but couldn't, while most of the times it is absolutely fine and deliberate. Maybe say "skipping post_action, as no proxy was registered for the request id", and move it to DEBUG level?...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was thinking about that. INFO is first opt-in level so it is not shown by default.
I guess this should be part of some major log refactoring as there is lots of duplicated / too verbose information already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
fixes #299 (comment)