feat(drivers): Windows integrated (Kerberos) auth for SQL Server (#1961)#1962
feat(drivers): Windows integrated (Kerberos) auth for SQL Server (#1961)#1962Seha16 wants to merge 3 commits into
Conversation
|
Testing evidence on Arch Linux Kernel 7.1.5 with krb5 (Kerberos) with default_realm patched to the needed one: kerberos-testing.mp4 |
…op storing unused passwords
|
Pushed Kerberos through an SSH tunnel was asking for the wrong SPN
The socket and the service name are now separate: Kerberos was writing a password into the keyring
Auth mode no longer lives in widget visibility
That also fixes two things the visibility coupling had introduced:
Kerberos is a cargo feature now
Debug builds no longer abort[profile.dev.package.libgssapi]
debug-assertions = falseThe UB precondition check is emitted per crate, so turning it off for that one package makes Also
Two things I did not doThe flatpak manifest is unverified.
Cargo.lock is unchanged: |
Summary
Adds Windows integrated authentication (Kerberos / GSSAPI) to the Linux SQL Server driver — connect with your
kinitticket instead of a SQL login. Fixes #1961.core:AuthMode { Password, Kerberos }+ConnectOptions.auth_mode;DatabaseDriver::supports_integrated_auth()(defaultfalse).drivers/mssql: tiberiusintegrated-auth-gssapifeature;connect()usesAuthMethod::Integratedfor Kerberos (ambient credential cache, SPNMSSQLSvc/<host>:<port>).storage:SavedConnection.auth_modepersisted (legacy files default toPassword).app: connect-dialog "Method" selector, shown only for integrated-capable drivers; Kerberos hides username/password; validity / label / dedup updated.libkrb5-devandclang(libgssapi-sys linksgssapi_krb5and runs bindgen).Depends on #1958
This branch is stacked on the SQL Server driver PR (#1958). Until that merges, this PR's diff also contains #1958's commit (
feat(drivers): add SQL Server driver via tiberius). Please review/merge after #1958 — the diff then reduces to the single Kerberos commit.Test plan
cargo build --workspace;cargo test --workspace --lib(core + storageauth_moderound-trip/legacy default; mssqlsupports_integrated_auth)cargo fmt --all -- --check;cargo clippy --all-targets -- -D warningsKnown upstream-crate limitations (with workarounds)
default_realm(+[capaths]/[domain_realm]) soMSSQLSvc/<host>:<port>maps to the service realm. Proper fix: host-based SPN (GSS_C_NT_HOSTBASED_SERVICE) upstream in tiberius.slice::from_raw_parts(null, 0), tripping Rust's UB precondition check (debug only). Run a release build (debug-assertions off) for Kerberos. Proper fix: null-guard upstream in libgssapi (0.4.6 is the latest^0.4.5).Neither limitation affects CI (build + unit tests; no live handshake) or the SQL-login path.