Configuring the Flask Application for the Airflow UI¶
FabAuthManager uses Flask to render the Airflow UI. When initialized, it uses predefined
configuration based on the webserver section of airflow.cfg. You can override these
settings and add extra Flask configuration in the webserver_config.py file specified by
[fab] config_file (by default $AIRFLOW_HOME/webserver_config.py). This file is
automatically loaded by the FAB auth manager.
For example if you would like to change rate limit strategy to “moving window”, you can set the
RATELIMIT_STRATEGY to moving-window.
You could also enhance / modify the underlying flask app directly,
as the app context is pushed to webserver_config.py:
from flask import current_app as app
@app.before_request
def print_custom_message() -> None:
print("Executing before every request")