You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
REFACTOR: Migrate Connection string sanitization from regex to parser-based (microsoft#522)
### Work Item / Issue Reference
<!--
IMPORTANT: Please follow the PR template guidelines below.
For mssql-python maintainers: Insert your ADO Work Item ID below
For external contributors: Insert Github Issue number below
Only one reference is required - either GitHub issue OR ADO Work Item.
-->
<!-- mssql-python maintainers: ADO Work Item -->
>
[AB#43979](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/43979)
-------------------------------------------------------------------
### Summary
<!-- Insert your summary of changes below. Minimum 10 characters
required. -->
Replaces the regex-based `sanitize_connection_string()` with a
parser-based implementation
that uses `_ConnectionStringParser` to correctly handle all ODBC
connection string value
formats including braced values per ODBC spec.
## Changes
- Moved `sanitize_connection_string()` to `connection_string_parser.py`
where it naturally
belongs alongside the parser it depends on — eliminates circular import
between helpers
and parser modules
- `helpers.py` retains a thin delegate for backward compatibility
- `connection.py` imports directly from `connection_string_parser`
- Added 5 new test cases covering braced values, escaped braces, and
edge cases
## Testing
- All existing `TestPasswordSanitization` tests pass
- All connection string parser and allowlist tests pass (no regressions)
---------
Co-authored-by: gargsaumya <saumyagarg.100@gmail.com>
Co-authored-by: Jahnvi Thakkar <61936179+jahnvi480@users.noreply.github.com>
0 commit comments