This is an automated email from the ASF dual-hosted git repository.
vincbeck 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 4c8c72f4a4 Fix logout in AWS auth manager (#42447)
4c8c72f4a4 is described below
commit 4c8c72f4a46d2805b1b6578bc4ec7486151826a2
Author: Vincent <[email protected]>
AuthorDate: Tue Sep 24 08:55:38 2024 -0700
Fix logout in AWS auth manager (#42447)
---
airflow/providers/amazon/aws/auth_manager/views/auth.py | 2 +-
tests/providers/amazon/aws/auth_manager/views/test_auth.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/airflow/providers/amazon/aws/auth_manager/views/auth.py
b/airflow/providers/amazon/aws/auth_manager/views/auth.py
index 7ea602d0dd..e08c2a7a6e 100644
--- a/airflow/providers/amazon/aws/auth_manager/views/auth.py
+++ b/airflow/providers/amazon/aws/auth_manager/views/auth.py
@@ -61,7 +61,7 @@ class AwsAuthManagerAuthenticationViews(AirflowBaseView):
saml_auth = self._init_saml_auth()
return redirect(saml_auth.login())
- @expose("/logout")
+ @expose("/logout", methods=("GET", "POST"))
def logout(self):
"""Start logout process."""
session.clear()
diff --git a/tests/providers/amazon/aws/auth_manager/views/test_auth.py
b/tests/providers/amazon/aws/auth_manager/views/test_auth.py
index 435dd8d2c3..05d2fb84b5 100644
--- a/tests/providers/amazon/aws/auth_manager/views/test_auth.py
+++ b/tests/providers/amazon/aws/auth_manager/views/test_auth.py
@@ -69,7 +69,7 @@ def aws_app():
) as mock_is_policy_store_schema_up_to_date:
mock_is_policy_store_schema_up_to_date.return_value = True
mock_parser.parse_remote.return_value = SAML_METADATA_PARSED
- return application.create_app(testing=True)
+ return application.create_app(testing=True,
config={"WTF_CSRF_ENABLED": False})
@pytest.mark.db_test
@@ -82,7 +82,7 @@ class TestAwsAuthManagerAuthenticationViews:
def test_logout_redirect_to_identity_center(self, aws_app):
with aws_app.test_client() as client:
- response = client.get("/logout")
+ response = client.post("/logout")
assert response.status_code == 302
assert
response.location.startswith("https://portal.sso.us-east-1.amazonaws.com/saml/logout/")