Repository navigation
feat: add NTLM authentication on every platform - #58
Conversation
Upgrade mssql-tiberius-bridge to 0.3.0 and mssql-tds to 0.4.0, whose SecurityContextProvider hook (microsoft/mssql-rs#742) replaces the built-in SSPI/GSSAPI context. extra.ntlm plugs in an NtlmProvider built on the pure-Rust sspi crate, using the username (DOMAIN\user or user@domain) and password, so Linux and macOS no longer need Kerberos. The connection modal gains a "Use NTLM" checkbox that excludes Windows Authentication. Also handle mssql-tds 0.4.0's new Error::EncodedValueTooLong variant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both are now on crates.io. Map mssql-tds 0.4.0's new TvpCellSerialization error to a driver failure. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The incremental change since the last review (
Not verified: I did not run CI or Files Reviewed (1 file in this increment)
Previous Review Summaries (5 snapshots, latest commit aa59a34)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit aa59a34)Status: No Issues Found | Recommendation: Merge The incremental change since the last review (
Not verified: I did not run CI, Files Reviewed (1 file in this increment)
Previous review (commit e8a3b10)Status: No Issues Found | Recommendation: Merge The incremental change since the last review (
Not verified: I did not run the UI or the tests, and I did not test live NTLM against a real SQL Server or domain. Files Reviewed (1 file in this increment)
Previous review (commit 5546011)Status: No Issues Found | Recommendation: Merge The incremental changes since the last review (
Not verified: live NTLM against a real SQL Server or domain. I also did not run the tests. Files Reviewed (6 files in this increment)
Previous review (commit 87d9dde)Status: No Issues Found | Recommendation: Merge The incremental changes since the last review (
Not verified: live NTLM against a real SQL Server or domain. Files Reviewed (3 files in this increment)
Previous review (commit 54c59de)Status: No Issues Found | Recommendation: Merge No defects were found in the changed code. Observations (not blocking):
Files Reviewed (14 files)
Reviewed by claude-sonnet-5.5 · Input: 252 · Output: 1.3K · Cached: 165.5K |
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Replace hardcoded passwords in unit tests with a shared random_secret() helper in common.rs. Live-database tests and injection payloads are unchanged. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
@saurabh500 Please review and approve when you have time. All review comments are answered. The latest commits are Status:
|
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
@debba the Version suggestion step is failing, since this is a forked PR. I am tempted to merge this PR since I dont expect a side effect of the failing GH action. But wanted to get your opinion. |
Summary
This PR adds NTLM authentication. The user enters
DOMAIN\user(oruser@domain) and a password.NTLM works on every platform. On Linux and macOS, it does not need Kerberos,
kinit, or a system library. Today, integrated authentication on those platforms uses only Kerberos, through GSSAPI.The NTLM provider uses the
SecurityContextProviderextension point from microsoft/mssql-rs#742 (issue microsoft/mssql-rs#707). The bridge passes the provider throughConfig::security_context_provider. That method was added in saurabh500/mssql-tiberius-bridge#146 and released in version 0.3.0.Dependencies
This PR uses the published releases:
mssql-tds0.4.0 andmssql-tiberius-bridge0.3.0.Do not merge Dependabot #56 on its own. It upgrades
mssql-tdsonly. The bridge pins its ownmssql-tds, so the build breaks. This PR replaces #56.Changes
src/driver/ntlm.rsaddsNtlmProvider. It implements the mssql-tdsSecurityContextProvidertrait with the pure-RustsspiNTLM client. The crate is used withdefault-features = false.extra.ntlmflag works likeextra.integrated_auth. NTLM uses the username and password fields. NTLM requires a username. NTLM andintegrated_authcannot both be set.ntlm:<user>mode. A saved connection that changes between SQL authentication and NTLM gets its own pool.mssql-tiberius-bridgeto 0.3.0 andmssql-tdsto 0.4.0.EncodedValueTooLongandTvpCellSerialization.Limitation: The NTLM provider does not send channel bindings (Extended Protection). A server that requires Extended Protection rejects NTLM. The README states this.
Validation
cargo test: 230 unit tests pass. One test runs a full NTLM handshake betweenNtlmProviderand thesspiserver. The handshake succeeds with the correct password and fails with a wrong one.cargo clippy --all-targets -- -D warningsreports no warnings.cargo fmt --all -- --checkreports no changes.tsc --noEmitpasses. Five vitest tests pass, three of them new.vite buildpasses.markdownlint-cli2passes on the README and CHANGELOG.Not run:
🤖 Generated with Claude Code