[Fix-17813][ApiServer] Correct the password processing logic during data source modification#18386
[Fix-17813][ApiServer] Correct the password processing logic during data source modification#18386njnu-seafish wants to merge 2 commits into
Conversation
SbloodyS
left a comment
There was a problem hiding this comment.
I think this is unnessnary since we've already return hiddened password. There is no essential difference between your implementation and the current one.
In the current implementation, saving without changing the password can easily lead to mistakenly treating the hidden password returned by the backend as the actual password in the data source. Based on the feedback in issues like #17813 and #18004, users are currently prone to accidentally overwriting the correct password due to the mask. This PR implements the solution discussed previously by the senior team: the backend no longer returns the password, and the frontend prompts the user to 'Enter a new password (leave blank to keep the current one)'. |

Was this PR generated or assisted by AI?
NO
Purpose of the pull request
close #17813
Brief change log
Based on the feedback in issues like #17813 and #18004, users are currently prone to accidentally overwriting the correct password due to the mask. This misoperation is highly likely to cause data source password anomalies in scheduled SQL tasks, compromising the stability of the production environment.
As previously discussed, One effective approach I can think of is to return an empty password field each time, meaning the interface never returns the password. Whenever the data source is updated, the password must be re-entered.
When the user clicks edit, the backend returns an empty password (password: ""). This leaves the frontend password field blank. If the user saves directly, the frontend sends password: "", and the backend detects the empty value and retains the existing password in the database.
dynamically set password placeholder based on edit/create mode, add clearer and more user-friendly password placeholder for edit mode:
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
Pull Request Notice
Pull Request Notice
If your pull request contains incompatible change, you should also add it to
docs/docs/en/guide/upgrade/incompatible.md