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

Use FAB auth manager in test_google_openid #42622

Merged
merged 2 commits into from
Oct 2, 2024
Merged
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
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