Registry / workflow / apache-airflow-providers-fab

apache-airflow-providers-fab

JSON →
library3.6.0pypypi✓ verified 49d ago

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.

workflowweb-frameworkauth-securitydatabasedevops
pip install apache-airflow-providers-fab
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
musl
py 3.103.925 runs
installs and imports cleanly · install 0.0s · import 7.768s · 273.9MB
glibc
py 3.103.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.")
Debug
Known issues
breakingVersion incompatibility: `apache-airflow-providers-fab >= 2.0` is only compatible with Apache Airflow 3.x. If you are using Airflow 2.x, you must use `apache-airflow-providers-fab 1.x`.
fix
For Airflow 2.x, downgrade to `apache-airflow-providers-fab==1.*`. For Airflow 3.x, ensure you use `apache-airflow-providers-fab >= 2.0`.
affects: >=2.0
breakingRemoved methods and properties: `is_authorized_dataset` was removed from `FabAuthManager`; use `is_authorized_asset` instead. `oauth_whitelists` property was removed; use `oauth_allow_list` instead. The authentication type `AUTH_OID` was also removed.
fix
Update custom security manager implementations to use the new method/property names: `is_authorized_asset` and `oauth_allow_list`. Avoid using `AUTH_OID`.
affects: >=2.0
gotchaDatabase migrations: Newer versions of the FAB provider can contain database schema changes. After upgrading the provider, you must run `airflow fab-db migrate` to apply these changes.
fix
Always run `airflow fab-db migrate` after upgrading the `apache-airflow-providers-fab` package. If `FABDBManager` is configured in `[core] external_db_managers`, migrations might run automatically with `airflow db migrate`.
affects: >=1.3.0
deprecatedDeprecated configurations and Kerberos authentication removed. Various deprecated classes, parameters, and features have been removed from the provider package.
fix
Review the changelog for specific removals and update your Airflow configurations (`airflow.cfg`) and custom code to use supported alternatives.
affects: >=2.0
gotchaInsufficient Session Expiration vulnerability in older versions: When a user password was changed via the admin CLI, existing sessions for that user were not cleared, leading to prolonged access.
fix
Upgrade to `apache-airflow-providers-fab >= 1.5.2` to resolve this vulnerability. (Note: Current version 3.6.0 is not affected).
affects: <1.5.2
gotchaConfiguration for authentication: For most supported authentication options, the new `auth_manager` framework configured in `airflow.cfg` is preferred. `webserver_config.py` is still used for more advanced options like Single Sign-On (SSO) with OAuth.
fix
Prioritize `airflow.cfg` for standard authentication configurations. Use `webserver_config.py` only when advanced customization or SSO integrations are necessary.
affects: All
gotchaThe 'connexion' package may issue warnings about missing 'flask' extras. These are typically informational and do not indicate a breaking issue with `apache-airflow-providers-fab` itself. Ensure all required dependencies are installed correctly.
fix
Ensure all Airflow and provider dependencies are correctly installed. These warnings often occur when 'connexion' is installed without its 'flask' extra explicitly, but may still function. If issues arise, try explicitly installing `connexion[flask]` if required by your setup, or consult `connexion` documentation.
affects: All
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'.
fix
Downgrade '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.
fix
Install 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'.
fix
Ensure 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.
fix
Ensure 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.
fix
Check the 'apache-airflow-providers-fab' documentation for updates or changes regarding the 'get_db_manager' function, and update your code accordingly.
Upgrade
Version history
3.6.5latest on PyPI
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.
Agent activity
101 hits · last 30 days
node
10
amazonbot
4
mj12bot
3
ahrefsbot
3
sogoubot
1
bytedance
1
seranking-bot
1
Resources