choo121600 commented on code in PR #59643:
URL: https://github.com/apache/airflow/pull/59643#discussion_r2637698743


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/connections.py:
##########
@@ -234,6 +237,22 @@ def test_connection(
     try:
         data = test_body.model_dump(by_alias=True)
         data["conn_id"] = transient_conn_id
+
+        try:
+            existing_conn = 
Connection.get_connection_from_secrets(test_body.connection_id)
+            if data.get("password") is not None and existing_conn.password is 
not None:
+                data["password"] = merge(data["password"], 
existing_conn.password, "password")

Review Comment:
   I agree that if an API user provides both `connection_id` and `password`, 
the current behavior may not match what the user expects. Thanks for find this!
   I’m currently thinking about how to resolve this, but it’s starting to feel 
a bit complex as more conditions are added😢
   
   I think I’ll need to take a closer look later this evening. Understanding 
the secrets backend also feels somewhat complex, so it may take a bit more time.



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