pateash commented on code in PR #36275:
URL: https://github.com/apache/airflow/pull/36275#discussion_r1429900310
##########
tests/api_connexion/endpoints/test_dag_run_endpoint.py:
##########
@@ -1861,3 +1861,17 @@ def test_should_respond_404(self):
environ_overrides={"REMOTE_USER": "test"},
)
assert response.status_code == 404
+
+ def test_should_respond_200_with_anonymous_user(self, dag_maker, session):
+ self.app.config["AIRFLOW__API__AUTH_BACKENDS"] =
"airflow.api.auth.backend.default"
+ self.app.config["AUTH_ROLE_PUBLIC"] = "Admin"
+
+ dag_runs = self._create_test_dag_run(DagRunState.SUCCESS)
+ session.add_all(dag_runs)
+ session.commit()
+ created_dr = dag_runs[0]
+ response = self.client.post(
+ f"api/v1/dags/{created_dr.dag_id}/dagRuns",
+ json={"dag_run_id": "TEST_DAG_RUN_ID_1", "note": "I am setting a
note with anonymous user"},
+ )
+ assert response.status_code == 200
Review Comment:
still getting 401, unauthorized 🤔
<img width="1199" alt="image"
src="https://github.com/apache/airflow/assets/16856802/39a82fec-bb07-4b17-b54e-a2425adc9165">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]