rusackas opened a new pull request, #41293: URL: https://github.com/apache/superset/pull/41293
### SUMMARY SSH tunnel credential fields (`password`, `private_key`, `private_key_password`) are masked on the database write paths (`POST` / `PUT`) via `mask_password_info()`. On the read paths — `GET /api/v1/database/<pk>` and `GET /api/v1/database/<pk>/connection` — the response attached `database.ssh_tunnel.data` directly, relying solely on the `SSHTunnel.data` property to mask those fields. This applies `mask_password_info()` explicitly on the read paths as well, so the masking contract is enforced at the API boundary consistently with the write paths and is robust to any future change in `SSHTunnel.data`. Masking is idempotent, so this is safe alongside the property's existing behavior. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A — backend serialization behavior. ### TESTING INSTRUCTIONS Added `test_get_database_ssh_tunnel_credentials_are_masked` in `tests/integration_tests/databases/api_tests.py`: - Creates a database with an SSH tunnel carrying `password`, `private_key`, and `private_key_password`. - Asserts all three are masked (`XXXXXXXXXX`) on both `GET /<pk>` and `GET /<pk>/connection`. - Asserts the stored credentials remain intact (only the response is masked). Run: `pytest tests/integration_tests/databases/api_tests.py -k ssh_tunnel` ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
