diff --git a/_integration-test/test_01_basics.py b/_integration-test/test_01_basics.py index 7218f857d54..c72f224fb58 100644 --- a/_integration-test/test_01_basics.py +++ b/_integration-test/test_01_basics.py @@ -74,16 +74,28 @@ def authenticated_session(): client = httpx.Client() client.get(SENTRY_TEST_HOST, follow_redirects=True) login_csrf_token = client.cookies["sc"] - login_response = client.post( - f"{SENTRY_TEST_HOST}/auth/login/sentry/", - follow_redirects=True, - data={ - "op": "login", - "username": TEST_USER, - "password": TEST_PASS, - "csrfmiddlewaretoken": login_csrf_token, + # Password login goes through the auth API used by the React login page; + # the legacy HTML login form was removed in getsentry/sentry#126712. + # Like the React page, fetch the auth config first: it sets the session + # test cookie that the login endpoint requires. + auth_config_response = client.get( + f"{SENTRY_TEST_HOST}/api/0/auth/config/", + headers={"Referer": f"{SENTRY_TEST_HOST}/auth/login/"}, + ) + assert auth_config_response.status_code == 200, auth_config_response.text + api_login_response = client.post( + f"{SENTRY_TEST_HOST}/api/0/auth/login/", + json={"username": TEST_USER, "password": TEST_PASS}, + headers={ + "Referer": f"{SENTRY_TEST_HOST}/auth/login/", + "X-CSRFToken": login_csrf_token, }, - headers={"Referer": f"{SENTRY_TEST_HOST}/auth/login/sentry/"}, + ) + assert api_login_response.status_code == 200, api_login_response.text + login_response = client.get( + SENTRY_TEST_HOST, + follow_redirects=True, + headers={"Referer": SENTRY_TEST_HOST}, ) assert login_response.status_code == 200 parser = BeautifulSoup(login_response.text, "html.parser") diff --git a/docker-compose.yml b/docker-compose.yml index 09bfee7a759..de09815f0d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -674,7 +674,7 @@ services: environment: SENTRY_KAFKA_BROKERS_PROFILING: "kafka:9092" SENTRY_KAFKA_BROKERS_OCCURRENCES: "kafka:9092" - SENTRY_BUCKET_PROFILES: "s3://profiles?region=us-east-1&endpoint=seaweedfs:8333&s3ForcePathStyle=true&disableSSL=true" + SENTRY_BUCKET_PROFILES: "s3://profiles?region=us-east-1&endpoint=seaweedfs:8333&use_path_style=true&disable_https=true" AWS_ACCESS_KEY: "sentry" AWS_SECRET_KEY: "sentry" SENTRY_SNUBA_HOST: "http://snuba-api:1218"