Registry /
workflow / apache-airflow-providers-fab
The Apache Airflow FAB (Flask AppBuilder) Provider package integrates Flask-AppBuilder functionalities into Apache Airflow, primarily enhancing its User Interface (UI) and Role-Based Access Control (RBAC) capabilities. It is an actively maintained provider, with the current version being 3.6.0. New versions are released independently of core Airflow, following a strict SemVer policy, and can introduce database migrations.
Install & Compatibility
Where this runs
tested against v3.6.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.925 runs
installs and imports cleanly · install 0.0s · import 7.768s · 273.9MB
glibcpy 3.10–3.925 runs
installs and imports cleanly · install 26.6s · import 7.256s · 272MB
280MB installed
● package 280MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FabAirflowSecurityManagerOverride
✓ from airflow.providers.fab.auth_manager.security_manager.override import FabAirflowSecurityManagerOverride
Commonly imported for customizing Airflow's security manager using Flask AppBuilder.
This provider primarily extends Airflow's UI and RBAC. A common interaction is through Airflow's CLI for user management, which leverages the Flask AppBuilder backend provided by this package. For advanced authentication methods like OAuth/SSO, customization of `webserver_config.py` is required.
# This provider enhances Airflow's UI/RBAC; direct code interaction is mostly via Airflow CLI or configuration.
# Ensure Airflow is running with this provider installed.
# Example: Creating a user via Airflow CLI (which uses the FAB backend):
# Make sure to run this command in your Airflow environment where `apache-airflow-providers-fab` is installed.
# Replace sensitive details with environment variables in a production setup.
import os
# Example of setting up environment variables for a new user
# In a real scenario, you'd execute this via command line or a script,
# not directly in a Python quickstart meant for direct execution.
# For demonstration, assume these are set or replaced by actual values.
admin_username = os.environ.get('AIRFLOW_ADMIN_USERNAME', 'admin')
admin_firstname = os.environ.get('AIRFLOW_ADMIN_FIRSTNAME', 'Airflow')
admin_lastname = os.environ.get('AIRFLOW_ADMIN_LASTNAME', 'User')
admin_role = os.environ.get('AIRFLOW_ADMIN_ROLE', 'Admin')
admin_email = os.environ.get('AIRFLOW_ADMIN_EMAIL', 'admin@example.com')
admin_password = os.environ.get('AIRFLOW_ADMIN_PASSWORD', 'supersecretpassword')
# This command would typically be run in your shell:
# airflow users create \
# -u "${AIRFLOW_ADMIN_USERNAME}" \
# -f "${AIRFLOW_ADMIN_FIRSTNAME}" \
# -l "${AIRFLOW_ADMIN_LASTNAME}" \
# -r "${AIRFLOW_ADMIN_ROLE}" \
# -e "${AIRFLOW_ADMIN_EMAIL}" \
# -p "${AIRFLOW_ADMIN_PASSWORD}"
print(f"To create an Airflow user via CLI (using FAB provider's backend), run:\n")
print(f"airflow users create -u {admin_username} -f {admin_firstname} -l {admin_lastname} -r {admin_role} -e {admin_email} -p {admin_password}")
print(f"\nFor advanced authentication (e.g., OAuth), configure `webserver_config.py` as described in Airflow documentation.")
Errors
Common errors & fixes
ImportError: cannot import name '_plain_int' from 'werkzeug._internal'
This error occurs due to an incompatibility between the 'apache-airflow-providers-fab' package and the 'werkzeug' library, where the '_plain_int' function has been removed in newer versions of 'werkzeug'.
fixDowngrade 'werkzeug' to a compatible version by running 'pip install werkzeug==2.0.3'.
ModuleNotFoundError: No module named 'apache-airflow-providers-fab'
This error occurs when the 'apache-airflow-providers-fab' package is not installed or is missing from the Python environment.
fixInstall the package using 'pip install apache-airflow-providers-fab'.
AttributeError: module 'flask_appbuilder.security' has no attribute 'get_oauth_user_info'
This error occurs when attempting to use the 'get_oauth_user_info' method, which may not be available in the installed version of 'flask_appbuilder'.
fixEnsure that 'flask_appbuilder' is updated to a version that includes the 'get_oauth_user_info' method by running 'pip install flask-appbuilder==4.1.0'.
ImportError: cannot import name 'FabAirflowSecurityManagerOverride' from 'airflow.auth.managers.fab.security_manager.override'
This error occurs when the 'FabAirflowSecurityManagerOverride' class is not available in the specified module, possibly due to version mismatches or missing updates.
fixEnsure that both 'apache-airflow' and 'apache-airflow-providers-fab' are updated to compatible versions by running 'pip install apache-airflow==2.9.0 apache-airflow-providers-fab==1.2.2'.
ImportError: cannot import name 'get_db_manager' from 'airflow.providers.fab.auth_manager'
This error occurs when the 'get_db_manager' function is not available in the 'airflow.providers.fab.auth_manager' module, possibly due to recent changes or deprecations.
fixCheck the 'apache-airflow-providers-fab' documentation for updates or changes regarding the 'get_db_manager' function, and update your code accordingly.
Audit
Dependencies
apache-airflowrequiredCore Airflow dependency; provider >= 2.0 requires Airflow >= 3.0.2.
flask-appbuilderrequiredCore dependency for UI and RBAC functionalities. Specific version required by the provider.
apache-airflow-providers-common-compatoptionalCross-provider compatibility features.