fix(sql_workbench): set passwordSaved on ODC datasource sync requests#642
Conversation
Refs #886 Explicitly send passwordSaved:true when creating or updating ODC datasources so edited passwords are encrypted into connect_connection instead of silently retaining the previous ciphertext.
PR Reviewer Guide 🔍(Review updated until commit 3c1a160)
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Add service tests asserting passwordSaved on ODC sync requests and an HTTP E2E script that rotates real Mongo credentials to verify ODC recovery.
|
Persistent review updated to latest commit 13138c4 |
PR Code Suggestions ✨No code suggestions found for the PR. |
Keep unit tests only; integration script stays in local workspace.
|
Persistent review updated to latest commit 3c1a160 |
PR Code Suggestions ✨No code suggestions found for the PR. |
User description
Summary
passwordSavedto ODC create/update datasource request structspasswordSaved: truewhen DMS syncs datasources to ODC SQL workbenchProblem
After editing a datasource password in DMS, ODC
connect_connection.passwordcould remain unchanged because the update request did not explicitly indicate the password should be saved and re-encrypted.Test plan
go test ./internal/sql_workbench/service -run PasswordSavedFixes actiontech/dms-ee#886
Description
为创建更新请求添加PasswordSaved字段
服务层自动设置PasswordSaved为true
添加单元测试验证字段正确性
Diagram Walkthrough
File Walkthrough
sql_workbench_client.go
新增PasswordSaved字段到数据源请求internal/sql_workbench/client/sql_workbench_client.go
PasswordSaved字段到创建请求结构PasswordSaved字段到更新请求结构sql_workbench_service.go
服务层设置PasswordSaved字段逻辑internal/sql_workbench/service/sql_workbench_service.go
PasswordSaved: truePasswordSaved: truesql_workbench_service_test.go
添加PasswordSaved字段的单元测试internal/sql_workbench/service/sql_workbench_service_test.go
encoding/json包