Skip to content

fix(warning): stop warning on the schema read (3.9.1) - #241

Merged
cayossarian merged 5 commits into
mainfrom
fix/schema-warning
Nov 16, 2026
Merged

cayossarian merged 5 commits into
mainfrom
fix/schema-warning

Conversation

@cayossarian

Copy link
Copy Markdown
Member

Summary

  • The schema read no longer triggers the plaintext-transport warning. get_homie_schema carries no credential in either direction. Since SPAN Panel 2.3.0 the integration reads it in its config flow before the panel's CA is pinned, so each panel's first discovery or add after a start logged a warning naming the passphrase and broker password. That read also used up the once-per-panel slot the registration behind it needs.
  • The exemption is decided by the request's shape. Only a bare request (no headers, no body) to the CA, status or schema path is exempt, so a credential later added to one of those calls warns.
  • SpanMqttClient warns once per client when MqttClientConfig.ca_pem pins a TLS broker and no ssl_context covers the REST calls. That is the one posture whose plaintext schema reads nothing else would report.
  • AsyncMqttBridge warns once per bridge when use_tls=False. The broker username, password, panel data and commands then cross in plaintext, and the bridge said nothing about it.
  • Docstrings now say pinning is trust on first use, not a fingerprint confirmation, and that a configured panel's schema should be read over that panel's own transport.
  • Version: 3.9.1b1, to test the integration against before the final.

Testing

  • Full suite: 2351 passed, 7 skipped, 9 xfailed.
  • tests/test_plaintext_warning.py asserts, for each public bootstrap call, that it warns exactly when it carries a credential. Its completeness guard is built from the coroutines auth and detection define. A posture table covers every combination of use_tls, ca_pem and ssl_context. Each guard was proven by mutation.
  • tests/test_plaintext_broker_warning.py checks that the broker warning fires once across reconnects and rebuilds, and never logs the password.

With use_tls=False the CONNECT packet carries the broker username and password, and every panel reading and command crosses in plaintext. The bridge resolves no trust anchor in that posture, so nothing on the MQTT side said so; the schema read's transport warning had been the session's only line.
…es unreported

The Homie schema read carries no credential in either direction, yet a consumer reading it before pinning the panel's CA logged a warning naming the passphrase and broker password and used up the once-per-panel slot the registration behind it needs. The transport now exempts a bare request to the CA, status or schema path, judged by the request's shape, so a credential later added to one of them warns. SpanMqttClient warns once when a pinned TLS broker sits beside REST calls with no ssl_context, the one posture whose plaintext schema reads nothing else reports. Docstrings now say pinning is trust on first use.
@cayossarian cayossarian changed the title fix(warning): stop warning on the schema read (3.9.1b1) fix(warning): stop warning on the schema read (3.9.1) Nov 16, 2026
@cayossarian
cayossarian merged commit cb0a27c into main Nov 16, 2026
6 checks passed
@cayossarian
cayossarian deleted the fix/schema-warning branch November 16, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant