Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add [webserver]update_fab_perms to deprecated configs #40317

Merged
Merged
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
28 changes: 0 additions & 28 deletions airflow/config_templates/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1962,16 +1962,6 @@ webserver:
type: boolean
example: ~
default: "True"
update_fab_perms:
description: |
Update FAB permissions and sync security manager roles
on webserver startup
version_added: 1.10.7
type: string
example: ~
default: "True"
version_deprecated: 2.9.0
deprecation_reason: This config has been moved to fab provider. Please use the config from fab provider.
session_lifetime_minutes:
description: |
The UI cookie lifetime in minutes. User will be logged out from UI after
Expand Down Expand Up @@ -2041,24 +2031,6 @@ webserver:
type: boolean
example: ~
default: "False"
auth_rate_limited:
description: |
Boolean for enabling rate limiting on authentication endpoints.
version_added: 2.6.0
type: boolean
example: ~
default: "True"
version_deprecated: 2.9.0
deprecation_reason: This config has been moved to fab provider. Please use the config from fab provider.
auth_rate_limit:
description: |
Rate limit for authentication endpoints.
version_added: 2.6.0
type: string
example: ~
default: "5 per 40 second"
version_deprecated: 2.9.0
deprecation_reason: This config has been moved to fab provider. Please use the config from fab provider.
caching_hash_method:
description: |
The caching algorithm used by the webserver. Must be a valid hashlib function name.
Expand Down
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
6 changes: 3 additions & 3 deletions airflow/providers/fab/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ config:
auth_rate_limited:
description: |
Boolean for enabling rate limiting on authentication endpoints.
version_added: 1.0.0
version_added: 1.0.2
type: boolean
example: ~
default: "True"
auth_rate_limit:
description: |
Rate limit for authentication endpoints.
version_added: 2.6.0
version_added: 1.0.2
type: string
example: ~
default: "5 per 40 second"
update_fab_perms:
description: |
Update FAB permissions and sync security manager roles
on webserver startup
version_added: 1.10.7
version_added: 1.0.2
type: string
example: ~
default: "True"
Expand Down
43 changes: 7 additions & 36 deletions airflow/www/extensions/init_appbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,6 @@ 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"),
),
):
"""
App-builder constructor.
Expand All @@ -160,14 +147,11 @@ def __init__(
optional, your override for the global static folder
:param static_url_path:
optional, your override for the global static url path
:param update_perms:
optional, update permissions flag (Boolean) you can use
FAB_UPDATE_PERMS config key also
:param auth_rate_limited:
optional, rate limit authentication attempts if set to True (defaults to True)
:param auth_rate_limit:
optional, rate limit authentication attempts configuration (defaults "to 5 per 40 second")
"""
from airflow.providers_manager import ProvidersManager

providers_manager = ProvidersManager()
providers_manager.initialize_providers_configuration()
self.baseviews = []
self._addon_managers = []
self.addon_managers = {}
Expand All @@ -177,9 +161,9 @@ def __init__(
self.static_folder = static_folder
self.static_url_path = static_url_path
self.app = app
self.update_perms = update_perms
self.auth_rate_limited = auth_rate_limited
self.auth_rate_limit = auth_rate_limit
self.update_perms = conf.getboolean("fab", "UPDATE_FAB_PERMS")
self.auth_rate_limited = conf.getboolean("fab", "AUTH_RATE_LIMITED")
self.auth_rate_limit = conf.get("fab", "AUTH_RATE_LIMIT")
if app is not None:
self.init_app(app, session)

Expand Down Expand Up @@ -677,17 +661,4 @@ 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"),
),
)
2 changes: 1 addition & 1 deletion docs/apache-airflow/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ Setting retries for each task drastically reduces the chance that either of thes
How do I stop the sync perms happening multiple times per webserver?
--------------------------------------------------------------------

Set the value of ``update_fab_perms`` configuration in ``airflow.cfg`` to ``False``.
Set the value of ``[fab] update_fab_perms`` configuration in ``airflow.cfg`` to ``False``.


How to reduce the airflow UI page load time?
Expand Down