Copilot commented on code in PR #59832:
URL: https://github.com/apache/airflow/pull/59832#discussion_r2648615938


##########
airflow-core/docs/howto/docker-compose/index.rst:
##########
@@ -295,9 +295,14 @@ Here is a sample ``curl`` command, which sends a request 
to retrieve a pool list
 .. code-block:: bash
 
     ENDPOINT_URL="http://localhost:8080";
-    curl -X GET  \
-        --user "airflow:airflow" \
-        "${ENDPOINT_URL}/api/v1/pools"
+    JWT_TOKEN=$(curl -s -X POST ${ENDPOINT_URL}/auth/token \
+                     -H "Content-Type: application/json" \
+                     -d '{"username": "airflow", "password": "airflow"}' |\
+                jq -r '.access_token' \
+              )
+    curl -X GET \
+        "${ENDPOINT_URL}/api/v2/pools" \
+        -H "Authorization: Bearer ${JWT_TOKEN}"

Review Comment:
   The documentation text still refers to "Basic username password 
authentication" but the code example now uses JWT token-based authentication. 
This creates a discrepancy between the description and the actual code.
   
   The text should be updated to reflect that JWT token authentication is now 
used for the REST API. Consider updating lines 287-288 to describe JWT 
authentication instead of basic authentication, or remove the outdated 
reference entirely.



##########
airflow-core/docs/howto/docker-compose/index.rst:
##########
@@ -295,9 +295,14 @@ Here is a sample ``curl`` command, which sends a request 
to retrieve a pool list
 .. code-block:: bash
 
     ENDPOINT_URL="http://localhost:8080";
-    curl -X GET  \
-        --user "airflow:airflow" \
-        "${ENDPOINT_URL}/api/v1/pools"
+    JWT_TOKEN=$(curl -s -X POST ${ENDPOINT_URL}/auth/token \
+                     -H "Content-Type: application/json" \
+                     -d '{"username": "airflow", "password": "airflow"}' |\
+                jq -r '.access_token' \
+              )

Review Comment:
   The updated code example now requires `jq` to parse the JSON response and 
extract the access token, but there is no mention of this prerequisite in the 
documentation. Users who don't have `jq` installed will encounter an error when 
trying to run this command.
   
   Consider adding a note about the `jq` dependency before the code example, or 
provide an alternative approach that doesn't require `jq` (such as using `grep` 
and `sed` for simpler parsing, though this may be less robust).



-- 
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]

Reply via email to