Skip to content

feat(mysql): support cleartext auth plugin for Warpgate bastions (#336)#337

Open
pokertour wants to merge 1 commit into
TabularisDB:mainfrom
pokertour:feat/mysql-cleartext-plugin-warpgate
Open

feat(mysql): support cleartext auth plugin for Warpgate bastions (#336)#337
pokertour wants to merge 1 commit into
TabularisDB:mainfrom
pokertour:feat/mysql-cleartext-plugin-warpgate

Conversation

@pokertour

Copy link
Copy Markdown

Add an opt-in "cleartext password plugin" toggle for MySQL/MariaDB so connections can authenticate through bastions like Warpgate, which require the mysql_clear_password auth plugin. The option is gated on a TLS mode being enabled — cleartext credentials are refused over an unencrypted link.

Bastions like Warpgate proxy MySQL but do not implement the prepared-statement protocol (COM_STMT_PREPARE), so any sqlx::query() — which always prepares — failed with server error 1047 ("Not implemented"). When the cleartext plugin is enabled, the whole MySQL driver now routes statements through the text protocol (COM_QUERY via sqlx::raw_sql): introspection, SHOW CREATE, query execution/streaming, view/trigger DDL, inserts/updates/ deletes (values inlined as escaped literals), EXPLAIN, and export.

Also fix a pool cache-key collision: the ad-hoc key (used for unsaved connections, e.g. the New Connection modal) omitted the username. Warpgate multiplexes many targets behind one host:port and selects the backend by username, so two different targets shared a pool and served each other's databases. The key now includes the username and the cleartext flag.

Tests: pure literal/escaping helpers and pool-key regressions.

Closes #336

…ularisDB#336)

Add an opt-in "cleartext password plugin" toggle for MySQL/MariaDB so
connections can authenticate through bastions like Warpgate, which require
the mysql_clear_password auth plugin. The option is gated on a TLS mode
being enabled — cleartext credentials are refused over an unencrypted link.

Bastions like Warpgate proxy MySQL but do not implement the
prepared-statement protocol (COM_STMT_PREPARE), so any sqlx::query() — which
always prepares — failed with server error 1047 ("Not implemented"). When the
cleartext plugin is enabled, the whole MySQL driver now routes statements
through the text protocol (COM_QUERY via sqlx::raw_sql): introspection,
SHOW CREATE, query execution/streaming, view/trigger DDL, inserts/updates/
deletes (values inlined as escaped literals), EXPLAIN, and export.

Also fix a pool cache-key collision: the ad-hoc key (used for unsaved
connections, e.g. the New Connection modal) omitted the username. Warpgate
multiplexes many targets behind one host:port and selects the backend by
username, so two different targets shared a pool and served each other's
databases. The key now includes the username and the cleartext flag.

Tests: pure literal/escaping helpers and pool-key regressions.
@kilo-code-bot

kilo-code-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (18 files)
  • src-tauri/Cargo.lock
  • src-tauri/src/drivers/mysql/explain.rs
  • src-tauri/src/drivers/mysql/export.rs
  • src-tauri/src/drivers/mysql/helpers.rs
  • src-tauri/src/drivers/mysql/mod.rs
  • src-tauri/src/drivers/mysql/tests.rs
  • src-tauri/src/models.rs
  • src-tauri/src/pool_manager.rs
  • src-tauri/src/pool_manager_tests.rs
  • src/components/modals/NewConnectionModal.tsx
  • src/i18n/locales/de.json
  • src/i18n/locales/en.json
  • src/i18n/locales/es.json
  • src/i18n/locales/fr.json
  • src/i18n/locales/it.json
  • src/i18n/locales/ja.json
  • src/i18n/locales/ru.json
  • src/i18n/locales/zh.json

Reviewed by kimi-k2.6-20260420 · 4,031,307 tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: MySQL: expose option to enable mysql_clear_password (cleartext) auth plugin

1 participant