Skip to content

Commit

Permalink
Use FAB auth manager in test_google_openid (apache#42622)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincbeck authored Oct 2, 2024
1 parent 330f3ef commit 6686c77
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from google.auth.exceptions import GoogleAuthError

from airflow.www.app import create_app
from tests.test_utils.compat import AIRFLOW_V_2_9_PLUS
from tests.test_utils.config import conf_vars
from tests.test_utils.db import clear_db_pools
from tests.test_utils.decorators import dont_initialize_flask_app_submodules
Expand All @@ -41,7 +42,13 @@ def google_openid_app():
)
def factory():
with conf_vars(
{("api", "auth_backends"): "airflow.providers.google.common.auth_backend.google_openid"}
{
("api", "auth_backends"): "airflow.providers.google.common.auth_backend.google_openid",
(
"core",
"auth_manager",
): "airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager",
}
):
_app = create_app(testing=True, config={"WTF_CSRF_ENABLED": False}) # type:ignore
_app.config["AUTH_ROLE_PUBLIC"] = None
Expand All @@ -67,6 +74,7 @@ def admin_user(google_openid_app):
return role_admin


@pytest.mark.skipif(not AIRFLOW_V_2_9_PLUS, reason="The tests should be skipped for Airflow < 2.9")
@pytest.mark.skip_if_database_isolation_mode
@pytest.mark.db_test
class TestGoogleOpenID:
Expand Down

0 comments on commit 6686c77

Please sign in to comment.