mik-laj commented on a change in pull request #15295:
URL: https://github.com/apache/airflow/pull/15295#discussion_r611433820
##########
File path: airflow/www/security.py
##########
@@ -44,6 +46,24 @@
}
+class DefaultSessionInterface(SecureCookieSessionInterface):
+ """
+ Default cookie session interface.
+ This prevents creating flask sessions on REST API requests.
+ """
+
+ def save_session(self, *args, **kwargs):
+ """Prevent creating session from REST API requests."""
+ if g.get('login_from_api'):
Review comment:
Maybe we should do check here `if request.url.startswith ("/api/")`?
This will then simplify the code a bit. And it will also prevent discovery
endpoints(non-login-required) e.g. `/healtth`, `/version` from creating
sessions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]