This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 3b76ec9a89 Removed deprecated method requires_access from module
airflow.api_connexion.security (#41910)
3b76ec9a89 is described below
commit 3b76ec9a895484bd65bac7062ee81826c81d5304
Author: Gopal Dirisala <[email protected]>
AuthorDate: Sun Sep 1 04:48:49 2024 +0530
Removed deprecated method requires_access from module
airflow.api_connexion.security (#41910)
* Removed deprecated method requires_access from module
airflow.api_connexion.security
* news fragment added
---
airflow/api_connexion/security.py | 25 +------------------------
newsfragments/41910.significant.rst | 1 +
2 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/airflow/api_connexion/security.py
b/airflow/api_connexion/security.py
index 660bc6cce2..c6474fd600 100644
--- a/airflow/api_connexion/security.py
+++ b/airflow/api_connexion/security.py
@@ -16,9 +16,8 @@
# under the License.
from __future__ import annotations
-import warnings
from functools import wraps
-from typing import TYPE_CHECKING, Callable, Sequence, TypeVar, cast
+from typing import TYPE_CHECKING, Callable, TypeVar, cast
from flask import Response, g
@@ -33,7 +32,6 @@ from airflow.auth.managers.models.resource_details import (
PoolDetails,
VariableDetails,
)
-from airflow.exceptions import RemovedInAirflow3Warning
from airflow.utils.airflow_flask_app import get_airflow_app
from airflow.www.extensions.init_auth_manager import get_auth_manager
@@ -60,27 +58,6 @@ def check_authentication() -> None:
raise Unauthenticated(headers=response.headers)
-def requires_access(permissions: Sequence[tuple[str, str]] | None = None) ->
Callable[[T], T]:
- """
- Check current user's permissions against required permissions.
-
- Deprecated. Do not use this decorator, use one of the decorator
`has_access_*` defined in
- airflow/api_connexion/security.py instead.
- This decorator will only work with FAB authentication and not with other
auth providers.
-
- This decorator might be used in user plugins, do not remove it.
- """
- warnings.warn(
- "The 'requires_access' decorator is deprecated. Please use one of the
decorator `requires_access_*`"
- "defined in airflow/api_connexion/security.py instead.",
- RemovedInAirflow3Warning,
- stacklevel=2,
- )
- from airflow.providers.fab.auth_manager.decorators.auth import
_requires_access_fab
-
- return _requires_access_fab(permissions)
-
-
def _requires_access(*, is_authorized_callback: Callable[[], bool], func:
Callable, args, kwargs) -> bool:
"""
Define the behavior whether the user is authorized to access the resource.
diff --git a/newsfragments/41910.significant.rst
b/newsfragments/41910.significant.rst
new file mode 100644
index 0000000000..08b0cb9d30
--- /dev/null
+++ b/newsfragments/41910.significant.rst
@@ -0,0 +1 @@
+Removed deprecated method ``requires_access`` from module
``airflow.api_connexion.security``. Please use ``requires_access_*`` instead.