From d1d344b515aacb829060db476abe6f5d88a5977a Mon Sep 17 00:00:00 2001 From: dirrao Date: Fri, 23 Aug 2024 17:15:00 +0530 Subject: [PATCH 1/2] deprecatd fab auth airflow.auth.managers.fab.fab_auth_manager and airflow.auth.managers.fab.security_manager.override removed --- airflow/auth/managers/fab/fab_auth_manager.py | 36 ---------------- .../managers/fab/security_manager/override.py | 43 ------------------- .../auth-manager/webserver-authentication.rst | 4 +- 3 files changed, 2 insertions(+), 81 deletions(-) delete mode 100644 airflow/auth/managers/fab/fab_auth_manager.py delete mode 100644 airflow/auth/managers/fab/security_manager/override.py diff --git a/airflow/auth/managers/fab/fab_auth_manager.py b/airflow/auth/managers/fab/fab_auth_manager.py deleted file mode 100644 index aa7765663987a..0000000000000 --- a/airflow/auth/managers/fab/fab_auth_manager.py +++ /dev/null @@ -1,36 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -from __future__ import annotations - -from deprecated import deprecated - -from airflow.exceptions import RemovedInAirflow3Warning -from airflow.providers.fab.auth_manager.fab_auth_manager import FabAuthManager as FabAuthManagerProvider - - -@deprecated( - reason="Use airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager instead", - version="2.9.0", - category=RemovedInAirflow3Warning, -) -class FabAuthManager(FabAuthManagerProvider): - """ - This class is deprecated. - - Please use `airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager` instead. - """ diff --git a/airflow/auth/managers/fab/security_manager/override.py b/airflow/auth/managers/fab/security_manager/override.py deleted file mode 100644 index cae7da7e92592..0000000000000 --- a/airflow/auth/managers/fab/security_manager/override.py +++ /dev/null @@ -1,43 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -from __future__ import annotations - -from deprecated import deprecated - -from airflow.exceptions import RemovedInAirflow3Warning -from airflow.providers.fab.auth_manager.security_manager.override import ( - FabAirflowSecurityManagerOverride as FabProviderAirflowSecurityManagerOverride, -) - - -@deprecated( - reason="If you want to override the security manager, you should inherit from " - "`airflow.providers.fab.auth_manager.security_manager.override.FabAirflowSecurityManagerOverride` " - "instead", - category=RemovedInAirflow3Warning, -) -class FabAirflowSecurityManagerOverride(FabProviderAirflowSecurityManagerOverride): - """ - This class is deprecated. - - Please inherit from - `airflow.providers.fab.auth_manager.security_manager.override.FabAirflowSecurityManagerOverride` - instead. - """ - - ... diff --git a/docs/apache-airflow-providers-fab/auth-manager/webserver-authentication.rst b/docs/apache-airflow-providers-fab/auth-manager/webserver-authentication.rst index feabad33a806f..b4693cd7453f2 100644 --- a/docs/apache-airflow-providers-fab/auth-manager/webserver-authentication.rst +++ b/docs/apache-airflow-providers-fab/auth-manager/webserver-authentication.rst @@ -136,7 +136,7 @@ Here is an example of what you might have in your webserver_config.py: .. code-block:: python - from airflow.auth.managers.fab.security_manager.override import FabAirflowSecurityManagerOverride + from airflow.providers.fab.auth_manager.security_manager.override import FabAirflowSecurityManagerOverride from flask_appbuilder.security.manager import AUTH_OAUTH import os @@ -180,7 +180,7 @@ webserver_config.py itself if you wish. .. code-block:: python - from airflow.auth.managers.fab.security_manager.override import FabAirflowSecurityManagerOverride + from airflow.providers.fab.auth_manager.security_manager.override import FabAirflowSecurityManagerOverride import logging from typing import Any, List, Union import os From 0811546b36dc41021449b0a76ec1f9ebee004cd3 Mon Sep 17 00:00:00 2001 From: dirrao Date: Sat, 24 Aug 2024 10:45:12 +0530 Subject: [PATCH 2/2] news fragment added --- newsfragments/41708.significant.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/41708.significant.rst diff --git a/newsfragments/41708.significant.rst b/newsfragments/41708.significant.rst new file mode 100644 index 0000000000000..0b994cf0ffa30 --- /dev/null +++ b/newsfragments/41708.significant.rst @@ -0,0 +1 @@ +Removed deprecated auth manager ``airflow.auth.managers.fab.fab_auth_manager`` and ``airflow.auth.managers.fab.security_manager.override``. Please use ``airflow.providers.fab.auth_manager.security_manager.override`` instead.