Repository navigation
One ODBC TLS tail helper for the SQL Server store, the DATABASE connector and the harness, and the last pin-fact copies linked (BACKLOG #3714) - #2587
Conversation
…onnector messagefoundry/odbc_dsn.py now holds the brace quoting and the Encrypt/TrustServerCertificate tail that store/sqlserver.py connection_string and transports/database.py _build_dsn each carried. A leaf module, since transports/ may not import store/. It refuses a ServerCertificate pin beside a weakened posture, a shape no current caller sends. Both builders emit the same bytes as before: 1548 shapes compared, and tests/test_odbc_dsn.py pins golden strings taken from the old code. A scan fails if an engine module writes the escape or a TLS keyword part again. It also carries the store file's pin and floor comment copies (check_pinned_certificate, connection_string, purge_search_presets), which now link to the ssl_root_cert row of docs/CONFIGURATION.md and to SYSTEM-REQUIREMENTS.md. BACKLOG #3714 item 12 and slice C leftovers.
…ION.md The [store].ssl_root_cert comment in config/settings.py (which had no Windows qualifier), the serve cert-monitor comment in __main__.py and two texts in tests/test_store_ssl.py restated the strict-pin measurement. Each now points at the one statement, the ssl_root_cert row of docs/CONFIGURATION.md, which keeps "tested on Windows". BACKLOG #3714 slice D (item 12 and slice C's leftover copies). Proposed PR title: One ODBC TLS tail helper for the SQL Server store and the DATABASE connector, and the last pin-fact copies linked (BACKLOG #3714) Proposed ledger banner: PARTIAL -- slice D: item 12 built (one leaf helper, messagefoundry/odbc_dsn.py, for brace quoting and the TLS tail; both builders byte-identical, golden tests and a no-copy scan). Slice C's leftover copies of the pin fact and the 2016 SP1 floor wording now link to docs/CONFIGURATION.md and SYSTEM-REQUIREMENTS.md. Open as before: items 2 and 11 (owner ruling 2026-10-26; item 11 is #4325), 5, 6 and 8 (CI, PR 2579), and the slice A and C open findings.
…l text From the code-review round on this branch: - harness/drivers/_database.py drops its own brace quoting and TLS tail and calls messagefoundry.odbc_dsn; its string is unchanged (216 inputs compared, plus a golden test). - The helper no longer claims ODBC keeps the last repeated keyword. Microsoft's SQLDriverConnect reference says the first, and the driver is not measured. The quoting is the guard, so say that. Same for three comments that leaned on "last-wins". - The pin-beside-weakened refusal gives the real reason: a pin sends Encrypt=strict, which would override the weakened posture asked for. - head is list[str], so a joined string cannot type-check. - The no-copy scan ignores case, sees a keyword after ';' and any "}}" constant, walks harness/ too, and has a test of its own shapes. BACKLOG #3714 slice D (item 12 and slice C's leftover copies). Proposed PR title: One ODBC TLS tail helper for the SQL Server store, the DATABASE connector and the harness, and the last pin-fact copies linked (BACKLOG #3714) Proposed ledger banner: PARTIAL -- slice D: item 12 built (one leaf helper, messagefoundry/odbc_dsn.py, for brace quoting and the TLS tail, used by the store, the DATABASE connector and the harness; each string byte-identical, golden tests and a no-copy scan). Slice C's leftover copies of the pin fact and the 2016 SP1 floor wording now link to docs/CONFIGURATION.md and SYSTEM-REQUIREMENTS.md. Open as before: items 2 and 11 (owner ruling 2026-10-26; item 11 is #4325), 5, 6 and 8 (CI, PR 2579), and the slice A and C open findings.
|
QA -- korus roles/BUILDER.md step 11 |
|
Lander (session 8a04c9f3), 2026-10-28. Enqueuing at pinned head Review proof: round 2 read this head and made no fixes. All nine required contexts are a settled success on it. Open findings. All are pre-existing or cosmetic, and none changes behaviour or weakens a control through this merge. Rows follow in a Lander ledger pass:
|
Merge danger
Reversible: yes -- a revert of this change on
mainundoes all of it.Blast radius: a new leaf module,
messagefoundry/odbc_dsn.py(odbc_brace,odbc_connection_string), now builds the ODBC TLS tail (ServerCertificateonly with a pin,Encrypt,TrustServerCertificate) and the brace quoting for three callers: the SQL Server store'sconnection_string(store/sqlserver.py), the DATABASE connector's_build_dsnand_odbc_literal(transports/database.py), and the harnessbuild_dsn(harness/drivers/_database.py). Their local_odbc_brace/_bracecopies are gone. Output is byte-identical (Evidence). One new refusal no current caller reaches: a pin besideencrypt=falseortrust_server_certificate=trueraisesValueError(sqlserver_pin_path()already returnsNoneon a weakened posture). Comments and docstrings inconfig/settings.py,store/sqlserver.py,__main__.py,tests/test_store_ssl.py,scripts/security/crypto_inventory_check.pyandcrypto_operations.pynow link to the one statement of the pin fact. 12 files.Evidence
mainand on this branch over 1548 shapes gives equal SHA-256 (store: encrypt, trust, pinNone/plain/with};=, all three auth modes, MultiSubnetFailover, passwords};DROP,a;b=c{d},}}x}, a database name with}}, the escaped weakened posture; connector: encrypt as bool, None,"false","yes", trust, authsql/integrated/entra/SQL, read_only, three driver names;_odbc_literalwith both refused sets); the harness, 216 inputs identical againstorigin/main'sharness/drivers/_database.py.tests/test_odbc_dsn.py(25 tests) pins golden strings taken from the old code for all three callers, and scansmessagefoundry/andharness/for any module that writes the}}escape or a TLS keyword part (case-insensitive, with a positive control and a walk-size guard). Sabotage turned red every time: no}doubling (13 failed), no strict (2), no refusal (3), dropped head (15), tail not last (15), a regrown brace copy (1), a regrown tail copy (5).BACKLOG #3714 slice D -- batch 342
Source branch
b342-3714d, head33a83a7b40117facf41723d2eff7061dd893b5c7, baseorigin/main83ad747d61. Commits b7bfd52 (the helper), 5b86c18 (the copies), 33a83a7 (review round 1). The head is the reviewed head: review round 2 read it, and nothing was committed after.Items
_odbc_brace" -- now one helper for the store, the connector and the harness. It sits at top level sotransports/never importsstore/.config/settings.py~959,store/sqlserver.py(check_pinned_certificate, theconnection_stringblock,purge_search_presetsnow a feature fact pointing at SYSTEM-REQUIREMENTS.md for the floor),__main__.py~4765,tests/test_store_ssl.py~340 and ~413,crypto_inventory_check.py~1550 (also stale: it named functions that no longer hold the check) all link to the CONFIGURATION.mdssl_root_certrow. Left:sqlserver.py's operator refusal text (Microsoft's documentation, not the measurement);tests/test_sqlserver_store.pyand ADR 0173 (open PR 2579 edits both). Nothing here claims PR 2579's Linux measurement.SQLDriverConnectpage as first-occurrence (not checked against the driver). The helper now says position is not the guard; the quoting and validation are. Three comments that leaned on last-wins were changed (sqlserver.py,database.py,tests/test_store_file_hardening.py).Checks (Builder's report)
/simplify;ruff check,ruff format --check; mypy in all four section 7 legs;changelog_fragments.py check(changelog.d/3714-odbc.changed.md); pytest-n 6over 42 files: 3495 passed, 254 skipped (every brief file plus the harness database and scenario tests, the vacuous-absence lint, the crypto inventory scanner, the start-up import budget, and every test namingconnection_stringor_build_dsn).CI gate, and the live SQL Server legs (test_sqlserver_store,test_database_*_integration), which build real strings through the helper.Known open findings (shipped open; two rounds, cap reached; none changes behaviour or weakens a control in this branch)
odbc_bracedoes not refuse NUL or control characters. A NUL in the head could cut the TLS tail at the driver, and with Driver 17 the default would beEncrypt=no. Unmeasured; predates this branch; fixing it is a control change.Encrypt,TrustServerCertificateorServerCertificate._build_dsnreadstrust = bool(s.get(...)), so"false"counts as true (predates the branch).database.py,settings._no_odbc_injection, the harness).odbc_dsn.pystays a leaf (unlikemllpcodecandtls_sigalgs).pipeline/cert_expiry.py~238 writes out the pin predicate instead of callingsqlserver_pin_path().f"PWD={{{p}}}") and flags any"}}"constant.purge_search_presetscomment can read as two floors.Proposed ledger banner (for the Lander)
PARTIAL, slice D -- item 12 built (one ODBC TLS tail helper for the store, the connector and the harness, byte-identical output); slice C's leftover copies linked. Items 6 and 8 are PR 2579 (measured); item 11 is #4325; open as before: items 2, 5 and the slice A and C findings.
Landing order
None required. Clean against
mainand against open PRs 2564, 2567, 2573, 2576, 2579, 2586 (each merged onto currentmainfirst).

Confidence Score: 5/5
The PR appears safe to merge; no new actionable issue was found.Summary
Moves ODBC quoting and TLS keywords into one helper for the SQL Server store, DATABASE connector, and harness.
No new actionable issues found.
Acknowledgments supplied by
wshallwshall, not repeated as findings:headremain unchecked."false"as true fortrust_server_certificate; this predates the change.pipeline/cert_expiry.pystill repeats the pin predicate."}}"constants.purge_search_presetscomment can suggest two server-version floors.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Store["SQL Server store"] --> Helper["odbc_dsn"] Connector["DATABASE connector"] --> Helper Harness["Test harness"] --> Helper Helper --> DSN["Quoted values and TLS keywords"]Reviews (1) · Last reviewed commit: "ODBC helper review round 1: harness fold..." · Reviewed by Greptile