Allow generic before_request#3970
Conversation
8f26bdc to
cd3415d
Compare
mistercrunch
left a comment
There was a problem hiding this comment.
Would a more generic approach of a flask_app_mutator configuration hook work?
flask_app_mutator would be a configuration function that can be provided in your environment, receives the app object and can alter it in any way.
There's a fair amount of flask related hook earlier and it shows that a more generic one might be the one answer to a family of needs.
There was a problem hiding this comment.
Is this something specific to Airbnb's internal_auth or a certain flavor of proxies? Googling "X-CLIENT-SSL-CERT" doesn't give out much result so that doesn't seem like a standard.
There was a problem hiding this comment.
Not sure if we should tax the package with this even though some folks may not need this or even use SSL to run Superset (most likely the proxy/LB is taking care of that)
There was a problem hiding this comment.
You probably need to resync your repo as this change has been previously resolved.
cb0cef8 to
6d83570
Compare
a8c9788 to
48d1375
Compare
48d1375 to
69d5e5e
Compare
|
From reading your earlier code it seems like your goal was to raise if some SSL cert related condition wasn't met. Now it looks like you'd be swallowing these errors making the hook useless. I'm curious why you disregarded my suggestion around |
|
@mistercrunch can you be more specific about what you mean by a |
|
Here: #3997 |
|
I went ahead with this approach because the other issue where you mentioned flask_app_mutator was also trying to use before_request and this approach solves both problems (once I remove the try catch). But now I see how your even more general solution solves other problems too. We can proceed with #3997 . |
|
Superseeded by #3997 |
This PR allows users specify functions that will be run before every request in their internal config file. These functions tend to be very specific so this approach allows each deployment have filters that don't interfere with other user deployments.
Could help with #3623
@john-bodley @mistercrunch