feat(plugins): let the extra_fields slot hide host credential inputs - #780
Merged
Merged
Conversation
This was referenced Sep 16, 2026
Contributor
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
egertaia
pushed a commit
to egertaia/tabularis-sqlserver-plugin
that referenced
this pull request
Sep 17, 2026
TabularisDB/tabularis#780 supersedes the host-side capability/field approach from #775 with a generic connection-modal.extra_fields hook (credentialFieldsHidden/setCredentialFieldsHidden) plus the existing opaque extra map, so no core schema change is needed. Rebuild this plugin's side on top of that: - Add ui/, a Vite+React IIFE bundle (per PLUGIN_GUIDE.md) contributing the "Use Windows Authentication" checkbox to connection-modal.extra_fields, gated to driver "sqlserver". It writes extra.integrated_auth and calls setCredentialFieldsHidden; degrades to a visible-but-unhidden checkbox on hosts without that hook. - ConnectionParams gains extra: HashMap<String, String>; resolve_connection_params now also resolves integrated_auth from extra["integrated_auth"] == "true", in addition to the existing Integrated Security=True connection-string path. Restructured the early-return so this works without a connection string. - Fix build_connection_key: it never folded auth mode into the pool cache key, so editing a saved connection between SQL and Windows auth could reuse a stale pool built under the previous credentials. - .tabularium: drop the now-unused supports_integrated_auth capability, add the ui_extensions entry for the new checkbox. - README: document the checkbox as a UI extension instead of a discrete connection field. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
debba
force-pushed
the
feat/connection-modal-credential-fields-slot
branch
from
September 17, 2026 07:20
ef16a27 to
8bf0680
Compare
Contributor
Preview buildThe preview build of commit |
Driver plugins that authenticate without a database login (Windows integrated authentication, IAM tokens, Kerberos) had no way to remove the username/password inputs from the connection form: the connection-modal.extra_fields slot only exposed `driver`, `extra` and `setExtraField`. The slot context now also carries `credentialFieldsHidden` and `setCredentialFieldsHidden(hidden)`. Hiding removes the username/password block and clears both values so a stale login never reaches the driver. The flag is reset whenever the driver changes (catalogue pick or connection-string import) and when the modal is re-initialised, so it never leaks between drivers. The plugin's own choice keeps living in the opaque `extra` map, which is already persisted and forwarded verbatim. No Rust changes, no new capability flag and no new ConnectionParams field: the context additions are additive and existing plugins ignore them. @tabularis/plugin-api is bumped to 0.1.2 for the typed context. Co-authored-by: Egert Aia <aiaegert@gmail.com>
debba
force-pushed
the
feat/connection-modal-credential-fields-slot
branch
from
September 17, 2026 07:22
8bf0680 to
d1d26ac
Compare
…gin inputs Hiding the host username/password inputs through the extra_fields slot cleared the form values, but on edit an empty password was omitted from the payload and update_connection kept the keychain entry. The next connect injected the stale secret again and the driver rejected it with no visible field to fix. - The modal now sends the explicit empty password while the inputs are hidden; an untouched empty password is still omitted. - keychain_utils::stored_password_change maps None to keep, "" to delete and anything else to store. update_connection deletes the keychain entry and invalidates the cache on "", save_connection skips storing it (the Linux keyutils store rejects empty secrets). - A connection-string import ignores the login part while the inputs are hidden, and drops the plugin extra fields when it switches driver, as the catalogue already does. - Docs in @tabularis/plugin-api and PLUGIN_GUIDE describe the behaviour. - Four new modal tests and three unit tests for the helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supersedes #775 with a smaller, driver-agnostic host change. Instead of a SQL Server specific
supports_integrated_authcapability plus a first-classintegrated_authconnection parameter, the host only gains a generic hook on the existingconnection-modal.extra_fieldsslot. The "Use Windows Authentication" checkbox itself moves into the SQL Server plugin as a UI extension, and its value travels in the opaqueextramap that the host already persists and forwards verbatim (#596).What changed
connection-modal.extra_fieldsslot context: addedcredentialFieldsHidden: booleanandsetCredentialFieldsHidden(hidden: boolean). When a plugin passestrue, the modal removes the username/password block and clears both values, so a stale login never reaches the driver. Passingfalseshows the inputs again (empty).keychain_utils::stored_password_changemaps an omitted password to keep, an explicit""to delete and anything else to store.update_connectiondeletes the keychain entry and invalidates the credential cache on"", so the next connect no longer injects the old secret;save_connectionskips storing an empty password. Storing""was not an option because the Linux keyutils store used by keyring rejects empty secrets.extramap is dropped, as the catalogue driver switch already does.@tabularis/plugin-api: typed context updated, version bumped to 0.1.2 (additive change,check:syncpasses).plugins/PLUGIN_GUIDE.md: slot table row documents the new context members and the save/import behaviour while hidden.tests/components/modals/NewConnectionModal.test.tsxrender a fake plugin contribution throughPluginSlotContextand verify hide/clear/restore, the explicit empty password in theupdate_connectionpayload, the unchanged omission when the inputs are visible, and both import scenarios. Three unit tests coverstored_password_change.The only backend behaviour change is the
password == ""branch with keychain enabled, which the frontend never sent on edit before and which failed on Linux on create. Other callers ofupdate_connection(built-in driver migration) resend the password loaded from the keychain, so they are unaffected. No new capability flag, no newConnectionParamsfield, no changes to the built-in drivers. Existing plugins ignore the extra context members; plugins built against@tabularis/plugin-api0.1.1 keep type-checking.Plugin side
The SQL Server plugin ships
ui/dist/index.json this slot (gated withdriver: "sqlserver"): a checkbox that writesextra.integrated_auth = "true"and callssetCredentialFieldsHidden. The Rust side resolves the flag fromextraor fromIntegrated Security=Truein a connection string, rejects a login combined with integrated authentication, and folds the flag into the pool key. On hosts without this hook the checkbox still works, only the login inputs stay visible. That work builds on TabularisDB/tabularis-sqlserver-plugin#25 and will be opened as a follow-up PR there.Verification
pnpm typecheck,pnpm exec eslinton the changed files: cleanpnpm build:plugin-apiandpnpm check:plugin-api: OKpnpm exec vitest run: 271 files, 4422 tests passing (35 in the modal file, 6 new)cargo test --lib keychain_utils_tests: 6 passing; clippy and rustfmt clean on the touched hunksdetect-changesagainst the merge base: 8 files;save_connectionandupdate_connectionsit on 15 execution flows, the behaviour change is limited to the explicit empty password branch described aboveIntegrated Security=Truein a connection string also reaches GSSAPIpnpm tauri devwith the modified plugin installed), including edit of an existing keychain-stored SQL auth connection to Windows auth, and a live SSPI test on a domain-joined Windows machine as in feat: add Windows Authentication checkbox for integrated-auth drivers #775Credits
The Windows Authentication checkbox, the hide/clear behaviour of the login inputs and the live SSPI verification against a domain-joined SQL Server come from @egertaia's work in #775 and TabularisDB/tabularis-sqlserver-plugin#25. This PR moves that design onto a generic slot hook; @egertaia is listed as co-author on the commit.