Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions airflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ def sensitive_config_values(self) -> Set[tuple[str, str]]: # noqa: UP006
"worker_pods_pending_timeout_check_interval",
"2.6.0",
),
("fab", "update_fab_perms"): ("webserver", "update_fab_perms", "2.9.0"),
("fab", "auth_rate_limited"): ("webserver", "auth_rate_limited", "2.9.0"),
("fab", "auth_rate_limit"): ("webserver", "auth_rate_limit", "2.9.0"),
}

# A mapping of new configurations to a list of old configurations for when one configuration
Expand Down
4 changes: 1 addition & 3 deletions airflow/providers/fab/auth_manager/fab_auth_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,7 @@ def _sync_appbuilder_roles(self):
# Otherwise, when the name of a view or menu is changed, the framework
# will add the new Views and Menus names to the backend, but will not
# delete the old ones.
if conf.getboolean(
"fab", "UPDATE_FAB_PERMS", fallback=conf.getboolean("webserver", "UPDATE_FAB_PERMS")
):
if conf.getboolean("fab", "UPDATE_FAB_PERMS"):
self.security_manager.sync_roles()


Expand Down
32 changes: 6 additions & 26 deletions airflow/www/extensions/init_appbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,9 @@ def __init__(
base_template="airflow/main.html",
static_folder="static/appbuilder",
static_url_path="/appbuilder",
update_perms=conf.getboolean(
"fab", "UPDATE_FAB_PERMS", fallback=conf.getboolean("webserver", "UPDATE_FAB_PERMS")
),
auth_rate_limited=conf.getboolean(
"fab",
"AUTH_RATE_LIMITED",
fallback=conf.getboolean("webserver", "AUTH_RATE_LIMITED", fallback=True),
),
auth_rate_limit=conf.get(
"fab",
"AUTH_RATE_LIMIT",
fallback=conf.get("webserver", "AUTH_RATE_LIMIT", fallback="5 per 40 second"),
),
update_perms=conf.getboolean("fab", "UPDATE_FAB_PERMS"),
auth_rate_limited=conf.getboolean("fab", "AUTH_RATE_LIMITED"),
auth_rate_limit=conf.get("fab", "AUTH_RATE_LIMIT"),
):
"""
App-builder constructor.
Expand Down Expand Up @@ -677,17 +667,7 @@ def init_appbuilder(app: Flask) -> AirflowAppBuilder:
app=app,
session=settings.Session,
base_template="airflow/main.html",
update_perms=conf.getboolean(
"fab", "UPDATE_FAB_PERMS", fallback=conf.getboolean("webserver", "UPDATE_FAB_PERMS")
),
auth_rate_limited=conf.getboolean(
"fab",
"AUTH_RATE_LIMITED",
fallback=conf.getboolean("webserver", "AUTH_RATE_LIMITED", fallback=True),
),
auth_rate_limit=conf.get(
"fab",
"AUTH_RATE_LIMIT",
fallback=conf.get("webserver", "AUTH_RATE_LIMIT", fallback="5 per 40 second"),
),
update_perms=conf.getboolean("fab", "UPDATE_FAB_PERMS"),
auth_rate_limited=conf.getboolean("fab", "AUTH_RATE_LIMITED"),
auth_rate_limit=conf.get("fab", "AUTH_RATE_LIMIT"),
)