jason810496 commented on code in PR #59643:
URL: https://github.com/apache/airflow/pull/59643#discussion_r2637616197
##########
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:
Not sure would it be better to introduce a new query parameter to
distinguish whether to use credentials from the existed connection?
Or maybe we could change the Frontend that only passing `connection_id` and
`conn_type`, and the Backend will only fill-up the credentials if `password`
and `extra` are unset?
Since there might be user directly call public API with the existed
`connection_id`, but they want to test the credentials provided by API instead
of existed credentials in the DB / Secret.
--
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]