FIX: Connection String Param for Authentication#368
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes the connection string parameter filtering logic for Azure AD token-based authentication. The change correctly identifies that Trusted_Connection (Windows integrated authentication) conflicts with token-based auth and should be removed, while Encrypt and TrustServerCertificate (connection security settings) do not conflict and should be retained in the connection string.
Key Changes:
- Updated
remove_sensitive_paramsfunction to removeTrusted_Connectioninstead of encryption-related parameters - Modified the test to verify the new filtering behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| mssql_python/auth.py | Updated remove_sensitive_params to exclude trusted_connection instead of encrypt and trustservercertificate from the authentication filter list |
| tests/test_008_auth.py | Updated test to include Trusted_Connection parameter and verify it's filtered out while encryption parameters are retained |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.hpp: 58.8%
mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.row.py: 66.2%
mssql_python.pybind.ddbc_bindings.cpp: 66.3%
mssql_python.helpers.py: 67.5%
mssql_python.pybind.connection.connection.cpp: 73.6%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.connection.py: 83.7%
mssql_python.cursor.py: 84.3%
mssql_python.logging.py: 85.3%🔗 Quick Links
|
gargsaumya
approved these changes
Dec 10, 2025
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.
Work Item / Issue Reference
Summary
This pull request updates the logic for filtering sensitive parameters in the authentication module. The main change is that the function now removes
Trusted_Connectioninstead ofEncryptandTrustServerCertificate, and the corresponding test has been updated to reflect this new behavior.Sensitive parameter filtering update:
mssql_python/auth.py, theremove_sensitive_paramsfunction now excludestrusted_connectioninstead ofencryptandtrustservercertificatewhen filtering parameters.Test updates for new filtering logic:
tests/test_008_auth.py, the test forremove_sensitive_paramshas been updated to expect thatEncryptandTrustServerCertificateare no longer removed, whileTrusted_Connectionis now excluded.