[coverage] Conformance findings: AUTH-012

未关闭
#896 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
python

调研方向

从 thrift_backend.py 开始,将其对主机 scheme 的处理与 common/url_utils.py::normalize_host_with_protocol 进行比较。查看 coverage PR 中的 xfail 测试 test_explicit_tls_opt_out_connects_over_plaintext_http,然后验证预期的契约:显式的 http:// 会通过明文 HTTP 连接,而省略或无效的 TLS 设置以及显式的 https:// 主机则不会。

由索引模型根据 Issue 内容生成。

描述

Summary

Surfaced by the multi-language coverage fan-out while conformance-testing these SPEC-IDs against databricks/databricks-sql-python. Each finding is committed as an expected-failure (xfail) test in the coverage PR — the test asserts the CORRECT (post-fix) behavior and stays red until THIS driver (databricks/databricks-sql-python) is fixed, then flips green as a tripwire.

Findings

  • AUTH-012 [thrift]: Thrift backend silently forces https:// onto an explicit http:// server_hostname (thrift_backend.py prepends "https://" unless the composed URI already starts with it, yielding https://http://host:port/...), so the explicit plaintext opt-out is never honoured and the cleartext endpoint is never dialed; contradicts common/url_utils.py::normalize_host_with_protocol, which preserves an explicit http:// host. Kernel/SEA honours it correctly.
    • failing test: test_explicit_tls_opt_out_connects_over_plaintext_http (see the coverage PR diff under tests/)
  • AUTH-012: Thrift backend silently forces https:// onto an explicit http:// server_hostname (thrift_backend.py prepends "https://" unless the composed URI already starts with it, yielding https://http://host:port/...), so an explicit plaintext opt-out is never honoured and the cleartext endpoint is never dialed — contradicting common/url_utils.py::normalize_host_with_protocol, which documents that an explicit http:// host is preserved. The kernel/SEA backend honours it correctly.

Reproduce & Expected

AUTH-012 — Verifies the transport-scheme contract for an EXPLICIT TLS opt-out, and that TLS is never downgraded without one.

Reproduce:

  • Local cleartext HTTP listener recording every request it receives.
  • Host = the plaintext listener's host, port = its port, TLS-disable option = canonical
    falsy value (ODBC SSL=0). Attempt to open a session.
  • Same target, TLS-disable option OMITTED entirely.
  • Same target, TLS-disable option set to a non-canonical value (e.g. ture).
  • Host given WITH an explicit https:// scheme, TLS-disable option set falsy.

Expected (per the shared spec):

  • full assertion contract:
result:
- label: explicit_opt_out
  no_unsupported_option_error: true
- label: explicit_opt_out
  plaintext_session_open_request_count: 1
- label: tls_default_absent
  plaintext_session_open_request_count: 0
- label: tls_default_typo
  plaintext_session_open_request_count: 0
- label: explicit_https_host_wins
  plaintext_session_open_request_count: 0

Context

主要语言
Python
星标
233
派生
152
平均合并
21 小时 5 分钟
30 天内合并 PR
10

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

databricks/databricks-sql-python 的其他 Issue

查看 databricks/databricks-sql-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。